Closed taldcroft closed 1 year ago
Great idea to take steps now to make this more agile. Though could we just chuck DEFAULT_MODEL altogether?
DEFAULT_MODEL
is very useful in testing because you can change it and then re-run proseco star selection. In other words, anywhere that star probs are used then you can globally override the model without any API changes.
With a more modern mindset we could change that module global into an astropy configuration parameter. That's an option which would probably break something but not anything that can't be easily fixed.
I was thinking that if you wanted to change the model in testing you'd just control what was in chandra_models
or the chandra_models environment variable without API changes.
That's quite cumbersome and difficult for the simple case of comparing e.g. the current flight model to a new one. For example:
ef reselect_catalog(aca):
kwargs = aca.call_args.copy()
kwargs["include_ids_acq"] = list(aca.acqs['id'])
kwargs["include_halfws_acq"] = list(aca.acqs['halfw'])
kwargs["dark_date"] = aca.dark_date
kwargs["n_acq"] = len(aca.acqs)
star_probs.DEFAULT_MODEL = 'grid-floor-2020-02'
aca_orig = get_aca_catalog(**kwargs)
p2_orig = -aca_orig.acqs.get_log_p_2_or_fewer()
star_probs.DEFAULT_MODEL = 'grid-local-quadratic-2023-05'
aca_new = get_aca_catalog(**kwargs)
p2_new = -aca_new.acqs.get_log_p_2_or_fewer()
return p2_orig, p2_new
Gotcha. I figured that there was already something handy for doing that same thing when comparing different thermal models, but I haven't don't those comparisons myself.
The grid probability models are named
grid-<name>-<date>
. Currently the default model is hardcoded with the full name:In order to update the model without a new release of
chandra_aca
and a new FOT MATLAB tools release, enable wildcards and select the most recent date of matching models. Then use: