Quick start look into sBART#

The sBART pipeline provides the user with all the necessary pieces to construct a template matching algorithm, by selecting the Stellar and Telluric templates, the underlying RV model and the method with which new, tentative RVs, are given to the model.

In this Section we showcase a small example of building a RV model from the different parts of SBART. At the root of the repository it is also possible to find a sbart_example.py which contains the code from this notebook as a single python script

Note: it is highly advised to not run SBART inside jupyter notebooks, as one might run into issues due to terminal logging.

Specifying the input and output paths#

Note: the disk files are not present in the GB repository due to space limitations

[3]:
from SBART.Instruments import ESPRESSO, HARPS
from pathlib import Path


# Either define the path to a text file where each line is a complete path to a S2D file
input_filepath = ""

# or give a list of disk files
input_filepath = [i.as_posix() for i in Path("/home/amiguel/phd/tools/sBART_private/tests/resources").glob("*.fits")]

instrument = ESPRESSO

# Folder in which SBART will store its outputs
storage_path = Path("/home/amiguel/phd/tools/sBART_private/tests/documentation_outputs")

[4]:
# To check the available configurations of ESPRESSO data:
ESPRESSO.config_help()
Configurations:

Name:: bypass_QualCheck
        Description:: None
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: open_without_BervCorr
        Description:: Ensure that the Frame is not BERV corrected, independently of correction being applied or not in the official pipeline
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: apply_FluxCorr
        Description:: Apply the blue-red flux correction due to the wavelength dependence of the atmospheric extinction. Only available on data from ESO pipeline (ESPRESSO)
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: use_air_wavelengths
        Description:: Use air wavelengths, instead of the vacuum ones
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: apply_FluxBalance_Norm
        Description:: None
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: reject_order_percentage
        Description:: None
        Mandatory:: False
        Default value:: 0.25
        Constraints:: Value inside interval <(0, 1)>; Edges: True

Name:: minimum_order_SNR
        Description:: SNR threshold under which the spectral order is rejected
        Mandatory:: False
        Default value:: 5
        Constraints:: Value inside interval <[0, inf]>; Edges: True

Name:: bypass_ST_designation
        Description:: None
        Mandatory:: False
        Default value:: None
        Constraints:: Value from list <(None, 'S2D', 'S1D')>

Name:: Telluric_Corrected
        Description:: The Frame was already corrected from telluric features
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: UseMolecfit
        Description:: None
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: use_old_pipeline
        Description:: Use data from the old pipeline. Only available to selected instruments
        Mandatory:: False
        Default value:: False
        Constraints:: Value from dtype <(<class 'bool'>,)>

Name:: SCIRED_CHECK_IS_FATAL
        Description:: Automatically reject frames with QC SCIRED CHECK = 0
        Mandatory:: False
        Default value:: True
        Constraints:: Value from dtype <(<class 'bool'>,)>


Configure the pipeline#

[5]:
from SBART.utils.units import meter_second
rv_method = "classical" # Either classical or Laplace

# Define the step that will be used for numerical calculations near max/min points
RVstep = 0.1 * meter_second

# Define the window, around the CCF RV, inside which the models can search for the optimal RV
RV_limits = [200*meter_second, 200*meter_second]


# List with orders to "throw" away
orders_to_skip = []

# Number of cores to use
N_cores = 10

Configure the different settings of SBART#

[6]:
# For the S2D loading stage
inst_options = {}

# For the creation of the Telluric Model (i.e. the "template generator")
telluric_model_configs = {"CREATION_MODE": "telfit"
                          }

# For the creation of the individual Telluric templates
telluric_template_genesis_configs = {}


# For the creation of the Stellar Model (i.e. the "template generator")

stellar_model_configs = {}

# For the creation of the individual Stellar templates
stellar_template_genesis_configs = {"MINIMUM_NUMBER_OBS": 2
                                    }


confsRV = {"MEMORY_SAVE_MODE": True}



Setting up the library#

By default, SBART’s logger is disabled and it will not:

  • print information to the terminal

  • store a log file to disk

To do so, we must enable the logging interface:

[7]:
from SBART.outside_tools.create_logger import setup_SBART_logger

setup_SBART_logger(
    storage_path=storage_path / "logs",
    RV_method=rv_method,
    instrument=instrument,
    log_to_terminal=True,  # Set to True if you want to have logs showing on the terminal,
    write_to_file=True
)
2023-06-09T22:37:40 - SBART.outside_tools.create_logger - WARNING - Currently disabled the multi-folder logger structure

Loading data#

We start by “pointing” sBART towards a few observations:

[8]:
from SBART.data_objects import DataClassManager

manager = DataClassManager()
manager.start()

data = manager.DataClass(
    input_filepath,
    storage_path = storage_path,
    instrument=instrument,
    instrument_options=inst_options,
)

Pre-processing the data#

Removing activity-sensitive lines

[9]:
from SBART.Quality_Control.activity_indicators import Indicators

