I’m back from holiday! I needed that!
Anyway, the last major update for cubes is that they now support numpy-style slicing and automatic conversion to other Sunpy types. For example, if you have a lambda-x-y cube (wavelength has priority over spatial coordinates, and time over wavelength), and you do cube[20, :, 10:40], that is an x-y slice, which is automatically converted into a map.if you have a time-lambda-y cube, and you do cube[:, 45, 10], you have a list of intensities at different times for a specified wavelength and point; that becomes a lightcurve!
The old style of converting to other objects – cube.slice_to_map, etc. – is still in place, so you can still send extra arguments to that object’s constructor.
Here’s a breakdown of the available conversions:
-Map when the result is an x-y slice
-Single-curve lightcurve when the only dimension is time and there is a wavelength present
-Multiple-curve lightcurve when one specifies a wavelength and a range of times and y-coordinates
-Spectrogram when the user chooses a time-lambda slice
-Spectrum when there’s a single lambda axis or a lambda and a spatial one. In the latter case, the slice is collapsed to the 1-D spectrum.
Any other conversion returns the raw data, unless the slicing didn’t reduce the number of dimensions, then a reduced cube is returned.