Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert method fails for HST apertures #145

Open
Russell-Ryan opened this issue Apr 15, 2020 · 9 comments
Open

convert method fails for HST apertures #145

Russell-Ryan opened this issue Apr 15, 2020 · 9 comments

Comments

@Russell-Ryan
Copy link

I was trying to convert coordinates for the HST apertures, and pysiaf fails. This is what I did:

import pysiaf
hst=pysiaf.Siaf('HST')
uvis1=hst['IUVIS1']
uvis1.convert(1,1,'sci','det')

The traceback is very long, but the last stanza gives:

~/miniconda3/envs/astroconda37/lib/python3.7/site-packages/pysiaf/aperture.py in linear_transform_model(from_system, to_system, parity, angle_deg)
   2017     if type(angle_deg) not in [int, float, np.float64, np.int64]:
   2018         raise TypeError('Angle has to be a float. It is of type {} and has the value {}'.format(
-> 2019             type(angle_deg), angle_deg))
   2020 
   2021     # check for allowed system pairs

TypeError: Angle has to be a float. It is of type <class 'NoneType'> and has the value None

This is running:
pysiaf.version
'0.7.1'

I did this with the JWST apertures, and things seemed to work. Any advice here? Is this a issue with the HST reference files?

@Johannes-Sahlmann
Copy link
Collaborator

This is a missing functionality. In all my HST use cases so far I worked with Science pixels and did not convert to Detector pixels.

One would have to find out what the HST equivalent of DetSciAngle is and add it to _hst_to_jwst_keys in aperture.py. (This is also what the error refers to.)

@Russell-Ryan
Copy link
Author

Russell-Ryan commented Apr 15, 2020 via email

@Russell-Ryan
Copy link
Author

Russell-Ryan commented Apr 15, 2020 via email

@Johannes-Sahlmann
Copy link
Collaborator

I suggest to consult with @ColinRCox

@ColinRCox
Copy link
Collaborator

In the HST SIAF we did not really have any connection with the detector layout. We always worked with a set of image pixels which correspond to the displayed images. Unless anything else is known I would assume these frames are aligned with the detector. The DetSciAngle is the angle between the detector Y axis and the Science (or for HST the iraf) frame Y axis. For JWST this is almost always zero. We have a couple of cases where it is 180 degrees. I would assume for HST you can always assume zero.

@Russell-Ryan
Copy link
Author

Russell-Ryan commented Apr 16, 2020 via email

@Johannes-Sahlmann
Copy link
Collaborator

You could try to insert

uvis1.DetSciParity = 1     
uvis1.DetSciYAngle = 0. 

before the call to .convert

@Russell-Ryan
Copy link
Author

Russell-Ryan commented Apr 18, 2020 via email

@jdavies-st
Copy link
Collaborator

I ran into this same issue.

I had to do the following to get det_to_tel to work:

uvis1.DetSciParity = 1
uvis1.DetSciYAngle = 0.
uvis1.XDetRef = uvis1.XSciRef
uvis1.YDetRef = uvis1.YSciRef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants