PAHFIT / pahfit

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

How to signal to user that features were not fit? #255

Open drvdputt opened 1 year ago

drvdputt commented 1 year ago

Currently, the rows corresponding to unused features are masked out, so that they are displayed as a row of "--" when model.features is shown in a notebook. (reminder: unused means that the feature was not fit, because is it outside of the appropriate wavelength range, as determined by the data range and the redshift). Note that this is different from a user not wanting a certain feature. In that case they should just delete it from the Features table, or comment out a line in the YAML file.

Masking was chosen as opposed to setting the parameters to nan, because the features need be able to be "reactivated", e.g. when another fit with a different redshift is passed. The mask doesn't do anything to the stored values. It is purely cosmetic.

Obvious alternative: add an "enabled" column to the Features table.

Solution by changing the design: see new issue

jdtsmith commented 1 year ago

One additional idea: sub-class astropy.table.Row and use the row.meta field to set row.meta['excluded_by_fit']=True (maybe with a helper method). Then further tweak table repr BoundedParTableFormatter to indicate this somehow.

jdtsmith commented 2 months ago

Do we still mask out features that don't pass Model's culling cut? If the user wants to mask some out (e.g. all lines) and then "open them back up", is our current setup expressive enough for that?