Selecting Observations¶
When using SBART we can reject observations in two different ways:
- globally - they are effectivelly discarded for all SBART operations
- temporarily -Only disable them for the creation of the Stellar Templates
Even though the two rejection types have completely different effects, we always use the same format
Based on Header values¶
- Allows to define bounds for the "valid" values that a given header value can take.
- The bounds argument takes a list of list, with each entry defining a "region" that the value can take.
- If we want to place no upper/lower limits, we can place a None
# Only use observations that can have AIRMASS smaller than 1.5 or larger than 1.6
valid_AIRM_condition = KEYWORD_condition(KW = "airmass",
bounds=[[None, 1.5], [1.6, None]]
)
# Only select observations that have a previous RV error (the one from the CCF) smaller than 50 meter_second
# Note1: the conditions for 'RV related' values (previousRV, drift, BERV) must be in meter_second OR kilometer_second
# Note2: the units will be converted later on, so either "unit" can be chosen
valid_error_condition = KEYWORD_condition(KW="previousRV_ERR",
bounds = [0, 50*meter_second])
Rejection based on filenames¶
Provide a list of bad filenames that will be rejected.
Note: Filename only, do NOT pass a path
bad_filename_condition = FNAME_condition(filename_list=["filename.fits"])
Rejecting based on the "subInstrument"¶
Reject all observations from ESPRESSO21
bad_subInst_condition = SubInstrument_condition("ESPRESSO21")
Rejecting based on Warning Flags¶
Reject observation if a given warning flag was set when loading the spectra
bad_subInst_condition = WarningFlag_Notset("HIERARCH ESO QC SCIRED DRIFT CHECK")
Combining conditions¶
To combine multiple conditions, sum them together. The observations will be rejected if any Condition decides to reject it
full_conditions = valid_AIRM_condition + valid_error_condition + bad_filename_condition + bad_subInst_condition
Applying the conditions¶
For a DataClass object, we can use its reject_observations method
data.reject_observations(full_conditions)
Otherwise, other data-aggregation methods usually allow to provide a condition model to help specify the observations of interest.