RV_cube#
- class RV_cube#
Bases:
BASE
The RV cube stores the result of a SBART run of a given sub-Instrument. It is also responsible for:
Provide a way of accessing SBART and /or CCF results
Apply RV corrections (drift, SA)
Store outputs to disk
Create plots and (crude) statistical analysis of the RV timeseries.
- __init__(subInst, frameIDs, instrument_properties, has_orderwise_rvs)#
- It contains:
the SA correction value (and applies it)
THe (single) drift correction (And applies it)
The orderwise RVs, errors and Status
The final RV and errors (both raw and corrected)
- load_data_from(other)#
Load the information that is stored in a different RV_cube
- Parameters:
other (RV_cube) – [description]
- Return type:
None
- add_extra_storage_unit(new_unit, generate_root=True)#
- set_merged_mode(orders_to_skip)#
- Return type:
None
- update_skip_reason(orders, skip_reason)#
- Return type:
None
- load_data_from_DataClass(DataClassProxy)#
- Return type:
None
- update_worker_information(worker_info)#
- update_computed_precision(expected_precision, eniric_precision, eniric_template)#
Temporary measure to store the expected precision values. To be replaced by the Frame interface!
- Parameters:
expected_precision ([type]) – [description]
eniric_precision ([type]) – [description]
- update_computed_RVS(epoch_rv, epoch_error)#
- Return type:
None
- store_final_RV(frameID, epoch_rv, epoch_error)#
- Return type:
None
- store_order_data(frameID, order, RV, error, status)#
- Return type:
None
- get_RV_timeseries(which, apply_SA_corr, as_value, units=None, apply_drift_corr=None)#
Return the RV timeseries
- Parameters:
which (str) – Name of the RV series: TM/previous
apply_SA_corr (bool) – Apply the SA correction
as_value (bool) – Convert from astropy units to “unitless” variable
units (astropy.units, optional) – If not None, convert to this unit. By default None
apply_drift_corr ([type], optional) – Force the application of the drift correction to be this var (TRUE/FALSE). This ignores the default settings for the instrument! By default None
- Return type:
Tuple
[list
,list
,list
]- Returns:
list (BJD of the observation)
list (list of all RVs)
list (list of the RV uncertainties)
- Raises:
InvalidConfiguration – [description]
InvalidConfiguration – [description]
- get_RV_from_ID(frameID, which, apply_SA_corr, as_value, units, apply_drift_corr=None)#
Retrieve the BJD, RV and RV_ERR from a given frameID
- Parameters:
frameID (int) – frameID
which (str) – TM/previous
apply_SA_corr (bool) – apply the SA correction
as_value (bool) – convert from astropy.units to value
units ([type]) – units to convert the original measurements
apply_drift_corr ([type], optional) – For the drift correction to be enable/disabled. If None, use the default for the instrument. By default None
- Returns:
[description]
- Return type:
[type]
- compute_SA_correction()#
- get_storage_unit(storage_name)#
- get_raw_TM_RVs()#
- Return type:
Tuple
[list
,list
]
- get_raw_DRS_RVs()#
- Return type:
Tuple
[list
,list
]
- get_TM_activity_indicator(act_name)#
Get the DLW measurements if they exist.Otherwise return array of nans :param act_name:
- Returns:
list – Values
list – Uncertainties
- get_frame_orderwise_status(frameID)#
- Return type:
List
[Status
]
- property subInst: str#
- Return type:
str
- has_data_from_subInst(subInst)#
- Return type:
bool
- property obs_times: List[float]#
Provides a “time” of observation. Can either be BJD of MJD (depends on which exists. If both exist, returns the BJD
- Return type:
List
[float
]
- property N_orders: int#
- Return type:
int
- property name: str#
- Return type:
str
- property data#
- property problematic_orders: set#
Get the orders that should be discarded when computing RVs :returns: [description] :rtype: [type]
- build_datablock()#
- Return type:
dict
- compute_statistics(savefile=True)#
Compute the scatter and median uncertainty of the different timeseries
- Parameters:
main_path (str) – Path to the “base” folder of the outputs
savefile (bool, optional) – Store to disk if True. By default True
- export_skip_reasons(dataClassProxy)#
- Return type:
None
- export_results(keys, header, dataClassProxy, text=True, rdb=True, append=False)#
- plot_RVs(dataClassProxy)#
Plot & store the RV timeseries
- Parameters:
storage_path (str) – Main storage path
- Return type:
None
- export_txt(header, keys, append=False)#
Export the data to a text file
- Parameters:
path (str) – Path in which the file will be created
append (bool, optional) – instead of creating a new file, append to a previously existing one, by default False
add_to_filename (str, optional) – If it is not None, then add to the beginning of the filename, by default None
remove_header (bool, optional) – Avoid creating a header [with the description of each collumn] in the stored file, by default False
detailed_table (bool, optional) – write a detailed table with all of the information of the different corrections, by default True
- export_rdb(append=False)#
- trigger_data_storage(*args, **kwargs)#
- Return type:
NoReturn
- classmethod load_cube_from_disk(subInst_path, load_full_flag=False, load_work_pkgs=False, SBART_version=None)#
- add_relative_path(path_name, relative_structure)#
- add_to_status(new_flag)#
- Return type:
NoReturn
- classmethod config_help()#
Prints a message to terminal, showing all possible configurations and their constraints
- classmethod control_parameters()#
- generate_root_path(storage_path, no_logs=True)#
- Return type:
NoReturn
- is_object_type(type_to_check)#
Check if this object is of a given type
- Parameters:
type_to_check (
str
) –- Return type:
bool
- property is_valid: bool#
- Return type:
bool
- json_ready()#
Concerts the current class into a json entry that can be easily saved/loaded to/from disk
- Return type:
Dict
[str
,Any
]
- load_from_file(root_path, loading_path)#
- Return type:
None
- property storage_name: str#
- Return type:
str