Lidar
Class Lidar
- SignalCreation.Lidar.Lidar(parameter_file=None, dt=None)
Main library for processing ozone lidar data for ACTRIS.
- Parameters:
parameter_file (str or None) – Path to the XML file containing processing parameters. If None, default parameters are used.
dt (str | date | None)
- - `_param`
Instance of ParametersFromXml class for handling parameters from the XML file.
- - `_parameter_file`
Path to the parameter file.
- - `output`
xarray Dataset for storing processed data.
- - `_raw_lidar`
Placeholder for raw lidar data.
- - `_atmosphere`
Placeholder for atmospheric data.
- - `_cross_section_ozone`
Placeholder for ozone cross-section data.
- - `_radiosonde`
Placeholder for radiosonde data.
- - `_lidar`
Placeholder for lidar data.
- - `_atmospheric_component_atm`
Placeholder for atmospheric components.
- - `_climato`
Dictionary for storing climatological data.
- - `_cross_section`
Dictionary for storing cross-section data.
- - `_geometrical_factor`
Placeholder for geometrical factor data.
- - `_ureg`
Instance of the unit registry for handling units.
- - `_simulated_lidar_raw_signal`
Placeholder for simulated lidar raw signal data.
- SignalCreation.Lidar.Lidar.__init__(self, parameter_file=None, dt=None)
Initialize the OzoneLidarProcessor.
- Parameters:
parameter_file (str or None) – Path to the XML file containing processing parameters. If None, default parameters are used.
dt (str | date | None)
- SignalCreation.Lidar.Lidar.import_parameters(self, parameter_file)
Read parameter file and put the data into the geoscene class.
- Parameters:
parameter_file (str) – String, pathname of the parameter file
- SignalCreation.Lidar.Lidar.import_lidar_data(self, lidar_files=None, channel_to_remove=None, lidar_format=None, force_photocounting_units=None, xml_tag='Read/Lidar_files/')
Import raw lidar data from file(s) and insert into _lidar attribute of the class.
- Parameters:
lidar_files (str or None) – list of file to read (default: None)
channel_to_remove (int or list or None) – channels to remove (default: None)
lidar_format (str or None) – format of input data (default: None)
force_photocounting_units (str or None) – force the unit for photocounting (if MHz)
xml_tag (str) – tag into the parameter file, if needed (default: “Read/Lidar_files/”)
- SignalCreation.Lidar.Lidar.import_atmospheric_component(self, main_parameters_tag='Read/Atmosphere_file')
Read temperature, pressure and density of the components of the atmosphere :param main_parameters_tag: tag of parameters in the parameter file (default: “Read/Atmosphere_file”) :type main_parameters_tag: str
- Parameters:
main_parameters_tag (str)
- SignalCreation.Lidar.Lidar.import_other_atmospheric_component(self, atm_cpt='all')
Import into the dataset other atmospheric components (like ozone)
- Parameters:
atm_cpt (str or list[str]) – composant to import, or list of composant
- SignalCreation.Lidar.Lidar.create_simulated_lidar(self)
- SignalCreation.Lidar.Lidar.background(self, list_data_name=None, error_suffix=None, prefix_output_name=None, raw_lidar_data_prefix=None)
- Parameters:
list_data_name (None | list)
error_suffix (str | None)
prefix_output_name (str | None)
raw_lidar_data_prefix (str | None)
- SignalCreation.Lidar.Lidar.saturation(self, list_data_name=None, error_suffix=None, prefix_output_name=None, list_signal_type=None)
Apply saturation to lidar signa
- Parameters:
list_data_name (None | list) – list raw data name to process
error_suffix (str | None) – suffix of the uncertainty name (default: _Unc)
prefix_output_name (str | None) – prefix of the output name
list_signal_type (list | ndarray | None) – list signal type to process, if no list of data name (default: np.arange(100, 120))
- SignalCreation.Lidar.Lidar.geometrical_factor(self, list_data_name=None, error_suffix=None, prefix_output_name=None)
- Parameters:
list_data_name (None | list)
error_suffix (str | None)
prefix_output_name (str | None)
- SignalCreation.Lidar.Lidar.apply_preprocess(self, raw_lidar_data_prefix=None, background_prefix=None, saturation_prefix=None, geometrical_prefix=None, preprocess_prefix=None, error_suffix=None, list_signal_type=None)
Apply pre-process for lidar data : background, saturation and geometrical factor
- Parameters:
raw_lidar_data_prefix (str | None) – prefix of raw lidar data name to use
background_prefix (str | None) – prefix of background data name to use
saturation_prefix (str | None) – prefix of saturation data name to use
geometrical_prefix (str | None) – prefix of geometrical factor data name to use
preprocess_prefix (str | None) – prefix of the output preprocess data name
error_suffix (str | None) – suffix of the error
list_signal_type (list | ndarray | None) – list of data type to use if necessary (default: np.arange(100, 120))
- SignalCreation.Lidar.Lidar.aerosols_process(self)
- SignalCreation.Lidar.Lidar.filtering(self, list_data_name=None, error_suffix=None, input_prefix=None, prefix_output=None, filter_output=None, resolution_output_origin=None, resolution_output_ndacc_df=None, resolution_output_ndacc_ir=None, resolution_methodology=None, list_signal_type=None, name_param_tag='Filtering', use_pr2=False, use_log=False)
Apply filtering to lidar data
- Parameters:
list_data_name (None | list) – list of raw data name to use
error_suffix (str | None) – suffix of the uncertainty (default: _Unc)
input_prefix (str | None) – prefix of input data name
prefix_output (str | None) – prefix of output data
filter_output (str | None) – prefix of the filtering data
resolution_output_origin (str | None) – name of the origin resolution output name, originator method
resolution_output_ndacc_df (str | None) – name of the NDACC resolution output name, DF method
resolution_output_ndacc_ir (str | None) – name of the NDACC resolution output name, IR method
resolution_methodology (str | list | None) – name of the methodology of calculation of resolution
list_signal_type (list | ndarray | None) – list of data type to use if necessary (default: np.arange(100, 120))
name_param_tag (str) – name of the tag into the parameter file
use_pr2 (bool) – apply the filter into the PR2 signal (default: False)
use_log (bool) – apply the filter into the signal or PR2 signal is use_pr2 is True (default: False)
- SignalCreation.Lidar.Lidar.glue(self, list_signal_type_1=None, list_signal_type_2=None, name_param_tag='MergingOzone', method=None, shift=None, alt_min=None, alt_max=None, error_suffix=None, input_prefix=None, prefix_output=None, math_operation='addition')
Merge (or “glue”) two LIDAR signals over a defined altitude range.
This function takes two lists of signal types (typically corresponding to two different LIDAR channels) and merges them into a single signal over a specified altitude window, using a chosen interpolation method and an optional vertical shift. The merged signal and its associated uncertainty are inserted into the LIDAR dataset, along with resolution arrays.
- Parameters:
list_signal_type_1 (list[str], optional) – List of signal types from channel 1. If None, will be read from XML configuration using name_param_tag/channel_1.
list_signal_type_2 (list[str], optional) – List of signal types from channel 2. If None, will be read from XML configuration using name_param_tag/channel_2.
name_param_tag (str, default="MergingOzone") – Name of the configuration tag used to read/write parameters from/to the XML configuration.
method (str or list[str], optional) – Interpolation method(s) used for merging (e.g., ‘linear’, ‘log’). If None, defaults to ‘linear’.
shift (int or list[int], optional) – Vertical shift(s) applied to align the two signals before merging. Defaults to 0 if not provided.
alt_min (pint.Quantity or str or list, optional) – Minimum altitude(s) for the merging range. If None, defaults to 23000 meters.
alt_max (pint.Quantity or str or list, optional) – Maximum altitude(s) for the merging range. If None, defaults to 24000 meters.
error_suffix (str, optional) – Suffix used to identify uncertainty variables in the dataset. Defaults to “_Unc” if not provided.
input_prefix (str, optional) – Prefix used to locate input signal variables in the dataset. If None, will be inferred based on name_param_tag.
prefix_output (str, optional) – Prefix for naming output merged variables. Defaults to the same as input_prefix.
math_operation (str)
- Raises:
RuntimeError – If signal variables are missing from the dataset, or if the signal type lists have mismatched lengths.
Side Effects –
------------ –
- Parameters may be read from or written to the internal XML configuration object (self._param). –
- New merged signals, uncertainty arrays, and resolution arrays are added to the LIDAR dataset (self._lidar). –
Notes
This function handles both single and multiple signal pairs.
Unit consistency (via pint) is enforced for altitude-related parameters.
Merging is done through an external merge() function which applies the actual algorithm.
- SignalCreation.Lidar.Lidar.ozone_process(self, list_data_name=None, error_suffix=None, input_prefix=None, prefix_output=None, binomial_filter_number_of_point=None, rayleigh_cross_section_method=None)
- Parameters:
list_data_name (None | list)
error_suffix (str | None)
input_prefix (str | None)
prefix_output (str | None)
binomial_filter_number_of_point (str | int | None)
rayleigh_cross_section_method (str | None)
- SignalCreation.Lidar.Lidar.validity_domain(self)
- SignalCreation.Lidar.Lidar.partial_o3_column(self, signal_type=None)
Calculation of partial ozone column, in troposphere, stratosphere, and total column
- Parameters:
signal_type (str | int | float | None) – signal type to use for the ozone concentration. If None, search the highest value (default: None)
- Returns:
- SignalCreation.Lidar.Lidar.export_data(self, default_write_netcdf=True, default_write_aeris=False, default_write_ascii=False, default_write_figures=False)
Export lidar data in different formats.
- Parameters:
default_write_netcdf (bool) – Flag of creation of NetCDF file (default: True)
default_write_aeris (bool) – Flag of creation of Ascii file (default: True)
default_write_ascii (bool) – Flag of creation of Ascii file (default: True)
default_write_figures (bool) – Flag of creation of figure files (default: True)
- SignalCreation.Lidar.Lidar.export_ascii(self, tag_filename_ascii='ExportData/AerisFile/filename', tag_format_ascii='ExportData/AerisFile/format')
- Parameters:
tag_filename_ascii (str)
tag_format_ascii (str)
- SignalCreation.Lidar.Lidar.export_netcdf(self, output_filename_nc=None, output_filename_xml=None)
Export data to netcdf file
- Parameters:
output_filename_nc (str or None) – filename of the NetCDF file (default: None)
output_filename_xml (str | None)
Tools functions
- SignalCreation.Lidar.get_data_name(ds, prefix=None, attrs=None, attrs_to_exclude=None, output_format=None)
Get name of variable from dataset in function of input parameters
- Parameters:
ds (Dataset) – dataset
prefix (str | None) – prefix of the name of the variable
attrs (dict | None) – attributes of the variables
attrs_to_exclude (dict | None) – attributes of the variables to exclude
output_format (str | None) – specific format of the output: first, last, None (default: None)
- Returns:
list of names or string (if output is not None)
- Return type:
list | str | None
- SignalCreation.Lidar.get_signal_type_paired(signal_type_in_1, signal_type_in_2=None, type_paired=None)
Return the new signal type after merge
- Parameters:
signal_type_in_1 (str | float | int) – signal type of signal 1
signal_type_in_2 (str | int | float | None) – signal type of signal 1 (default: None, corresponding at signal_type_in_1 + 1)
type_paired (str | None) – string corresponding of the type of glue (default: None => Ozone)
- Returns:
the new signal type
- Return type:
int