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

make_fitswcs_transform to handle header with no PC #139

Open
pllim opened this issue Mar 14, 2018 · 8 comments
Open

make_fitswcs_transform to handle header with no PC #139

pllim opened this issue Mar 14, 2018 · 8 comments

Comments

@pllim
Copy link
Contributor

pllim commented Mar 14, 2018

make_fitswcs_transform() (https://github.com/spacetelescope/gwcs/blob/master/gwcs/utils.py#L322) needs to be more generic to handle WCS header without PC. xref #99 (comment)

This issue is as discussed with @jdavies-st

@jdavies-st
Copy link
Contributor

Yes, i.e. handle the case where there's a CD matrix instead of a PC matrix.

@pllim
Copy link
Contributor Author

pllim commented Mar 14, 2018

For comparison, that same header that crashed GWCS has the following response from astropy.wcs:

>>> from astropy.wcs import WCS
>>> w = WCS(header)
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'unitfix' made the change 'Changed units: 'degree' -> 'deg', 'degree' -> 'deg''. [astropy.wcs.wcs]
>>> w
WCS Keywords

Number of WCS axes: 2
CTYPE : 'RA---TAN'  'DEC--TAN'  
CRVAL : 299.91736667  22.68769444  
CRPIX : 5276.0  25.0  
CD1_1 CD1_2  : -5.611e-05  0.0  
CD2_1 CD2_2  : 0.0  5.611e-05  
NAXIS : 2272  4273

@sosey
Copy link
Member

sosey commented Mar 14, 2018

something like datamodel.get_fits_wcs() ?

@pllim
Copy link
Contributor Author

pllim commented Mar 14, 2018

Why do I need datamodel here? This is not JWST data.

@sosey
Copy link
Member

sosey commented Mar 14, 2018

get_fits_wcs() pulls the fits wcs info from datamodels, I've used it with jwst data, but a datamodel doesn't have to be jwst science or reference files. Was just posting as an example of what you might want. I used datamodel as a placeholder for any data model with header info and data info, since people are usu pulling the header that's associated with some data.

@pllim
Copy link
Contributor Author

pllim commented Mar 20, 2018

Re: get_fits_wcs() -- jwst dependency is a deal-breaker for this use case. FYI.

@pllim
Copy link
Contributor Author

pllim commented Mar 20, 2018

Update: I am investigating a fix. PR forthcoming...

@stscijgbot
Copy link

This ticket is now being tracked at AL-42

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