Skip to content

NDCube Roadmap

DanRyanIrish edited this page Mar 2, 2023 · 13 revisions

Data Manipulation

  • Resample method: Create a method that resamples an NDCube to a new pixel or world grid.

Metadata

  • Sliceable Metadata: Develop a metadata class that can live at NDCube.meta. This class allows metadata to be associated with data axes so long as they have the same shape as these axes. Then when the NDCube is sliced, those metadata can be automatically sliced accordingly.

Masks & Uncertainty

  • Add Support of Functional Masks and Uncertainty: Instead of storing all uncertainty of mask information as dense arrays, enable a function to be defined that takes data as an input and generates the mask/uncertainty on the fly. This would save memory and may make some data manipulation methods faster as the mask and uncertainty would not have to be recalculated.
  • MaskCollection class: A data set may want to flag pixels based on different criteria, e.g. exposed area of detector, signal-to-noise, cosmic ray hits, feature type, e.g. active region, flare etc. A MaskCollection class would store all these masks and all the user to mask the data with the one (or combination of masks) required at the time.

Concerning Coordinates

  • NDCube.coords: Create a wrapper that defines a common API for interacting with coordinates, irrespective of whether they are stored in the WCS, ExtraCoords or GlobalCoords.
  • Provide an API to get the bounding box of a cube
  • Add SpectralCoord support to ExtraCoords
  • Identification and Extraction of sub-cubes based on physical types of axes
  • Provide a decorator that validates world axes of a given NDCube
  • Upstream WCS wrappers to astropy:

I/O / Type Conversion

  • NDCube.save/write: Add a method to write out an NDCube to one of a set of supported file types.
  • Enable creation of an NDCube from an xarray instance and/or vice versa.

Support for Interoperability between Subclasses

  • Provide decorator to call other subclasses methods: Compliant subclasses would write a hook whose API is defined by ndcube. Then the decorator would convert one subclass to another, call the method, then reconvert back to the original subclass.

Archived: Written March 2022

This page attempts to summarize the roadmap for the NDCube class post 2.0. It is based on issues and PRs open at time of writing (March 2022) but can be developed through subsequent discussions and new issues.

For context, there is currently a discussion about whether all or part of NDCube should be upstreamed to astropy NDData. This document might help to clarify what desired future features could also end up in astropy NDData.

Data Manipulation

  • Arithmetic Operations: Enable scalars, arrays and quantities to be added/subtracted and multiplied/divided with an NDCube. Also allow NDCubes to be combined via arithmetic operations if they have compatible coordinates. (Done in v2.1.0)
  • Unit Conversion: Add a NDCube.to() method that converts the NDCube to a new unit. (Done in v2.1.0)
  • Resample method: Create a method that resamples an NDCube to a new pixel grid.
  • Superpixel method: Subtlely different to ǸDCube.resample. This method would degrade resolution by creating macropixels of a certain integer number of pixels in each dimension. The values would then be combined by sum function selected by the user, e.g. sum, mean, median, min, max, etc. This is simpler to use and to implement than ǸDCube.resample, and crucially in the case of summing, flux can be conserved in very simple way. A use of this would be to increase the signal-to-noise ratio. In this case, the user will not want to reproject to a new pixel grid and risk not conserving flux. (Done in v2.1.0. Renamed NDCube.bin)

Metadata

  • Sliceable Metadata: Develop a metadata class that can live at NDCube.meta. This class allows metadata to be associated with data axes so long as they have the same shape as these axes. Then when the NDCube is sliced, those metadata can be automatically sliced accordingly.

Masks & Uncertainty

  • Add Support of Functional Masks and Uncertainty: Instead of storing all uncertainty of mask information as dense arrays, enable a function to be defined that takes data as an input and generates the mask/uncertainty on the fly. This would save memory and may make some data manipulation methods faster as the mask and uncertainty would not have to be recalculated.
  • MaskCollection class: A data set may want to flag pixels based on different criteria, e.g. exposed area of detector, signal-to-noise, cosmic ray hits, feature type, e.g. active region, flare etc. A MaskCollection class would store all these masks and all the user to mask the data with the one (or combination of masks) required at the time.

Concerning Coordinates

  • NDCube.coords: Create a wrapper that defines a common API for interacting with coordinates, irrespective of whether they are stored in the WCS, ExtraCoords or GlobalCoords.
  • Provide an API to get the bounding box of a cube
  • Add SpectralCoord support to ExtraCoords
  • Identification and Extraction of sub-cubes based on physical types of axes
  • Provide a decorator that validates world axes of a given NDCube
  • Upstream WCS wrappers to astropy:

I/O / Type Conversion

  • NDCube.save/write: Add a method to write out an NDCube to one of a set of supported file types.
  • Enable creation of an NDCube from an xarray instance and/or vice versa.

Support for Other Array Types

e.g. dask (Done in v2.1.0) ...

Support for Interoperability between Subclasses

  • Provide decorator to call other subclasses methods: Compliant subclasses would write a hook whose API is defined by ndcube. Then the decorator would convert one subclass to another, call the method, then reconvert back to the original subclass.