SPICE reader: exclude HDUs for additional distortion information #215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).