PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

features.util.bounded_is_fixed() does not work for dust_feature-only science packs #274

Closed drvdputt closed 4 months ago

drvdputt commented 8 months ago

When a science pack is created that only has dust_feature entries, there will be no masked values in the power column of the Features table. As a consequence, the astropy table constructor automatically decides whether to use a Column instead of a MaskedColumn. This means that any functionality that relies on the presence of a mask attribute, wil fail.

E.g. in featuresutil.bounded_is_fixed(): return ma.getmask(val)[..., -2:].all(-1), where getmask will return False.

Most consistent solution: Force the use of MaskedColumn (or in our case BoundedMaskedColumn) when the Features table.

Even if we found another way around this bug, I think we should enforce this to ensure consistency. (e.g. What if the user want to set power boundaries, but the power column does not support masks because of the way the table was loaded?)

jdtsmith commented 5 months ago

I agree we can just enforce all columns are BoundedMaskedColumns even if most of the elements are "fixed".

jdtsmith commented 4 months ago

OK, update, never mind that. #283 includes a fix for this. It should create bounds for all parameter columns except for string-parameters (name, group, model, geometry). The latter should never be passed to the bounds checker functions.

jdtsmith commented 4 months ago

Double check if this is fixed, please.

drvdputt commented 4 months ago

Yes, seems to work now, since BoundedMaskedColumn doesn't exist anymore, this bug can also no longer appear. Everything is just a regular Column, even in this dust_feature-only edge case.

jdtsmith commented 4 months ago

I didn't check all the utils convenience functions but we can revisit if needed.