Open jbrinchmann opened 4 years ago
It could be that your cube has some wavelength slices with only NaNs, typically at the beginning or end of the cube ?
I have no slices where all are NaN. But this is an extended mode cube going to very blue wavelengths and I see that in _extract, where the badmap is created, all pixels are flagged as bad, thus for each spaxel there are some bad pixels - I had not realised that valid spectra for zap are those that have valid values along the entire wavelength range so I presume _nanclean is not dealing with this. This is a bit limiting for some special cases like the one I have now but I guess I will need to subset the cube, run zap and then add back in what was not zapped?
Yes currently the easiest would be to extract the wavelength range without the NaNs, but this should be improved in zap (there is another issue about this: #1).
In _nanclean
zap removes the spaxels that have more than 25% of NaNs, and then it tries to remove the other ones by interpolation. This is for the SVD computation, as the linear algebra routines do not like NaNs. But if there are too many NaNs, the interpolation will fail to replace all the NaNs I guess, which may be the reason for your error.
Hi, I'm trying to zap a fairly old datacube (from commissioning) which was successfully zapped back with the old version but I haven't touched it for years. now however it keeps failing and it is not clear what is going on (latest version of zap [2.1.dev191], latest CRAL version of MPDAF [3.3]). This happens with or without masking. Any idea what is going wrong?