Skip to content

Rebuild of Array and sub-classes

This PR introduces a complete re-build of the Array class and all sub-classes, including TimeSeries, Spectrum, and Spectrogram. The changes are (at least) as follows:

  • Array now inherits from astropy.units.Quantity rather than from numpy.ndarray,
    • all unit handing is now much easier, with most of it handled directly by Quantity,
    • the unit property cannot be set for an array that already has a unit, a notice has been added to the exception message to ask the user to use the Array.to() method, which properly converts between units,
    • the data property has been removed in favour of the Quantity.value property. data was a bad choice to begin with as it overrode a numpy.ndarray property,
  • Array2D now inherits from Series,
  • the times and frequencies indexes of the TimeSeries, Spectrum, and Spectrogram classes are now simply Quantity arrays, rather than Series, this means that they don't have the extra metadata they used to (epoch, channel, name),

All downstream codes have been modified to handle the new base classes.

This fixes #66 (closed).

Merge request reports