Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
Added a new system to handle optional target list filters that maintains backwards compatibility.
TargetList optional filter system
There's a new "optional_filters" keyword that can be provided that dictates which filters to apply. It is intended to be used with these filter methods:
binary_filter
outside_IWA_filter
life_expectancy_filter
main_sequence_filter
fgk_filter
vis_mag_filter
(takes Vmagcrit as input)max_dmag_filter
completeness_filter
(gets run after the completeness values are calculated)vmag_filter
(takes vmag_range as input)ang_diam_filter
where the filters can be provided in the input JSON with the format
where the "params" key holds any arguments that are passed to the filter function (there are no defaults currently set for those parameters but could be done with keyword arguments). Everything except
completeness_filter
is run prior to calculating intCutoff_and_saturation_dMag values which can reduce the computation time there.Backwards compatibility
The logic around existing filters that run in the TL init like
nan_filter
,zero_lum_filter
,cherry_pick_stars
, etc. are all unchanged. The keywordfilterBinaries
still works, but raises a warning (not error) and gets overridden in the case that the user provides a conflicting value in theoptional_filters
dictionary.Defaults
The filters that are on by default are the same as before the pull:
binary_filter
,outside_IWA_filter
, andcompleteness_filter
. If we want to enable any others by default it's an easy change.New filters
vmag_filter
: Filters out any stars that have Vmag values outside the provided rangeang_diam_filter
: Filters out any stars that have angular radius larger than minimum IWA.SIMBADCatalog bugfix
I am getting an error in SIMBAD catalog where all empty values from scipy's
loadmat
function are empty arrays and therefore can't be compared withbc[i]=='cut'
since array comparisons have ambiguous truthiness. The change itself is just making the comparisontype(bc[i])==str and bc[i]=='cut'
which shouldn't affect any functionality. It's not clear to me why this behavior is different now, but I tested python 3.10, 3.11, and 3.12 with various scipy versions and all had the same error (which makes me think I have been using the same SIMBAD300.pkl file for a long time and clearing my .EXOSIMS cache revealed a functionality change from a while ago).Type of change
Reference any relevant issues (don't forget the #)
#404
Checklist before requesting a review
e2eTests
and added new test scripts, as needed