ESPRESSO

Level 2

RVData/rvdata/instruments/espresso/level2.py

UNIGE-ESO - EPRV Author: Loris JACQUES & Emile FONTANET Created: Mon Mar 03 2025 Last Modified: Mon Mar 03 2025 Version: 1.0.0

Libraries

class rvdata.instruments.espresso.level2.ESPRESSORV2

Bases: RV2

Read ESPRESSO Level 1 and Level 2 files and convert them into the EPRV standard format.

This class extends the RV2 base class to handle the reading of ESPRESSO (Echelle SPectrograph for Rocky Exoplanets and Stable Spectroscopic Observations) Level 1 and Level 2 files, combining information from both sources to produce a standardized EPRV output. It processes various FITS extensions and organizes flux, wavelength, variance, and metadata into a structured Python object.

do_conversion(hdul: fits.HDUList) None

Reads the input FITS HDU list, extracts specific extensions related to the science data for different chips and fibers, and stores them in a standardized format.

  • The method validates the FITS file before conversion to ensure it

meets the required criteria. - Retrieves necessary file paths for additional files required in the processing. - Converts the spectral blaze functions (S2D_BLAZE_A, S2D_BLAZE_B, BLAZE_A, BLAZE_B) for the different fibers. - Processes and converts the drift file for instrumental calibration. - Creates the PRIMARY header and necessary metadata. - For now: Removes unused or redundant extensions such as RECEIPT and DRP_CONFIG.

extensions

A dictionary containing all the created extensions, where the keys are extension names, and the values are the respective data arrays.

Type:

dict

header

A dictionary containing metadata headers from the FITS files, with each extension’s metadata stored under its respective key.

Type:

dict

Notes

  • The do_conversion method processes and extracts science and

calibration data. - The method ensures the FITS file meets the required criteria before conversion. - Blaze correction functions are processed and stored for each fiber. - The drift file is processed separately for calibration. - Unused extensions (like RECEIPT and DRP_CONFIG) are removed from the final output.

Example

>>> from core.models.level2 import RV2
>>> rv2_obj = ESPRESSORV2.from_fits("espresso_level1_file.fits")
>>> rv2_obj.to_fits("standard_level2.fits")
do_conversion(hdul: HDUList, directory_structure: str = 'standard') None

Converts FITS files based on certain conditions and configurations.

This method performs several processing steps:

  1. Validates the FITS file structure before conversion.

  2. Retrieves paths for required additional files (e.g., blaze functions, drift corrections).

  3. Converts and stores spectral blaze functions for different fibers.

  4. Converts the drift correction data.

  5. Creates the PRIMARY header and integrates necessary metadata.

  6. Cleans up unused extensions like RECEIPT and DRP_CONFIG.

Parameters:
  • hdul (fits.HDUList) – The FITS HDU list to be processed.

  • directory_structure (str) – Type of database architecture that stores resources. Must be either ‘dace’ or ‘standard’.

Raises:
  • ValueError – If the FITS file is invalid and does not meet the required criteria for conversion.

  • :noindex:

Level 3

RVData/rvdata/instruments/espresso/level3.py

UNIGE-ESO - EPRV Author: Loris JACQUES & Emile FONTANET Version: 1.0.0

Libraries

class rvdata.instruments.espresso.level3.ESPRESSORV3

Bases: RV3

Read ESPRESSO raw and S1D files and convert them into the EPRV standard format.

This class extends the RV3 base class to handle the reading of ESPRESSO (Echelle SPectrograph for Rocky Exoplanets and Stable Spectroscopic Observations) raw and S1D files, combining information from both sources to produce a standardized EPRV output. It processes various FITS extensions and organizes flux, wavelength, variance, and metadata into a structured Python object.

do_conversion(hdul: fits.HDUList) None

Reads the input FITS HDU list, extracts specific extensions related to the science data for different chips and fibers, and stores them in a standardized format. - The method validates the FITS file before conversion to ensure it meets the required criteria. - Retrieves necessary file paths for additional files required in the processing. - Creates the PRIMARY header and necessary metadata.

extensions

A dictionary containing all the created extensions, where the keys are extension names, and the values are the respective data arrays.

Type:

dict

header

A dictionary containing metadata headers from the FITS files, with each extension’s metadata stored under its respective key.

Type:

dict

Notes

  • The do_conversion method processes and extracts science and

calibration data. - The method ensures the FITS file meets the required criteria before conversion.

Example

>>> from core.models.level3 import RV3
>>> rv3_obj = ESPRESSORV3.from_fits("espresso_raw_file.fits")
>>> rv3_obj.to_fits("standard_level3.fits")
do_conversion(hdul: HDUList, directory_structure: str = 'standard') None

Converts FITS files based on certain conditions and configurations.

This method performs several processing steps:

  1. Validates the FITS file structure before conversion.

  2. Retrieves paths for required additional files.

  3. Converts and stores S1D data.

  4. Creates the PRIMARY header and integrates necessary metadata.

Parameters:
  • hdul (fits.HDUList) – The FITS HDU list to be processed.

  • directory_structure (str) – Type of database architecture that stores resources. Must be either ‘dace’ or ‘standard’.

Raises:
  • ValueError – If the FITS file is invalid and does not meet the required criteria for conversion.

  • :noindex:

Level 4

RVData/rvdata/instruments/espresso/level4.py

UNIGE-ESO - EPRV Author: Loris JACQUES & Emile FONTANET Version: 1.0.0

Libraries

class rvdata.instruments.espresso.level4.ESPRESSORV4

Bases: RV4

Read ESPRESSO raw and CCF files and convert them into the EPRV standard format.

This class extends the RV4 base class to handle the reading of ESPRESSO (Echelle SPectrograph for Rocky Exoplanets and Stable Spectroscopic Observations) raw and CCF files, combining information from both sources to produce a standardized EPRV output. It processes various FITS extensions and organizes flux, wavelength, variance, and metadata into a structured Python object.

do_conversion(hdul: fits.HDUList) None

Reads the input FITS HDU list, extracts specific extensions related to the science data for different chips and fibers, and stores them in a standardized format.

  • The method validates the FITS file before conversion to ensure it

meets the required criteria. - Retrieves necessary file paths for additional files required in the processing. - Creates the PRIMARY header and necessary metadata.

extensions

A dictionary containing all the created extensions, where the keys are extension names, and the values are the respective data arrays.

Type:

dict

header

A dictionary containing metadata headers from the FITS files, with each extension’s metadata stored under its respective key.

Type:

dict

Example

>>> from core.models.level4 import RV4
>>> rv4_obj = ESPRESSORV4.from_fits("espresso_raw_file.fits")
>>> rv4_obj.to_fits("standard_level4.fits")
do_conversion(hdul: HDUList, directory_structure: str = 'standard') None

Converts FITS files based on certain conditions and configurations.

This method performs several processing steps:

  1. Validates the FITS file structure before conversion.

  2. Retrieves paths for required additional files.

  3. Creates the PRIMARY header and integrates necessary metadata.

  4. Converts and stores CCF data.

Parameters:
  • hdul (fits.HDUList) – The FITS HDU list to be processed.

  • directory_structure (str) – Type of database architecture that stores resources. Must be either ‘dace’ or ‘standard’.

Raises:
  • ValueError – If the FITS file is invalid and does not meet the required criteria for conversion.

  • :noindex: