-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle nan's more elegantly #11
Comments
What I can do is raise an error if you pass an image containing only nan's. I don't think it is sensible to expect spimple to run through in this case, that should probably be handled by the pipeline (you probably want to abandon subsequent steps because they will just be a waste of time). Easy enough to add a check but please first try this with the current release. The error will be different, I don't see the above lines in the current code base |
Sorry @landmanbester , I was still using spimple through stimela. When I run the latest version this is the output:
So all good, I just need an updated version of spimple on stimela. Can you please help me with this or shall we ask @Mulan-94 ? |
No problem @francescaLoi, I thought that may be the case. I have no experience with the old stimela framework so you would have to check with @Mulan-94. This would be much simpler if you could be persuaded to switch to stimela2. Maybe another busy week is in order |
@Athanaseus has convinced me of the need to do this more intelligently. I hadn't quite appreciated that a typical mosaiced image inevitably contains nan's. The dropzweights branch will already look for and prune bands that are completely nan (should I also do this for bands that are all zeros?). I can also add a feature to deselect bands manually. Partial nan components (i.e. if some of the bands for a component are nan but the band still contains valid data elsewhere) will require a bit more thinking about but shouldn't be a showstopper |
Does masking work in this case btw? |
There is currently no option to pass in a mask but this should be trivial to add if there is a need for it. The mask for the fit is currently created by deselecting all components which either i) have a minimum flux along the frequency axis less than threshold * rms (or model/max()/maxDR if no residual is passed in) or ii) contain a nan in any frequency band. Is there a need for an external mask as well? |
* Ignoring invalid division by zero or nan An ostrich approach to #11 * Dropzweights (#14) * remove full nan slices * don't acr by default * look for max of model only at unflagged locations * drop invalid gausspars * accommodate different keys for different header * idx -> fidx * fresq -> freqs * Exclude any bands that might be awful with `-ds` * pep8 indetation level * syntax error fix * Update spi_fitter.py * Update spi_fitter.py --------- Co-authored-by: landmanbester <[email protected]> * Fix freq dimension check Fix empty gauspar checking --------- Co-authored-by: Athanaseus Javas Ramaila <[email protected]> Co-authored-by: landmanbester <[email protected]>
I got this error:
I think is because the input is a nan image... I'll include a check on CARACal for now but it would be better to fix it here
The text was updated successfully, but these errors were encountered: