Construction of stellar templates¶
The construction of Stellar templates is handled through the StellarModel interface, which will create independent stellar templates for each sub-Instrument that we have available in the DataClass. The construction of the stellar templates follows the framework described in Silva et al, 2022, and is shematized in here:
In [ ]:
Copied!
from pathlib import Path
from ASTRA.data_objects import DataClassManager
from ASTRA.data_objects.DataClass import DataClass
from ASTRA.Instruments import ESPRESSO
from ASTRA.template_creation.StellarModel import StellarModel
storage_path = Path("../../tmp")
manager = DataClassManager()
manager.start()
d: DataClass = manager.DataClass(
list(Path("/home/amiguel/spectra_collection/ESPRESSO/proxima").glob("*.fits")),
storage_path=storage_path,
instrument=ESPRESSO,
)
stell = StellarModel(
storage_path,
user_configs={},
)
stell.Generate_Model(
dataClass=d,
template_configs={},
force_computation=True,
)
from pathlib import Path
from ASTRA.data_objects import DataClassManager
from ASTRA.data_objects.DataClass import DataClass
from ASTRA.Instruments import ESPRESSO
from ASTRA.template_creation.StellarModel import StellarModel
storage_path = Path("../../tmp")
manager = DataClassManager()
manager.start()
d: DataClass = manager.DataClass(
list(Path("/home/amiguel/spectra_collection/ESPRESSO/proxima").glob("*.fits")),
storage_path=storage_path,
instrument=ESPRESSO,
)
stell = StellarModel(
storage_path,
user_configs={},
)
stell.Generate_Model(
dataClass=d,
template_configs={},
force_computation=True,
)
2025-04-15 14:56:41.420 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:216 - Generating internal configs of - 2025-04-15 14:56:41.424 | INFO | ASTRA.utils.UserConfigs:receive_user_inputs:221 - Checking for any parameter that will take default value 2025-04-15 14:56:41.426 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <SAVE_DISK_SPACE> using the default value: DISK_SAVE_MODE.DISABLED 2025-04-15 14:56:41.428 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <WORKING_MODE> using the default value: WORKING_MODE.ONE_SHOT 2025-04-15 14:56:41.432 | INFO | ASTRA.data_objects.DataClass:__init__:126 - DataClass opening 3 files from a list/tuple 2025-04-15 14:56:41.434 | INFO | ASTRA.base_models.Frame:__init__:252 - Creating frame from: /home/amiguel/spectra_collection/ESPRESSO/proxima/r.ESPRE.2019-07-03T01:43:39.634_S2D_A.fits 2025-04-15 14:56:41.436 | WARNING | ASTRA.Components.SpectrumComponent:regenerate_order_status:96 - Resetting order status of Frame - ESPRESSO 2025-04-15 14:56:41.458 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:710 - Rejecting spectral orders 2025-04-15 14:56:41.462 | INFO | ASTRA.base_models.Frame:assess_bad_orders:740 - Frame -3539887270512102415 rejected 37 orders for having SNR smaller than 5: 0-36 2025-04-15 14:56:41.582 | INFO | ASTRA.base_models.Frame:__init__:252 - Creating frame from: /home/amiguel/spectra_collection/ESPRESSO/proxima/r.ESPRE.2019-07-14T02:07:49.063_S2D_A.fits 2025-04-15 14:56:41.585 | WARNING | ASTRA.Components.SpectrumComponent:regenerate_order_status:96 - Resetting order status of Frame - ESPRESSO 2025-04-15 14:56:41.846 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:710 - Rejecting spectral orders 2025-04-15 14:56:41.850 | INFO | ASTRA.base_models.Frame:assess_bad_orders:740 - Frame -6655143944787757955 rejected 15 orders for having SNR smaller than 5: 0-12, 32-33 2025-04-15 14:56:41.852 | INFO | ASTRA.base_models.Frame:__init__:252 - Creating frame from: /home/amiguel/spectra_collection/ESPRESSO/proxima/r.ESPRE.2019-07-20T01:43:40.032_S2D_A.fits 2025-04-15 14:56:41.854 | WARNING | ASTRA.Components.SpectrumComponent:regenerate_order_status:96 - Resetting order status of Frame - ESPRESSO 2025-04-15 14:56:41.871 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:710 - Rejecting spectral orders 2025-04-15 14:56:41.874 | INFO | ASTRA.base_models.Frame:assess_bad_orders:740 - Frame 7020571171304516718 rejected 16 orders for having SNR smaller than 5: 0-13, 32-33 2025-04-15 14:56:41.876 | DEBUG | ASTRA.data_objects.DataClass:__init__:154 - Selected 3 observations from disk 2025-04-15 14:56:41.878 | INFO | ASTRA.data_objects.DataClass:_collect_MetaData:369 - Collecting MetaData from the observations 2025-04-15 14:56:41.880 | WARNING | ASTRA.data_objects.Target:__init__:73 - Target dictionary not found in <None> 2025-04-15 14:56:41.881 | DEBUG | ASTRA.data_objects.Target:clean_targ_list:98 - Parsing through loaded OBJECTs 2025-04-15 14:56:41.883 | INFO | ASTRA.data_objects.Target:__init__:92 - Validated target to be V V645 Cen 2025-04-15 14:56:41.885 | INFO | ASTRA.data_objects.DataClass:show_loadedData_table:885 - -------------------------------------------------------------------- -------------------------------------------------------------------- subInstrument Total OBS Valid OBS [warnings] INVALID OBS -------------------------------------------------------------------- ESPRESSO18 0 0 [0] 0 ESPRESSO19 3 3 [0] 0 Total 3 3 [0] 0 -------------------------------------------------------------------- 2025-04-15 14:56:41.887 | INFO | ASTRA.data_objects.DataClass:load_instrument_extra_information:894 - Checking if the instrument has extra data to load 2025-04-15 14:56:41.888 | INFO | ASTRA.data_objects.DataClass:load_instrument_extra_information:901 - Current instrument does not need to load anything from the outside 2025-04-15 14:56:41.897 | INFO | ASTRA.base_models.TemplateFramework:__init__:72 - Starting Stellar Model 2025-04-15 14:56:41.899 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:216 - Generating internal configs of SpectralModel - Stellar 2025-04-15 14:56:41.901 | INFO | ASTRA.utils.UserConfigs:receive_user_inputs:221 - Checking for any parameter that will take default value 2025-04-15 14:56:41.903 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <SAVE_DISK_SPACE> using the default value: DISK_SAVE_MODE.DISABLED 2025-04-15 14:56:41.904 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <WORKING_MODE> using the default value: WORKING_MODE.ONE_SHOT 2025-04-15 14:56:41.904 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <CREATION_MODE> using the default value: STELLAR_CREATION_MODE.Sum 2025-04-15 14:56:41.905 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <ALIGNEMENT_RV_SOURCE> using the default value: DRS 2025-04-15 14:56:41.906 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <PREVIOUS_SBART_PATH> using the default value: 2025-04-15 14:56:41.907 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <USE_MERGED_RVS> using the default value: False 2025-04-15 14:56:41.909 | INFO | ASTRA.template_creation.StellarModel:Generate_Model:165 - Using CCF RVs as the basis for the creation of the stellar models 2025-04-15 14:56:41.910 | DEBUG | ASTRA.base_models.TemplateFramework:Generate_Model:138 - Starting the creation of Stellar models! 2025-04-15 14:56:41.910 | INFO | ASTRA.base_models.TemplateFramework:Generate_Model:147 - Creating all templates from scratch 2025-04-15 14:56:41.911 | DEBUG | ASTRA.utils.UserConfigs:update_configs_with_values:198 - Configuration <WORKING_MODE> taking the value: WORKING_MODE.ONE_SHOT 2025-04-15 14:56:41.914 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:216 - Generating internal configs of Sum-Stellar from ESPRESSO18 2025-04-15 14:56:41.915 | DEBUG | ASTRA.utils.UserConfigs:update_configs_with_values:198 - Configuration <ALIGNEMENT_RV_SOURCE> taking the value: DRS 2025-04-15 14:56:41.916 | INFO | ASTRA.utils.UserConfigs:receive_user_inputs:221 - Checking for any parameter that will take default value 2025-04-15 14:56:41.917 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <SAVE_DISK_SPACE> using the default value: DISK_SAVE_MODE.DISABLED 2025-04-15 14:56:41.917 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <WORKING_MODE> using the default value: WORKING_MODE.ONE_SHOT 2025-04-15 14:56:41.918 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <CONSTANT_RV_GUESS> using the default value: False 2025-04-15 14:56:41.918 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <NUMBER_WORKERS> using the default value: 1 2025-04-15 14:56:41.919 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <MEMORY_SAVE_MODE> using the default value: False 2025-04-15 14:56:41.920 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <MINIMUM_NUMBER_OBS> using the default value: 3 2025-04-15 14:56:41.920 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_threshold_for_template> using the default value: 1 2025-04-15 14:56:41.921 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <INTERPOL_MODE> using the default value: SPECTRA_INTERPOL_MODE.SPLINES 2025-04-15 14:56:41.922 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <SPLINE_TYPE> using the default value: SPLINE_INTERPOL_MODE.CUBIC_SPLINE 2025-04-15 14:56:41.923 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <INTERPOLATION_ERR_PROP> using the default value: INTERPOLATION_ERR_PROP.interpolation 2025-04-15 14:56:41.923 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_CONFIGS> using the default value: FLUX_SMOOTH_CONFIGS.NONE 2025-04-15 14:56:41.924 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_WINDOW_SIZE> using the default value: 15 2025-04-15 14:56:41.925 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_DEG> using the default value: 2 2025-04-15 14:56:41.925 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_ORDER> using the default value: FLUX_SMOOTH_ORDER.AFTER 2025-04-15 14:56:41.926 | WARNING | ASTRA.Components.SpectrumComponent:regenerate_order_status:96 - Resetting order status of Sum-Stellar from ESPRESSO18 2025-04-15 14:56:41.927 | INFO | ASTRA.template_creation.stellar_templates.Stellar_Template:create_stellar_template:132 - Starting creation of Stellar template from ESPRESSO18 2025-04-15 14:56:41.929 | CRITICAL | ASTRA.template_creation.stellar_templates.Stellar_Template:create_stellar_template:144 - ESPRESSO18 has no valid observations. Not computing Stellar template 2025-04-15 14:56:41.930 | WARNING | ASTRA.base_models.Template_Model:_base_checks_for_template_creation:102 - Template will not be created. Check previous error messages 2025-04-15 14:56:41.931 | WARNING | ASTRA.template_creation.StellarModel:_compute_template:197 - Key <ALIGNEMENT_RV_SOURCE> from Stellar Model over-riding the one from the template configs 2025-04-15 14:56:41.931 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:216 - Generating internal configs of Sum-Stellar from ESPRESSO19 2025-04-15 14:56:41.933 | DEBUG | ASTRA.utils.UserConfigs:update_configs_with_values:198 - Configuration <ALIGNEMENT_RV_SOURCE> taking the value: DRS 2025-04-15 14:56:41.934 | INFO | ASTRA.utils.UserConfigs:receive_user_inputs:221 - Checking for any parameter that will take default value 2025-04-15 14:56:41.934 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <SAVE_DISK_SPACE> using the default value: DISK_SAVE_MODE.DISABLED 2025-04-15 14:56:41.935 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <WORKING_MODE> using the default value: WORKING_MODE.ONE_SHOT 2025-04-15 14:56:41.935 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <CONSTANT_RV_GUESS> using the default value: False 2025-04-15 14:56:41.935 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <NUMBER_WORKERS> using the default value: 1 2025-04-15 14:56:41.936 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <MEMORY_SAVE_MODE> using the default value: False 2025-04-15 14:56:41.936 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <MINIMUM_NUMBER_OBS> using the default value: 3 2025-04-15 14:56:41.936 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_threshold_for_template> using the default value: 1 2025-04-15 14:56:41.937 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <INTERPOL_MODE> using the default value: SPECTRA_INTERPOL_MODE.SPLINES 2025-04-15 14:56:41.938 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <SPLINE_TYPE> using the default value: SPLINE_INTERPOL_MODE.CUBIC_SPLINE 2025-04-15 14:56:41.938 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <INTERPOLATION_ERR_PROP> using the default value: INTERPOLATION_ERR_PROP.interpolation 2025-04-15 14:56:41.938 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_CONFIGS> using the default value: FLUX_SMOOTH_CONFIGS.NONE 2025-04-15 14:56:41.939 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_WINDOW_SIZE> using the default value: 15 2025-04-15 14:56:41.939 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_DEG> using the default value: 2 2025-04-15 14:56:41.940 | DEBUG | ASTRA.utils.UserConfigs:receive_user_inputs:228 - Configuration <FLUX_SMOOTH_ORDER> using the default value: FLUX_SMOOTH_ORDER.AFTER 2025-04-15 14:56:41.940 | WARNING | ASTRA.Components.SpectrumComponent:regenerate_order_status:96 - Resetting order status of Sum-Stellar from ESPRESSO19 2025-04-15 14:56:41.941 | INFO | ASTRA.template_creation.stellar_templates.Stellar_Template:create_stellar_template:132 - Starting creation of Stellar template from ESPRESSO19 2025-04-15 14:56:41.943 | INFO | ASTRA.template_creation.stellar_templates.Stellar_Template:create_stellar_template:162 - Evaluating spectral conditions to select the valid observations from ESPRESSO19 2025-04-15 14:56:41.959 | DEBUG | ASTRA.base_models.Frame:load_S2D_data:861 - Opening the S2D arrays from r.ESPRE.2019-07-20T01:43:40.032_S2D_A.fits 2025-04-15 14:56:41.990 | WARNING | ASTRA.Instruments.ESO_PIPELINE:load_ESO_DRS_S2D_data:327 - Not applying correction to blue-red flux balance! 2025-04-15 14:56:42.070 | DEBUG | ASTRA.base_models.Frame:build_mask:627 - Cleaning wavelength regions from [] 2025-04-15 14:56:42.073 | DEBUG | ASTRA.base_models.Frame:build_mask:645 - Removed 0 regions () 2025-04-15 14:56:42.076 | DEBUG | ASTRA.base_models.Frame:build_mask:671 - Ensuring that we have increasing wavelengths 2025-04-15 14:56:42.093 | DEBUG | ASTRA.base_models.Frame:build_mask:677 - Took 0 seconds () 2025-04-15 14:56:42.097 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:710 - Rejecting spectral orders 2025-04-15 14:56:42.123 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:723 - Frame 7020571171304516718 rejected 16 orders due for having less than 0.25 valid pixels: 0-13, 32-33 2025-04-15 14:56:42.126 | INFO | ASTRA.base_models.Frame:assess_bad_orders:740 - Frame 7020571171304516718 rejected 16 orders for having SNR smaller than 5: 0-13, 32-33 2025-04-15 14:56:42.507 | INFO | ASTRA.template_creation.stellar_templates.sum_stellar:launch_parallel:140 - Using observation from Frame of ESPRESSO : ESPRESSO19 data (2019-07-20T01:43:40.031; ID = 7020571171304516718) as a basis for stellar template construction 2025-04-15 14:56:42.511 | INFO | ASTRA.template_creation.stellar_templates.sum_stellar:launch_parallel:145 - Using frameIDs: [-3539887270512102415, -6655143944787757955, 7020571171304516718] 2025-04-15 14:56:42.512 | INFO | ASTRA.template_creation.stellar_templates.sum_stellar:launch_parallel:157 - Launching 1 workers! 2025-04-15 14:56:42.512 | INFO | ASTRA.template_creation.stellar_templates.Stellar_Template:convert_to_shared_mem:553 - Putting the stellar template in shared memory 2025-04-15 14:56:42.573 | DEBUG | ASTRA.base_models.Frame:load_S2D_data:861 - Opening the S2D arrays from r.ESPRE.2019-07-03T01:43:39.634_S2D_A.fits 2025-04-15 14:56:42.609 | WARNING | ASTRA.Instruments.ESO_PIPELINE:load_ESO_DRS_S2D_data:327 - Not applying correction to blue-red flux balance! 2025-04-15 14:56:42.688 | DEBUG | ASTRA.base_models.Frame:build_mask:627 - Cleaning wavelength regions from [] 2025-04-15 14:56:42.690 | DEBUG | ASTRA.base_models.Frame:build_mask:645 - Removed 0 regions () 2025-04-15 14:56:42.692 | DEBUG | ASTRA.base_models.Frame:build_mask:671 - Ensuring that we have increasing wavelengths 2025-04-15 14:56:42.711 | DEBUG | ASTRA.base_models.Frame:build_mask:677 - Took 0 seconds () 2025-04-15 14:56:42.714 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:710 - Rejecting spectral orders 2025-04-15 14:56:42.740 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:723 - Frame -3539887270512102415 rejected 37 orders due for having less than 0.25 valid pixels: 0-36 2025-04-15 14:56:42.744 | INFO | ASTRA.base_models.Frame:assess_bad_orders:740 - Frame -3539887270512102415 rejected 37 orders for having SNR smaller than 5: 0-36 2025-04-15 14:56:43.650 | DEBUG | ASTRA.base_models.Frame:load_S2D_data:861 - Opening the S2D arrays from r.ESPRE.2019-07-14T02:07:49.063_S2D_A.fits 2025-04-15 14:56:43.675 | WARNING | ASTRA.Instruments.ESO_PIPELINE:load_ESO_DRS_S2D_data:327 - Not applying correction to blue-red flux balance! 2025-04-15 14:56:43.754 | DEBUG | ASTRA.base_models.Frame:build_mask:627 - Cleaning wavelength regions from [] 2025-04-15 14:56:43.757 | DEBUG | ASTRA.base_models.Frame:build_mask:645 - Removed 0 regions () 2025-04-15 14:56:43.758 | DEBUG | ASTRA.base_models.Frame:build_mask:671 - Ensuring that we have increasing wavelengths 2025-04-15 14:56:43.774 | DEBUG | ASTRA.base_models.Frame:build_mask:677 - Took 0 seconds () 2025-04-15 14:56:43.777 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:710 - Rejecting spectral orders 2025-04-15 14:56:43.801 | DEBUG | ASTRA.base_models.Frame:assess_bad_orders:723 - Frame -6655143944787757955 rejected 15 orders due for having less than 0.25 valid pixels: 0-12, 32-33 2025-04-15 14:56:43.804 | INFO | ASTRA.base_models.Frame:assess_bad_orders:740 - Frame -6655143944787757955 rejected 15 orders for having SNR smaller than 5: 0-12, 32-33 2025-04-15 14:56:45.808 | INFO | ASTRA.template_creation.stellar_templates.sum_stellar:launch_parallel:217 - Updating template mask 2025-04-15 14:56:45.849 | DEBUG | ASTRA.template_creation.stellar_templates.sum_stellar:launch_parallel:226 - Ensuring increasing wavelenghs in the stellar template 2025-04-15 14:56:45.869 | INFO | ASTRA.template_creation.stellar_templates.sum_stellar:launch_parallel:239 - Construction of stellar template took 3.297156572341919 2025-04-15 14:56:45.871 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 0 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.872 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 1 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.873 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 2 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.874 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 3 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.875 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 4 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.876 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 5 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.877 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 6 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.878 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 7 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.879 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 8 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.880 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 9 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.881 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 10 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.882 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 11 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.882 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 12 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.883 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 13 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.884 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 14 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.886 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 15 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.887 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 16 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.888 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 17 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.889 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 18 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.889 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 19 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.891 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 20 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.892 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 21 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.894 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 22 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.895 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 23 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.895 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 24 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.896 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 25 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.896 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 26 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.897 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 27 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.897 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 28 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.898 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 29 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.898 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 30 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.899 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 31 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.900 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 32 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.900 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 33 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.900 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 34 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.901 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 35 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.901 | WARNING | ASTRA.template_creation.stellar_templates.Stellar_Template:evaluate_bad_orders:306 - Stellar template rejecting order 36 due to having more than 9011/9111 pixels masked 2025-04-15 14:56:45.903 | INFO | ASTRA.template_creation.stellar_templates.sum_stellar:create_stellar_template:103 - Closing shared memory interfaces of the Stellar template 2025-04-15 14:56:45.904 | DEBUG | ASTRA.template_creation.stellar_templates.Stellar_Template:cleanup_shared_memory:578 - Cleaning the shared memory interfaces from the Stellar template creation 2025-04-15 14:56:45.905 | DEBUG | ASTRA.template_creation.stellar_templates.Stellar_Template:_close_workers:584 - Sum-Stellar from ESPRESSO19 closing the workers 2025-04-15 14:56:45.907 | DEBUG | ASTRA.template_creation.stellar_templates.Stellar_Template:_close_queues:601 - Sum-Stellar from ESPRESSO19 closing the communication queues 2025-04-15 14:56:45.910 | DEBUG | ASTRA.template_creation.stellar_templates.Stellar_Template:_close_shared_memory_arrays:590 - Sum-Stellar from ESPRESSO19 closing the shared memory array 2025-04-15 14:56:45.913 | INFO | ASTRA.base_models.TemplateFramework:store_templates_to_disk:277 - Storing templates from <Stellar> under the directory 2025-04-15 14:56:45.914 | INFO | ASTRA.base_models.TemplateFramework:store_templates_to_disk:281 - ../../tmp/templates/Stellar/Iteration_0 2025-04-15 14:56:45.915 | INFO | ASTRA.base_models.Template_Model:trigger_data_storage:95 - The template from ESPRESSO18 was not created. Storing nothing to disk 2025-04-15 14:56:45.915 | INFO | ASTRA.base_models.Template_Model:store_template:119 - Storing Sum-Stellar from ESPRESSO19 to disk 2025-04-15 14:56:45.916 | WARNING | ASTRA.base_models.Template_Model:store_template:135 - Disabled removal of old disk files! 2025-04-15 14:56:45.992 | DEBUG | ASTRA.template_creation.stellar_templates.Stellar_Template:store_template:414 - Storing used filepaths to disk 2025-04-15 14:56:45.994 | INFO | ASTRA.template_creation.stellar_templates.Stellar_Template:_store_json_information:331 - Storing template flags to disk
Accessing the templates¶
After construction of the Stellar template, we can access them independently for each sub-Instrument:
In [4]:
Copied!
stellar_template = stell.request_data("ESPRESSO19")
stellar_template = stell.request_data("ESPRESSO19")
This stellar_template object will have the same spectra-interfacing as the Frames:
In [6]:
Copied!
import matplotlib.pyplot as plt
fig, axis = plt.subplots()
wave, flux, err, mask = stellar_template.get_data_from_spectral_order(order=50)
good_pixel_mask = ~mask
axis.scatter(wave[good_pixel_mask], flux[good_pixel_mask], s=5)
axis.set_xlabel(r"wavelength $[\AA]$")
axis.set_ylabel("Flux")
import matplotlib.pyplot as plt
fig, axis = plt.subplots()
wave, flux, err, mask = stellar_template.get_data_from_spectral_order(order=50)
good_pixel_mask = ~mask
axis.scatter(wave[good_pixel_mask], flux[good_pixel_mask], s=5)
axis.set_xlabel(r"wavelength $[\AA]$")
axis.set_ylabel("Flux")
Out[6]:
Text(0, 0.5, 'Flux')