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

SPICE reader: exclude HDUs for additional distortion information #215

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

ebuchlin
Copy link

@ebuchlin ebuchlin commented Oct 6, 2022

Solves #208 : read_spice_l2_fits failed on files with additional distortion information, which is stored in the WCSDVARR ImageHDUs. The code wrongly interpreted these as spectral windows HDUs, and this resulted in an error, as described in #208.

This PR (my first one in a SunPy affiliated project) is simply to ignore these HDUs containing distortion information.

Distortion from the instrument optics is already corrected in SPICE L2 FITS files, but the additional distortion in the WCSDVARR HDUs is the one that comes from spacecraft pointing changes, as obtained by the pipeline from the Solar Orbiter SPICE kernels.

In the future, a SPICE FITS file reader should have the option to take into account this information instead of ignoring it. How this should be done is still unclear, a possibility is to reproject on a non-distorted grid, but this has drawbacks, and requires deciding what to do in problematic cases (e.g. when pointing jitter in the scanning direction is larger than the raster step).

Eric Buchlin added 2 commits October 6, 2022 17:11
HDUs for lost pixels were already excluded following sunpy/sunraster
issue sunpy#202, as they are not PrimaryHDU or ImageHDUs
@DanRyanIrish
Copy link
Member

HI @ebuchlin. Thanks so much for this PR. And congrats on making your first to a sunpy-affiliated package! These changes look good.

Could you please also add a changelog file in the changelog directory briefly describing this change? Instructions on how to write and name changelog files can be found here. All sunpy-sponsored packages use this way of building up changelogs so it's useful thing to know.

@nabobalis
Copy link
Contributor

Thanks for the PR. I will get this merged and released today.

@nabobalis
Copy link
Contributor

This is now on PyPI as 0.4.3.

@ebuchlin
Copy link
Author

ebuchlin commented Oct 6, 2022

Thanks!

@DanRyanIrish
Copy link
Member

Thanks @ebuchlin!

@ebuchlin ebuchlin changed the title Exclude HDUs for additional distortion information SPICE reader: exclude HDUs for additional distortion information Oct 9, 2022
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

Successfully merging this pull request may close these issues.

3 participants