inds = Indicators()
data.remove_activity_lines(inds)

Creating a telluric model to remove those features#

[10]:
from SBART.template_creation.TelluricModel import TelluricModel

ModelTell = TelluricModel(
    usage_mode="individual",
    user_configs=telluric_model_configs,
    root_folder_path=storage_path,
)

ModelTell.Generate_Model(
    dataClass=data,
    telluric_configs=telluric_template_genesis_configs,
    force_computation=False,
    store_templates=True,
)
data.remove_telluric_features(ModelTell)
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - INFO - Starting Telluric Model
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of BASE - TemplateFramework
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <CREATION_MODE> taking the value: telfit
2023-06-09T22:37:44 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <APPLICATION_MODE> using the default value: removal
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <EXTENSION_MODE> using the default value: lines
2023-06-09T22:37:44 - SBART.template_creation.TelluricModel - INFO - Starting Telluric Model
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - DEBUG - Starting the creation of Telluric models!
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - INFO - Attempting to load previous Templates from disk before creating them
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - DEBUG - Searching in : /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Telluric for telfit
2023-06-09T22:37:44 - SBART.template_creation.TelluricModel - INFO - Loading Telluric template from disk inside directory
2023-06-09T22:37:44 - SBART.template_creation.TelluricModel - INFO -       /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Telluric
2023-06-09T22:37:44 - SBART.template_creation.TelluricModel - INFO - Found 1 available templates: ['Telfit_lines_Telluric_ESPRESSO18.fits'] of type Telfit
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of Telfit-Telluric from ESPRESSO18
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <continuum_percentage_drop> taking the value: 1
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <force_download> taking the value: False
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <atmosphere_profile> taking the value: download
2023-06-09T22:37:44 - SBART.utils.UserConfigs - WARNING - Telfit-Telluric from ESPRESSO18 received a configuration flag that is not recognized: download_path
2023-06-09T22:37:44 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <FIT_MODEL> using the default value: False
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <TELFIT_HUMIDITY_THRESHOLD> using the default value: -1
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <FIT_WAVELENGTH_STEP_SIZE> using the default value: 0.001
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <PARAMS_TO_FIT> using the default value: ['pressure', 'humidity']
2023-06-09T22:37:44 - SBART.Components.SpectrumComponent - WARNING - Resetting order status of Telfit-Telluric from ESPRESSO18
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - INFO - Loading Telluric template from disk file:
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - INFO -    Telfit_lines_Telluric_ESPRESSO18.fits
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - DEBUG - Template from ESPRESSO18 has already been loaded.
2023-06-09T22:37:44 - SBART.template_creation.TelluricModel - INFO - Using template of type: telfit
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of Telfit-Telluric from ESPRESSO19
2023-06-09T22:37:44 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <continuum_percentage_drop> using the default value: 1
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <force_download> using the default value: False
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <atmosphere_profile> using the default value: download
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <FIT_MODEL> using the default value: False
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <TELFIT_HUMIDITY_THRESHOLD> using the default value: -1
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <FIT_WAVELENGTH_STEP_SIZE> using the default value: 0.001
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <PARAMS_TO_FIT> using the default value: ['pressure', 'humidity']
2023-06-09T22:37:44 - SBART.Components.SpectrumComponent - WARNING - Resetting order status of Telfit-Telluric from ESPRESSO19
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - DEBUG - Template Telfit-Telluric from ESPRESSO19 loading data from the dataClass
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - WARNING - ESPRESSO19 has no valid observations. Not computing telluric template
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - INFO - Starting creation of Telluric template from ESPRESSO19
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - WARNING - ESPRESSO19 has no valid observations. Not computing telluric template
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - WARNING - Template will not be created. Check previous error messages
2023-06-09T22:37:44 - SBART.template_creation.TelluricModel - INFO - Using template of type: telfit
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of Telfit-Telluric from ESPRESSO21
2023-06-09T22:37:44 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <continuum_percentage_drop> using the default value: 1
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <force_download> using the default value: False
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <atmosphere_profile> using the default value: download
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <FIT_MODEL> using the default value: False
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <TELFIT_HUMIDITY_THRESHOLD> using the default value: -1
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <FIT_WAVELENGTH_STEP_SIZE> using the default value: 0.001
2023-06-09T22:37:44 - SBART.utils.UserConfigs - DEBUG - Configuration <PARAMS_TO_FIT> using the default value: ['pressure', 'humidity']
2023-06-09T22:37:44 - SBART.Components.SpectrumComponent - WARNING - Resetting order status of Telfit-Telluric from ESPRESSO21
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - DEBUG - Template Telfit-Telluric from ESPRESSO21 loading data from the dataClass
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - WARNING - ESPRESSO21 has no valid observations. Not computing telluric template
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - INFO - Starting creation of Telluric template from ESPRESSO21
2023-06-09T22:37:44 - SBART.template_creation.telluric_templates.Telluric_Template - WARNING - ESPRESSO21 has no valid observations. Not computing telluric template
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - WARNING - Template will not be created. Check previous error messages
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - INFO - Storing templates from <Telluric> under the directory
2023-06-09T22:37:44 - SBART.Base_Models.TemplateFramework - INFO -         /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Telluric
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - DEBUG - Loaded Telluric template will not be saved to disk
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - INFO - The template was not created. Storing nothing to disk
2023-06-09T22:37:44 - SBART.Base_Models.Template_Model - INFO - The template was not created. Storing nothing to disk

