You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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_axes information into sliceable NDMeta.
The instrument_axes property can then simply return self.meta.get("instrument_axes").
The instrument_axes property can then be deprecated in favour of self.meta.get("instrument_axes"), so that workflows will work with plain NDCube objects with instrument_axes in their meta instead of SpectrogramCube.
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_time property can then simply return self.meta.get("exposure_time").
The exposure_time property can then be deprecated in favour of self.meta.get("exposure_time"), so that workflows will work with plain NDCube objects with instrument_axes in their meta instead of SpectrogramCube.
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 gwcs of FITSWCS's and represent spectrogram sequences as a single NDCube/SpectrogramCube.
Status: Requires above feature to be developed robustly within sunpy or astropy.
User-friendly aliases
RasterSequence provides more user-friendly aliases for:
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.
Reacted by Stuart Mumford, ebuchlin and Nabil Freij
Activity
Cadair commentedon Jun 11, 2025
@nabobalis @DanRyanIrish Thoughts?
DanRyanIrish commentedon Jun 11, 2025
@Cadair I agree with you. I think the aim should be to discontinue this package.
sunrasterdoes provide a few useful functionalities that IRIS and SPICE users rely on. However, I think these could be transferred toirispy-lmsal,sospiceandsunpycore. Therefore, we need a roadmap to do these tasks beforesunrastercan be discontinued.sunraster's unique functionalities
SpectrogramCubeinstrument_axesTracks what axes correspond to slit position, pixel along slit, raster number, etc.
Solution to remove:
instrument_axesinformation into sliceableNDMeta.instrument_axesproperty can then simply returnself.meta.get("instrument_axes").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_coordsConvenience PropertiesSpectrogramCube.spectral_axis,SpectrogramCube.timeandSpectrogramCube.celestialenable users to retrieve high level coordinate objects of the coordinate grid values.Solution to remove:
NDCube, e.g.NDCube.coords.NDCube.coords.celestial.grid.Status: Requires substantial
ndcubedevelopment.Alternative solution to remove:
self.axis_world_coords().Status: Not started, but could be done now.
Spectrogram.exposure_timeReturns a quantity for the exposure time of each exposure.
Solution to remove:
NDMeta.exposure_timeproperty can then simply returnself.meta.get("exposure_time").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_correctionSolution to remove:
cube_per_s = cube / exposure_time.Status: Not started, but could be done now.
SpectrogramSequence/RasterSequenceEquivalent features as
SpectrogramCubeSpectrogramSequencehas its ownSpectrogramSequence.spectral_axis,SpectrogramSequence.time,SpectrogramSequence.exposure_time,SpectrogramSequence.celestial,SpectrogramSequence.apply_exposure_time_correctionproperties/methods. These stack/concatenate the output of theSpectrogramCubeproperty/method from each constituent cube.Solution to remove:
gwcsof FITSWCS's and represent spectrogram sequences as a singleNDCube/SpectrogramCube.Status: Requires above feature to be developed robustly within
sunpyorastropy.User-friendly aliases
RasterSequenceprovides 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_snsSolution to remove:
Deprecate for original
NDCubeSequencemethods.Status: Not started, but could be done now.
raster_instrument_axes_typesSame as
SpectrogramCube.instrument_axesexcept 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_typesSame as
SpectrogramCube.instrument_axesexcept with"temporal"replacing the common axis.Solution to remove:
No obvious ready-made replacement.
MetaABCs
sunrasterdefines a hierarchy of threeABCs (MetaABC,RemoteSensorMetaABC,SlitSpectrographMetaABC) that define the property names via which certain types of metadata should be accessed.Solution to remove:
Upstream these to
sunpycore, 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
sunpycore community. This might trigger a wider metadata discussion that could delay the migration.instr/spice.py
Contains a SPICE FITS reader function and
SPICEMetathat depends onndcube.NDMetaand theMetaABChierarchy discussed above.Solution to remove:
Migrate to the
sospicepackage.Status: Ongoing via sospice#56. But blocked until #273 is merged and a new
sunrasterversion is released.DanRyanIrish commentedon Jun 11, 2025
Summary of Roadmap to Deprecate Package
Essential
sunrastermust be issued.ABCs must be tosunpycore.sunrasterto get users to usendcube-compatible APIs.raster_instrument_axes_typesinfo to anNDMetaattached toRasterSequence/NDCubeSequence, and deprecate for direct access via.meta.Essential unless functionality dropped
SpectrogramSequencecoords convenience functions).RasterSequence.sns_instrument_axes_typescan be supported.Preferred
ndcubecoords API.DanRyanIrish commentedon Jun 11, 2025
@Cadair @nabobalis Here is my inventory. Let me know your thoughts.