Closed drewoldag closed 1 week ago
If they need to match exactly, then we can do the following:
Move the features_names
that are defined in the three LightCurve
subclasses up to be class member variables (so that you can access them as Bazin.features_names
.
And then use the FEATURE_EXTRACTOR_REGISTRY to get the proper extractor.
For instance:
from resspect.feature_extractors.light_curve import FEATURE_EXTRACTOR_REGISTRY
def fit(..., feature_extractor: str = "Bazin", ...):
...
feature_extractor = FEATURE_EXTRACTOR_REGISTRY[feature_extractor]
features = feature_extractor.features_names
...
Similarly there are a few other places in fit_lightcurve.py
where I see code blocks like the following:
if feature_extractor == 'bazin':
header = TOM_FEATURES_HEADER
elif feature_extractor == 'malanchev':
header = TOM_MALANCHEV_FEATURES_HEADER
It would be nice to consolidate this logic.
Additionally, in lightcurves_utils.py
there are many *_HEADER
lists defined. It seems like all of these are just the standard features_names from the LightCurve subclass for each of the different bands, plus the following boilerplate column names: id', 'redshift', 'type', 'code', 'orig_sample'
.
If that's the case, then we can programmatically define these columns as was done in https://github.com/LSSTDESC/RESSPECT/pull/56
For now, we'll update the features_names in .../feature_extractors/bazin.py
to be upper case. The rest of the comments in here will be put on hold, and reconsidered while incorporating the LAISS work.
I noticed that the feature names defined in fit_lightcurves.py:401 (here) don't match the feature names in bazin.py (here)
I just want to check how precisely these names need to match.
Specifically the difference is: ['a', 'b', 't0', 'tfall', 'trise'] vs. ['A', 'B', 't0', 'tfall', 'trise']