Creating the stellar templates#

[11]:
from SBART.template_creation.StellarModel import StellarModel

ModelStell = StellarModel(user_configs=stellar_model_configs,
                          root_folder_path=storage_path
                          )
2023-06-09T22:38:09 - SBART.Base_Models.TemplateFramework - INFO - Starting Stellar Model
2023-06-09T22:38:09 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of SpectralModel - Stellar
2023-06-09T22:38:09 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:38:09 - SBART.utils.UserConfigs - DEBUG - Configuration <CREATION_MODE> using the default value: Sum
2023-06-09T22:38:09 - SBART.utils.UserConfigs - DEBUG - Configuration <ALIGNEMENT_RV_SOURCE> using the default value: DRS
2023-06-09T22:38:09 - SBART.utils.UserConfigs - DEBUG - Configuration <PREVIOUS_SBART_PATH> using the default value:
2023-06-09T22:38:09 - SBART.utils.UserConfigs - DEBUG - Configuration <USE_MERGED_RVS> using the default value: False

When creating the stellar templates we can also reject, temporarily, some observations. They will not be used to create the stellar template, but they will still be used during the RV extraction.

[12]:
from SBART.utils.spectral_conditions import Empty_condition

StellarTemplateConditions = Empty_condition()

ModelStell.Generate_Model(
        data,
        stellar_template_genesis_configs,
        StellarTemplateConditions,
        force_computation=False,
    )

ModelStell.store_templates_to_disk(storage_path)

data.ingest_StellarModel(ModelStell)

