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

EXP: Support JWST ASDF-in-FITS in reference viewer #781

Merged
merged 1 commit into from
Jul 31, 2019

Conversation

pllim
Copy link
Collaborator

@pllim pllim commented Jul 27, 2019

Need to discuss how to best generalize the ASDF loading in reference viewer. This might change depending on how #764 goes (currently does not depend on it). Will just roll with this and follow up in a separate PR after #764 is rebased on this and merged.

These are the changes necessary for Python in Astronomy 2019 demo using Ginga standalone GUI (reference viewer) to view ASDF-in-FITS data file generated by JWST. Follow up of #719. Also see spacetelescope/stginga#155

cc @jdavies-st (in case you are interested), @hcferguson , and @eteq

Figure out why compass in Pan appears weird for the ASDF extension, but not FITS. Maybe spacetelescope/gwcs#241 ?

Future work:

  • Ginga should not emit error when RA or Dec is NaN, but instead silently format the string to something equivalent (the default "BAD WCS" is probably a little misleading in this case). See "BAD WCS" error is too verbose #782
  • Figure out a better way to support ASDF loader customization.

@pllim pllim self-assigned this Jul 27, 2019
@@ -226,15 +226,18 @@ def datapt_to_system(self, datapt, system=None, coords='data',
"""
if self.coordsys == 'raw':
raise common.WCSError("No usable WCS")
elif self.coordsys == 'world':
Copy link
Collaborator Author

@pllim pllim Jul 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary for WCSAxes plugin to work for GWCS generated by JWST data.

Copy link
Owner

@ejeschke ejeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me. Do you want to merge before #764 or after? If before, I can rebase #764.

except Exception:
tb_str = "Traceback information unavailable."
self.logger.error(tb_str)
self.logger.warning(tb_str)
Copy link
Owner

@ejeschke ejeschke Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pllim, any particular reason for changing the logging of this traceback to a warning?

Edit: Hmm, just read #782. I suppose that is the reason? Maybe we should fix that by a separate PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this was a leftover from my attempt to silence the bad WCS calculations, as GWCS returns nan for RA and Dec for pixels outside of image bounds. It didn't really work as I thought it would anyway, so I will go ahead and revert this change here. Thanks for catching it.

Generalize data and WCS lookup in ASDF more.

[skip appveyor]
@pllim pllim force-pushed the jwst-asdf-pyastro2019 branch from 43de0bd to 281c852 Compare July 31, 2019 02:26
@pllim pllim added this to the 3.0 milestone Jul 31, 2019
@pllim
Copy link
Collaborator Author

pllim commented Jul 31, 2019

@ejeschke , given your approval above, I am going to take the liberty to merge this in. I have removed the unnecessary changing from error to warning for bad WCS. Thanks!

@pllim pllim merged commit 01232d3 into ejeschke:master Jul 31, 2019
@pllim pllim deleted the jwst-asdf-pyastro2019 branch July 31, 2019 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants