sunraster
sunraster copied to clipboard
Should this package continue to exist?
Provide a general description of the issue or problem.
As time progresses, I am more and more of the opinion that subclassing ndcube classes to add functionality specific to certain world axes is harmful as it makes things harder for users in the long run.
What I'd like to see is a list of the functionality in sunraster which is unique to this package and then a discussion about what the best ways of providing that functionality without subclassing NDCube or NDCubeSequence are. Then hopefully we can learn some stuff and make things more uniform for users.
@nabobalis @DanRyanIrish Thoughts?
@Cadair I agree with you. I think the aim should be to discontinue this package. sunraster does provide a few useful functionalities that IRIS and SPICE users rely on. However, I think these could be transferred to irispy-lmsal, sospice and sunpy core. Therefore, we need a roadmap to do these tasks before sunraster can be discontinued.
sunraster's unique functionalities
SpectrogramCube
instrument_axes
Tracks what axes correspond to slit position, pixel along slit, raster number, etc.
Solution to remove:
- Move
instrument_axesinformation into sliceableNDMeta. - The
instrument_axesproperty can then simply returnself.meta.get("instrument_axes"). - The
instrument_axesproperty can then be deprecated in favour ofself.meta.get("instrument_axes"), so that workflows will work with plainNDCubeobjects withinstrument_axesin their meta instead ofSpectrogramCube.
Status: Ongoing as part of #273
axis_world_coords Convenience Properties
SpectrogramCube.spectral_axis, SpectrogramCube.time and SpectrogramCube.celestial enable users to retrieve high level coordinate objects of the coordinate grid values.
Solution to remove:
- Implement a more user-friendly coordinates interface on
NDCube, e.g.NDCube.coords. - Deprecate these properties in favour of how to get this coordinate information through this API, e.g.
NDCube.coords.celestial.grid.
Status: Requires substantial ndcube development.
Alternative solution to remove:
- Deprecate these properties in favour of
self.axis_world_coords().
Status: Not started, but could be done now.
Spectrogram.exposure_time
Returns a quantity for the exposure time of each exposure.
Solution to remove:
- Move exposure_times into sliceable
NDMeta. - The
exposure_timeproperty can then simply returnself.meta.get("exposure_time"). - The
exposure_timeproperty can then be deprecated in favour ofself.meta.get("exposure_time"), so that workflows will work with plainNDCubeobjects withinstrument_axesin their meta instead ofSpectrogramCube.
Status: Not started, but could be done now.
Spectrogram.apply_exposure_time_correction
Solution to remove:
- Deprecate in favour of direct arithmetic operation, e.g.
cube_per_s = cube / exposure_time.
Status: Not started, but could be done now.
SpectrogramSequence/RasterSequence
Equivalent features as SpectrogramCube
SpectrogramSequence has its own SpectrogramSequence.spectral_axis, SpectrogramSequence.time, SpectrogramSequence.exposure_time, SpectrogramSequence.celestial, SpectrogramSequence.apply_exposure_time_correction properties/methods. These stack/concatenate the output of the SpectrogramCube property/method from each constituent cube.
Solution to remove:
- Implement a
gwcsof FITSWCS's and represent spectrogram sequences as a singleNDCube/SpectrogramCube.
Status: Requires above feature to be developed robustly within sunpy or astropy.
User-friendly aliases
RasterSequence provides more user-friendly aliases for:
NDCubeSequence.dimensions->RasterSequence.raster_dimensionsNDCubeSequence.cube_like_dimensions->RasterSequence.sns_dimensionsNDCubeSequence.array_axis_physical_types->RasterSequence.raster_array_axis_physical_typesNDCubeSequence.cube_like_array_axis_physical_types->RasterSequence.sns_array_axis_physical_typesNDCubeSequence.sequence_axis_coords->RasterSequence.raster_axis_coordsNDCubeSequence.common_axis_coords->RasterSequence.raster_axis_coordsNDCubeSequence.plot->RasterSequence.plot_as_rasterNDCubeSequence.plot_as_cube->RasterSequence.plot_as_sns
Solution to remove:
Deprecate for original NDCubeSequence methods.
Status: Not started, but could be done now.
raster_instrument_axes_types
Same as SpectrogramCube.instrument_axes except with "raster scan" added for the sequence axis.
Solution to remove:
Same solution as for instrument_axes.
Status: Not started, but could be done now.
sns_instrument_axes_types
Same as SpectrogramCube.instrument_axes except with "temporal" replacing the common axis.
Solution to remove: No obvious ready-made replacement.
MetaABCs
sunraster defines a hierarchy of three ABCs (MetaABC, RemoteSensorMetaABC, SlitSpectrographMetaABC) that define the property names via which certain types of metadata should be accessed.
Solution to remove:
Upstream these to sunpy core, as they were designed to be the beginning of a larger framework for solar (and beyond?) metadata properties.
Status: Not started. Requires agreement from the sunpy core community. This might trigger a wider metadata discussion that could delay the migration.
instr/spice.py
Contains a SPICE FITS reader function and SPICEMeta that depends on ndcube.NDMeta and the MetaABC hierarchy discussed above.
Solution to remove:
Migrate to the sospice package.
Status: Ongoing via sospice#56. But blocked until #273 is merged and a new sunraster version is released.
Summary of Roadmap to Deprecate Package
Essential
- #273 must be completed and merged, and a new release of
sunrastermust be issued. - sospice#54 must be completed.
- Migrate metadata
ABCs must be tosunpycore. - Various deprecations within
sunrasterto get users to usendcube-compatible APIs. - Move
raster_instrument_axes_typesinfo to anNDMetaattached toRasterSequence/NDCubeSequence, and deprecate for direct access via.meta.
Essential unless functionality dropped
- gwcs of FITS wcs's. (Required for
SpectrogramSequencecoords convenience functions). - Consider how/whether
RasterSequence.sns_instrument_axes_typescan be supported.
Preferred
- New
ndcubecoords API.
@Cadair @nabobalis Here is my inventory. Let me know your thoughts.