2023-06-09T22:38:11 - SBART.template_creation.StellarModel - INFO - Applying conditions to creation of stellar template
2023-06-09T22:38:11 - SBART.template_creation.StellarModel - INFO - Using CCF RVs as the basis for the creation of the stellar models
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - DEBUG - Starting the creation of Stellar models!
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO - Attempting to load previous Templates from disk before creating them
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - DEBUG - Searching in : /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Stellar/Iteration_0 for Sum
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO - Loading Stellar template of type Sum from disk inside directory
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO -         /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Stellar/Iteration_0
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO - Found 0 available templates: [] of type Sum
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - WARNING - Could not find template to load in /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Stellar/Iteration_0
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO - No templates to load from disk. Creating all from scratch
2023-06-09T22:38:11 - SBART.template_creation.StellarModel - WARNING - Key <ALIGNEMENT_RV_SOURCE> from Stellar Model over-riding the one from the template configs
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of Sum-Stellar from ESPRESSO18
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <MINIMUM_NUMBER_OBS> taking the value: 2
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <ALIGNEMENT_RV_SOURCE> taking the value: DRS
2023-06-09T22:38:11 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <NUMBER_WORKERS> using the default value: 1
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <MEMORY_SAVE_MODE> using the default value: False
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <INTERPOL_MODE> using the default value: splines
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <SPLINE_TYPE> using the default value: cubic
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <INTERPOLATION_ERR_PROP> using the default value: interpolation
2023-06-09T22:38:11 - SBART.Components.SpectrumComponent - WARNING - Resetting order status of Sum-Stellar from ESPRESSO18
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - INFO - Starting creation of Stellar template from ESPRESSO18
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - INFO - Evaluating spectral conditions to select the valid observations from ESPRESSO18
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.sum_stellar - CRITICAL - Stellar template creation failed due to: 'NoneType' object has no attribute 'get_custom_mask'
Traceback (most recent call last):

  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
           │         │     └ {'__name__': '__main__', '__doc__': 'Entry point for launching an IPython kernel.\n\nThis is separate from the ipykernel pack...
           │         └ <code object <module> at 0x7fbfdb3c49d0, file "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ip...
           └ <function _run_code at 0x7fbfdb35f430>
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
         │     └ {'__name__': '__main__', '__doc__': 'Entry point for launching an IPython kernel.\n\nThis is separate from the ipykernel pack...
         └ <code object <module> at 0x7fbfdb3c49d0, file "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ip...
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel_launcher.py", line 17, in <module>
    app.launch_new_instance()
    │   └ <bound method Application.launch_instance of <class 'ipykernel.kernelapp.IPKernelApp'>>
    └ <module 'ipykernel.kernelapp' from '/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/ker...
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/traitlets/config/application.py", line 978, in launch_instance
    app.start()
    │   └ <function IPKernelApp.start at 0x7fbfd49f33a0>
    └ <ipykernel.kernelapp.IPKernelApp object at 0x7fbfdb4716a0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 712, in start
    self.io_loop.start()
    │    │       └ <function BaseAsyncIOLoop.start at 0x7fbfd750b0d0>
    │    └ <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7fbfd49e7e80>
    └ <ipykernel.kernelapp.IPKernelApp object at 0x7fbfdb4716a0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 215, in start
    self.asyncio_loop.run_forever()
    │    │            └ <function BaseEventLoop.run_forever at 0x7fbfda1fd9d0>
    │    └ <_UnixSelectorEventLoop running=True closed=False debug=False>
    └ <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7fbfd49e7e80>
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x7fbfda200550>
    └ <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x7fbfda6c1310>
    └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 508, in dispatch_queue
    await self.process_one()
          │    └ <function Kernel.process_one at 0x7fbfd5570820>
          └ <ipykernel.ipkernel.IPythonKernel object at 0x7fbfd49c42e0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 497, in process_one
    await dispatch(*args)
          │         └ ([<zmq.sugar.frame.Frame object at 0x7fbfd00ffd50>, <zmq.sugar.frame.Frame object at 0x7fbfd00ffe00>, <zmq.sugar.frame.Frame ...
          └ <bound method Kernel.dispatch_shell of <ipykernel.ipkernel.IPythonKernel object at 0x7fbfd49c42e0>>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 404, in dispatch_shell
    await result
          └ <coroutine object Kernel.execute_request at 0x7fbf8eabe8c0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 728, in execute_request
    reply_content = await reply_content
                          └ <coroutine object IPythonKernel.do_execute at 0x7fbf8eb37dc0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/ipkernel.py", line 390, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
          │     │        │                   │                     └ False
          │     │        │                   └ True
          │     │        └ 'from SBART.utils.spectral_conditions import Empty_condition\n\nStellarTemplateConditions = Empty_condition()\n\nModelStell.G...
          │     └ <function ZMQInteractiveShell.run_cell at 0x7fbfd49e6ca0>
          └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/zmqshell.py", line 528, in run_cell
    return super().run_cell(*args, **kwargs)
                             │       └ {'store_history': True, 'silent': False}
                             └ ('from SBART.utils.spectral_conditions import Empty_condition\n\nStellarTemplateConditions = Empty_condition()\n\nModelStell....
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2863, in run_cell
    result = self._run_cell(
             │    └ <function InteractiveShell._run_cell at 0x7fbfd604aa60>
             └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2909, in _run_cell
    return runner(coro)
           │      └ <coroutine object InteractiveShell.run_cell_async at 0x7fbf8ead60c0>
           └ <function _pseudo_sync_runner at 0x7fbfd63fe4c0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
    coro.send(None)
    │    └ <method 'send' of 'coroutine' objects>
    └ <coroutine object InteractiveShell.run_cell_async at 0x7fbf8ead60c0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3106, in run_cell_async
    has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
                       │    │             │        │     └ '/tmp/ipykernel_86644/1335568502.py'
                       │    │             │        └ [<_ast.ImportFrom object at 0x7fbf8ea67e20>, <_ast.Assign object at 0x7fbf8ea67040>, <_ast.Expr object at 0x7fbf4469f880>, <_...
                       │    │             └ <_ast.Module object at 0x7fbf8ea67730>
                       │    └ <function InteractiveShell.run_ast_nodes at 0x7fbfd604adc0>
                       └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3309, in run_ast_nodes
    if await self.run_code(code, result, async_=asy):
             │    │        │     │              └ False
             │    │        │     └ <ExecutionResult object at 7fbf8ea67a90, execution_count=25 error_before_exec=None error_in_exec=None info=<ExecutionInfo obj...
             │    │        └ <code object <cell line: 5> at 0x7fbf8eac00e0, file "/tmp/ipykernel_86644/1335568502.py", line 5>
             │    └ <function InteractiveShell.run_code at 0x7fbfd604ae50>
             └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3369, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
         │         │    │               │    └ {'__name__': '__main__', '__doc__': 'Automatically created module for IPython interactive environment', '__package__': None, ...
         │         │    │               └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
         │         │    └ <property object at 0x7fbfd64014a0>
         │         └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
         └ <code object <cell line: 5> at 0x7fbf8eac00e0, file "/tmp/ipykernel_86644/1335568502.py", line 5>

  File "/tmp/ipykernel_86644/1335568502.py", line 5, in <cell line: 5>
    ModelStell.Generate_Model(
    │          └ <function StellarModel.Generate_Model at 0x7fbf6c3f5040>
    Model handling: {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}

  File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/StellarModel.py", line 162, in Generate_Model
    super().Generate_Model(

  File "/home/amiguel/phd/tools/sBART_private/SBART/Base_Models/TemplateFramework.py", line 135, in Generate_Model
    self.templates[subInst] = self._compute_template(
    │    │         │          │    └ <function StellarModel._compute_template at 0x7fbf6c3f51f0>
    │    │         │          └ Model handling: {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}
    │    │         └ 'ESPRESSO18'
    │    └ {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}
    Model handling: {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}

  File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/StellarModel.py", line 196, in _compute_template
    stellar_template.create_stellar_template(
    │                └ <function ensure_invalid_template.<locals>.inner1 at 0x7fbf6dfb7790>
    Sum-Stellar from ESPRESSO18

  File "/home/amiguel/phd/tools/sBART_private/SBART/utils/custom_exceptions.py", line 94, in inner1
    func(self, *args, **kwargs)
    │    │      │       └ {'dataClass': <AutoProxy[DataClass] object, typeid 'DataClass' at 0x7fbf8eb12430>, 'conditions': ['No conditions']}
    │    │      └ ()
    │    └ Sum-Stellar from ESPRESSO18
    <function SumStellar.create_stellar_template at 0x7fbf6dfb7700>

> File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/stellar_templates/sum_stellar.py", line 89, in create_stellar_template
    self.launch_parallel(dataClass)
    │    │               └ <AutoProxy[DataClass] object, typeid 'DataClass' at 0x7fbf8eb12430>
    │    └ <function SumStellar.launch_parallel at 0x7fbf6dfb7820>
    Sum-Stellar from ESPRESSO18

  File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/stellar_templates/sum_stellar.py", line 172, in launch_parallel
    wave_reference, _, _, _ = dataClass.get_frame_arrays_by_ID(chosen_epochID)
                              │         │                      └ 0
                              │         └ <function get_frame_arrays_by_ID at 0x7fbf8eacb670>
    <AutoProxy[DataClass] object, typeid 'DataClass' at 0x7fbf8eb12430>

  File "<string>", line 2, in get_frame_arrays_by_ID
  File "/usr/lib/python3.8/multiprocessing/managers.py", line 850, in _callmethod
    raise convert_to_error(kind, result)
          │                │     └ AttributeError("'NoneType' object has no attribute 'get_custom_mask'")
          │                └ '#ERROR'
          └ <function convert_to_error at 0x7fbf6eba14c0>

AttributeError: 'NoneType' object has no attribute 'get_custom_mask'
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.sum_stellar - CRITICAL - Stellar template creation failed due to: 'NoneType' object has no attribute 'get_custom_mask'
Traceback (most recent call last):

  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
           │         │     └ {'__name__': '__main__', '__doc__': 'Entry point for launching an IPython kernel.\n\nThis is separate from the ipykernel pack...
           │         └ <code object <module> at 0x7fbfdb3c49d0, file "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ip...
           └ <function _run_code at 0x7fbfdb35f430>
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
         │     └ {'__name__': '__main__', '__doc__': 'Entry point for launching an IPython kernel.\n\nThis is separate from the ipykernel pack...
         └ <code object <module> at 0x7fbfdb3c49d0, file "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ip...
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel_launcher.py", line 17, in <module>
    app.launch_new_instance()
    │   └ <bound method Application.launch_instance of <class 'ipykernel.kernelapp.IPKernelApp'>>
    └ <module 'ipykernel.kernelapp' from '/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/ker...
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/traitlets/config/application.py", line 978, in launch_instance
    app.start()
    │   └ <function IPKernelApp.start at 0x7fbfd49f33a0>
    └ <ipykernel.kernelapp.IPKernelApp object at 0x7fbfdb4716a0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 712, in start
    self.io_loop.start()
    │    │       └ <function BaseAsyncIOLoop.start at 0x7fbfd750b0d0>
    │    └ <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7fbfd49e7e80>
    └ <ipykernel.kernelapp.IPKernelApp object at 0x7fbfdb4716a0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 215, in start
    self.asyncio_loop.run_forever()
    │    │            └ <function BaseEventLoop.run_forever at 0x7fbfda1fd9d0>
    │    └ <_UnixSelectorEventLoop running=True closed=False debug=False>
    └ <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7fbfd49e7e80>
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x7fbfda200550>
    └ <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x7fbfda6c1310>
    └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle <TaskWakeupMethWrapper object at 0x7fbf8eade940>(<Future finis...7d0>, ...],))>)>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 508, in dispatch_queue
    await self.process_one()
          │    └ <function Kernel.process_one at 0x7fbfd5570820>
          └ <ipykernel.ipkernel.IPythonKernel object at 0x7fbfd49c42e0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 497, in process_one
    await dispatch(*args)
          │         └ ([<zmq.sugar.frame.Frame object at 0x7fbfd00ffd50>, <zmq.sugar.frame.Frame object at 0x7fbfd00ffe00>, <zmq.sugar.frame.Frame ...
          └ <bound method Kernel.dispatch_shell of <ipykernel.ipkernel.IPythonKernel object at 0x7fbfd49c42e0>>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 404, in dispatch_shell
    await result
          └ <coroutine object Kernel.execute_request at 0x7fbf8eabe8c0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 728, in execute_request
    reply_content = await reply_content
                          └ <coroutine object IPythonKernel.do_execute at 0x7fbf8eb37dc0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/ipkernel.py", line 390, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
          │     │        │                   │                     └ False
          │     │        │                   └ True
          │     │        └ 'from SBART.utils.spectral_conditions import Empty_condition\n\nStellarTemplateConditions = Empty_condition()\n\nModelStell.G...
          │     └ <function ZMQInteractiveShell.run_cell at 0x7fbfd49e6ca0>
          └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/ipykernel/zmqshell.py", line 528, in run_cell
    return super().run_cell(*args, **kwargs)
                             │       └ {'store_history': True, 'silent': False}
                             └ ('from SBART.utils.spectral_conditions import Empty_condition\n\nStellarTemplateConditions = Empty_condition()\n\nModelStell....
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2863, in run_cell
    result = self._run_cell(
             │    └ <function InteractiveShell._run_cell at 0x7fbfd604aa60>
             └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2909, in _run_cell
    return runner(coro)
           │      └ <coroutine object InteractiveShell.run_cell_async at 0x7fbf8ead60c0>
           └ <function _pseudo_sync_runner at 0x7fbfd63fe4c0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
    coro.send(None)
    │    └ <method 'send' of 'coroutine' objects>
    └ <coroutine object InteractiveShell.run_cell_async at 0x7fbf8ead60c0>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3106, in run_cell_async
    has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
                       │    │             │        │     └ '/tmp/ipykernel_86644/1335568502.py'
                       │    │             │        └ [<_ast.ImportFrom object at 0x7fbf8ea67e20>, <_ast.Assign object at 0x7fbf8ea67040>, <_ast.Expr object at 0x7fbf4469f880>, <_...
                       │    │             └ <_ast.Module object at 0x7fbf8ea67730>
                       │    └ <function InteractiveShell.run_ast_nodes at 0x7fbfd604adc0>
                       └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3309, in run_ast_nodes
    if await self.run_code(code, result, async_=asy):
             │    │        │     │              └ False
             │    │        │     └ <ExecutionResult object at 7fbf8ea67a90, execution_count=25 error_before_exec=None error_in_exec=None info=<ExecutionInfo obj...
             │    │        └ <code object <cell line: 5> at 0x7fbf8eac00e0, file "/tmp/ipykernel_86644/1335568502.py", line 5>
             │    └ <function InteractiveShell.run_code at 0x7fbfd604ae50>
             └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
  File "/home/amiguel/.virtualenvs/sbart-xwoIdkmx-py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3369, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
         │         │    │               │    └ {'__name__': '__main__', '__doc__': 'Automatically created module for IPython interactive environment', '__package__': None, ...
         │         │    │               └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
         │         │    └ <property object at 0x7fbfd64014a0>
         │         └ <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fbfd49c4850>
         └ <code object <cell line: 5> at 0x7fbf8eac00e0, file "/tmp/ipykernel_86644/1335568502.py", line 5>

  File "/tmp/ipykernel_86644/1335568502.py", line 5, in <cell line: 5>
    ModelStell.Generate_Model(
    │          └ <function StellarModel.Generate_Model at 0x7fbf6c3f5040>
    └ Model handling: {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}

  File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/StellarModel.py", line 162, in Generate_Model
    super().Generate_Model(

  File "/home/amiguel/phd/tools/sBART_private/SBART/Base_Models/TemplateFramework.py", line 135, in Generate_Model
    self.templates[subInst] = self._compute_template(
    │    │         │          │    └ <function StellarModel._compute_template at 0x7fbf6c3f51f0>
    │    │         │          └ Model handling: {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}
    │    │         └ 'ESPRESSO18'
    │    └ {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}
    └ Model handling: {'ESPRESSO18': None, 'ESPRESSO19': None, 'ESPRESSO21': None}

  File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/StellarModel.py", line 196, in _compute_template
    stellar_template.create_stellar_template(
    │                └ <function ensure_invalid_template.<locals>.inner1 at 0x7fbf6dfb7790>
    └ Sum-Stellar from ESPRESSO18

  File "/home/amiguel/phd/tools/sBART_private/SBART/utils/custom_exceptions.py", line 94, in inner1
    func(self, *args, **kwargs)
    │    │      │       └ {'dataClass': <AutoProxy[DataClass] object, typeid 'DataClass' at 0x7fbf8eb12430>, 'conditions': ['No conditions']}
    │    │      └ ()
    │    └ Sum-Stellar from ESPRESSO18
    └ <function SumStellar.create_stellar_template at 0x7fbf6dfb7700>

> File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/stellar_templates/sum_stellar.py", line 89, in create_stellar_template
    self.launch_parallel(dataClass)
    │    │               └ <AutoProxy[DataClass] object, typeid 'DataClass' at 0x7fbf8eb12430>
    │    └ <function SumStellar.launch_parallel at 0x7fbf6dfb7820>
    └ Sum-Stellar from ESPRESSO18

  File "/home/amiguel/phd/tools/sBART_private/SBART/template_creation/stellar_templates/sum_stellar.py", line 172, in launch_parallel
    wave_reference, _, _, _ = dataClass.get_frame_arrays_by_ID(chosen_epochID)
                              │         │                      └ 0
                              │         └ <function get_frame_arrays_by_ID at 0x7fbf8eacb670>
                              └ <AutoProxy[DataClass] object, typeid 'DataClass' at 0x7fbf8eb12430>

  File "<string>", line 2, in get_frame_arrays_by_ID
  File "/usr/lib/python3.8/multiprocessing/managers.py", line 850, in _callmethod
    raise convert_to_error(kind, result)
          │                │     └ AttributeError("'NoneType' object has no attribute 'get_custom_mask'")
          │                └ '#ERROR'
          └ <function convert_to_error at 0x7fbf6eba14c0>

AttributeError: 'NoneType' object has no attribute 'get_custom_mask'
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.sum_stellar - INFO - Closing shared memory interfaces of the Stellar template
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - DEBUG - Cleaning the shared memory interfaces from the Stellar template creation
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - DEBUG - Sum-Stellar from ESPRESSO18 closing the workers
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - DEBUG - Sum-Stellar from ESPRESSO18 closing the communication queues
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - DEBUG - Sum-Stellar from ESPRESSO18 closing the shared memory array
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.sum_stellar - WARNING - Computation of SNR from stellar template temporarily disabled!
2023-06-09T22:38:11 - SBART.template_creation.StellarModel - WARNING - Key <ALIGNEMENT_RV_SOURCE> from Stellar Model over-riding the one from the template configs
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of Sum-Stellar from ESPRESSO19
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <MINIMUM_NUMBER_OBS> taking the value: 2
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <ALIGNEMENT_RV_SOURCE> taking the value: DRS
2023-06-09T22:38:11 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <NUMBER_WORKERS> using the default value: 1
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <MEMORY_SAVE_MODE> using the default value: False
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <INTERPOL_MODE> using the default value: splines
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <SPLINE_TYPE> using the default value: cubic
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <INTERPOLATION_ERR_PROP> using the default value: interpolation
2023-06-09T22:38:11 - SBART.Components.SpectrumComponent - WARNING - Resetting order status of Sum-Stellar from ESPRESSO19
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - INFO - Starting creation of Stellar template from ESPRESSO19
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - CRITICAL - ESPRESSO19 has no valid observations. Not computing Stellar template
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - CRITICAL - ESPRESSO19 has no valid observations. Not computing Stellar template
2023-06-09T22:38:11 - SBART.Base_Models.Template_Model - WARNING - Template will not be created. Check previous error messages
2023-06-09T22:38:11 - SBART.template_creation.StellarModel - WARNING - Key <ALIGNEMENT_RV_SOURCE> from Stellar Model over-riding the one from the template configs
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Generating internal configs of Sum-Stellar from ESPRESSO21
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <MINIMUM_NUMBER_OBS> taking the value: 2
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <ALIGNEMENT_RV_SOURCE> taking the value: DRS
2023-06-09T22:38:11 - SBART.utils.UserConfigs - INFO - Checking for any parameter that will take default value
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <NUMBER_WORKERS> using the default value: 1
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <MEMORY_SAVE_MODE> using the default value: False
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <INTERPOL_MODE> using the default value: splines
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <SPLINE_TYPE> using the default value: cubic
2023-06-09T22:38:11 - SBART.utils.UserConfigs - DEBUG - Configuration <INTERPOLATION_ERR_PROP> using the default value: interpolation
2023-06-09T22:38:11 - SBART.Components.SpectrumComponent - WARNING - Resetting order status of Sum-Stellar from ESPRESSO21
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - INFO - Starting creation of Stellar template from ESPRESSO21
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - CRITICAL - ESPRESSO21 has no valid observations. Not computing Stellar template
2023-06-09T22:38:11 - SBART.template_creation.stellar_templates.Stellar_Template - CRITICAL - ESPRESSO21 has no valid observations. Not computing Stellar template
2023-06-09T22:38:11 - SBART.Base_Models.Template_Model - WARNING - Template will not be created. Check previous error messages
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO - Storing templates from <Stellar> under the directory
2023-06-09T22:38:11 - SBART.Base_Models.TemplateFramework - INFO -         /home/amiguel/phd/tools/sBART_private/tests/documentation_outputs/templates/Stellar/Iteration_0
2023-06-09T22:38:11 - SBART.Base_Models.Template_Model - INFO - Storing Sum-Stellar from ESPRESSO18 to disk
2023-06-09T22:38:11 - SBART.Base_Models.Template_Model - WARNING - Disabled removal of old disk files!
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [25], in <cell line: 5>()
      1 from SBART.utils.spectral_conditions import Empty_condition
      3 StellarTemplateConditions = Empty_condition()
----> 5 ModelStell.Generate_Model(
      6         data,
      7         stellar_template_genesis_configs,
      8         StellarTemplateConditions,
      9         force_computation=False,
     10     )
     12 ModelStell.store_templates_to_disk(storage_path)
     14 data.ingest_StellarModel(ModelStell)

File ~/phd/tools/sBART_private/SBART/template_creation/StellarModel.py:177, in StellarModel.Generate_Model(self, dataClass, template_configs, conditions, force_computation, store_templates)
    170     temp.update_RV_source_info(
    171         iteration_number=self.iteration_number,
    172         RV_source=self.RV_source,
    173         merged_source=self._internal_configs["USE_MERGED_RVS"],
    174     )
    176 if store_templates:
--> 177     self.store_templates_to_disk()

File ~/phd/tools/sBART_private/SBART/Base_Models/TemplateFramework.py:244, in TemplateFramework.store_templates_to_disk(self, clobber)
    241 logger.info("\t" + storage_path)
    243 for template in self.templates.values():
--> 244     template.trigger_data_storage(clobber=clobber)

File ~/phd/tools/sBART_private/SBART/template_creation/stellar_templates/Stellar_Template.py:253, in StellarTemplate.trigger_data_storage(self, clobber)
    251 def trigger_data_storage(self, clobber) -> NoReturn:
    252     try:
--> 253         super().trigger_data_storage(clobber)
    254         self._store_json_information()
    255         self.store_metrics()

File ~/phd/tools/sBART_private/SBART/Base_Models/Template_Model.py:93, in BaseTemplate.trigger_data_storage(self, clobber)
     90     logger.info("The template was not created. Storing nothing to disk")
     91     raise custom_exceptions.FailedStorage
---> 93 self.store_template(clobber=clobber)

File ~/phd/tools/sBART_private/SBART/template_creation/stellar_templates/Stellar_Template.py:312, in StellarTemplate.store_template(self, clobber)
    309 hdu_wave = fits.ImageHDU(data=self.wavelengths, header=header, name="WAVE")
    310 hdu_temp = fits.ImageHDU(data=self.spectra, header=header, name="TEMP")
--> 312 mask = self.spectral_mask.get_custom_mask().astype(int)
    314 hdu_mask = fits.ImageHDU(data=mask, header=header, name="MASK")
    315 hdu_uncerts = fits.ImageHDU(data=self.uncertainties, header=header, name="UNCERTAINTIES")

AttributeError: 'NoneType' object has no attribute 'get_custom_mask'

Extracting Radial Velocities#

Lastly, we only need to define the RV model that we want to use

[13]:
from SBART.rv_calculation.RV_Bayesian.RV_Bayesian import RV_Bayesian
from SBART.rv_calculation.rv_stepping.RV_step import RV_step
from SBART.Samplers import chi_squared_sampler, Laplace_approx
import os


if rv_method == "classical":
    sampler = chi_squared_sampler(RVstep, RV_limits)
    rv_model = RV_step(
        processes=N_cores,
        RV_configs=confsRV,
        sampler=sampler,
    )

    orders = orders_to_skip
elif rv_method == "Laplace":
    sampler = Laplace_approx(RVstep, RV_limits)
    rv_model = RV_Bayesian(
        processes=N_cores,
        RV_configs=confsRV,
        sampler=sampler,
    )
    orders = os.path.join(storage_path, "Iteration_0/RV_step")
else:
    raise Exception

# warning is raised as this was ran over simulated data and we used a non-existing target name
rv_model.run_routine(data, storage_path, orders)
/home/amiguel/phd/tools/sBART_private/src/SBART/data_objects/RV_cube.py:792: RuntimeWarning: invalid value encountered in divide
  empty_array /= np.max(empty_array, axis=1)[:, None]  # normalize across the orders
/home/amiguel/phd/tools/sBART_private/src/SBART/utils/math_tools/weighted_mean.py:13: RuntimeWarning: invalid value encountered in divide
  final_RV = np.nansum(np.multiply(weights, orders_RV), axis=1) / sum_weights
/home/amiguel/phd/tools/sBART_private/src/SBART/utils/math_tools/weighted_mean.py:17: RuntimeWarning: divide by zero encountered in divide
  final_error = np.sqrt(1 / (sum_weights))
/home/amiguel/phd/tools/sBART_private/src/SBART/data_objects/RV_cube.py:792: RuntimeWarning: invalid value encountered in divide
  empty_array /= np.max(empty_array, axis=1)[:, None]  # normalize across the orders
/home/amiguel/phd/tools/sBART_private/.venv/lib/python3.8/site-packages/matplotlib/axes/_axes.py:1148: RuntimeWarning: All-NaN axis encountered
  miny = np.nanmin(masked_verts[..., 1])
/home/amiguel/phd/tools/sBART_private/.venv/lib/python3.8/site-packages/matplotlib/axes/_axes.py:1149: RuntimeWarning: All-NaN axis encountered
  maxy = np.nanmax(masked_verts[..., 1])