Spectrum's iterator with null values
Dear MPDAF community,
I´m having problems when using the various "iterators" describe in the Interface for spectra, images and cubes section.
Making use of a datacube (edge-on galaxy IC 1533, already reduced by S. Comeron), whose white-image is shown below

, the loops using the spectrum's iterator (for instance) fails because some of the spaxels have no flux, as shown in figure above (I think). This is code from the Cube_object section (apologies but can´t insert in code format),

And this is the error I get,

Any quick workaround to get around this issue? I face this issue in other parts of the tutorial where iterators are used too.
Needless to say, many thanks in advance.
Kind Regards, Jose
You could skip the spectra that are entirely masked (e.g. with sp.mask.all()).
Thanks Simon. I'd appreciate if could show mw how to modify this piece of code taking into account your suggestion.
cont1 = obj1.clone(data_init=np.empty, var_init=np.zeros)
for sp, co in zip(iter_spe(obj1), iter_spe(cont1)):
co[:] = sp.poly_spec(5)