As currently implemented, it is not possible to initialize a Rainbow with a 2D wavelength array because the initial test of sorting the wavelength parameter acts on the flattened array. My workaround is to initialize the Rainbow using the wavelength axis of the first time element, then populate the .fluxlike["wavelength_2d"] entry, run align_wavelengths(), then work with the newly aligned Rainbow. The advantage to requiring this process is that it incentivizes checking the alignment.
I'm raising this issue to ask whether it is worth allowing a Rainbow to be initialized with a 2D wavelength array to begin with. If yes, then there is a question of whether to implement a 2D test for the wavelength parameter or allow a separate wavelength_2d parameter and run the sort test if wavelength_2D is None (or ... or ...).
As currently implemented, it is not possible to initialize a
Rainbowwith a 2D wavelength array because the initial test of sorting thewavelengthparameter acts on the flattened array. My workaround is to initialize theRainbowusing the wavelength axis of the first time element, then populate the.fluxlike["wavelength_2d"]entry, runalign_wavelengths(), then work with the newly alignedRainbow. The advantage to requiring this process is that it incentivizes checking the alignment.I'm raising this issue to ask whether it is worth allowing a Rainbow to be initialized with a 2D wavelength array to begin with. If yes, then there is a question of whether to implement a 2D test for the
wavelengthparameter or allow a separatewavelength_2dparameter and run the sort testif wavelength_2D is None(or ... or ...).