pysiral.l2proc.procsteps
@author: Stefan Hendricks
Classes
Parent class for any Level-2 processor step class, which may be distributed over the |
|
A container providing the ordered list of processing steps |
|
Level-2 Processor step class to transfer variables from the |
|
Level-2 processing step class for applying geophysical range corrections to the elevations |
|
A class creating an instrument_mode flag from radar_mode: |
|
This class add rolling statistics (mean, sdev) using the pandas rolling |
|
This class adds the waveform and associated parameters (range, valid_flag) |
Module Contents
- class pysiral.l2proc.procsteps.Level2ProcessorStep(cfg)
Bases:
pysiral.core.legacy_classes.DefaultLoggingClassParent class for any Level-2 processor step class, which may be distributed over the different pysiral modules.
This class also serves as a template for all subclasses. Mandatory methods and properties in this class which raise a NotImplementedException must be overwritten by the subclass
- cfg
- msgs = []
- error_flag_bit_dict
- execute(l1b: pysiral.l1data.Level1bData, l2: pysiral.l2data.Level2Data) None
The main entry point for the :param l1b: :param l2: :return:
- update_error_flag(l2, error_status)
Add the error_flag of the processing step to the
- Param:
l2: The Level-2 data container
- Param:
error_status: An array with the shape of l2.records containing the error flag (False: nominal, True: error)
- Returns:
- abstractmethod execute_procstep(l1b, l2)
- static get_clean_error_status(shape)
Return an empty (all nominal error status array) :param shape: :return:
- property classname
- abstract property error_bit
- abstract property l2_input_vars
- abstract property l2_output_vars
- class pysiral.l2proc.procsteps.Level2ProcessorStepOrder(cfg)
Bases:
pysiral.core.legacy_classes.DefaultLoggingClassA container providing the ordered list of processing steps as initialized classes for each trajectory
- cfg
- _classes = []
- get_procstep_classes()
Retrieves the required classes from the processor definition files and stores them in a list without initializing them. This way a freshly initialized version can be supplied to each l2 data object without risk of interference of class properties :return:
- get_algorithm_error_flag_bit(procstep_module)
Return the corresponding bit (0-15) for the procstep module :param procstep_module: str :return:
- validate() bool
Checkout the difference processing steps and validate input/output variables in the order of the steps :return:
- property class_list
Return a list of not initialized classes (class instances with the options from the level-2 :return:
- property class_instances
Return a list of initialized classes (class instances with the options from the level-2 processor definition file passed to the class instance) :return:
- class pysiral.l2proc.procsteps.L1BL2TransferVariables(*args, **kwargs)
Bases:
Level2ProcessorStepLevel-2 Processor step class to transfer variables from the l1b to the l2 data object
- execute_procstep(l1b, l2)
Mandatory method of Level-2 processor :param l1b: :param l2: :return: error_status
- property l2_input_vars
- property l2_output_vars
- property error_bit
- class pysiral.l2proc.procsteps.L2ApplyRangeCorrections(*args, **kwargs)
Bases:
Level2ProcessorStepLevel-2 processing step class for applying geophysical range corrections to the elevations
- execute_procstep(l1, l2)
Mandatory method of Level-2 processor :param l1: :param l2: :return: error_status
- static fill_nan_gaps(range_correction: numpy.typing.NDArray, extrapolate: bool = True) numpy.typing.NDArray
Fills gaps in range correction. If the range correction is all-NaN, just return zeros
- Parameters:
range_correction
extrapolate
- Returns:
- property target_variables
Return target variables from config file or default value :return:
- property l2_input_vars
- property l2_output_vars
- property error_bit
- class pysiral.l2proc.procsteps.CS2InstrumentModeflag(*args, **kwargs)
Bases:
Level2ProcessorStepA class creating an instrument_mode flag from radar_mode:
instrument_mode = radar_mode + 1
- execute_procstep(l1b, l2)
Mandatory method of Level-2 processor :param l1b: :param l2: :return: error_status
- property l2_input_vars
- property l2_output_vars
- property error_bit
- class pysiral.l2proc.procsteps.ParameterRollingStatistics(*args, **kwargs)
Bases:
Level2ProcessorStepThis class add rolling statistics (mean, sdev) using the pandas rolling framework to the Level-2 data object.
module: l2proc.procsteps pyclass: ParameterRollingStatistics options:
window_size_m: <maximum size of the marginal ice zone> statistics: [ <list of statistics: “mean” | “sdev”] input_parameters:
<l2_parameter-01>
<l2_parameter-02>
…
For each parameter & statistics combination a new parameter will be added with the naming convention:
<source_parameter_name>_rolling_<statistics_id>
e.g.
module: l2proc.procsteps pyclass: ParameterRollingStatistics options:
window_size_m: 25000. statistics: [“sdev”] input_parameters:
pulse_peakiness
will add the parameter pulse_peakiness_rolling_sdev to the list of l2 (auxiliary) data parameters.
- execute_procstep(l1: pysiral.l1data.Level1bData, l2: pysiral.l2data.Level2Data) numpy.ndarray
API method for Level2ProcessorStep subclasses. Computes and add rolling statistics based on the processor item options in the Level-2 processor definition file.
- Parameters:
l1 – Level-1 data object
l2 – Level-2 data object
- Raises:
None –
- Returns:
error_status
- property statistics_combinations
- property l2_input_vars
- property l2_output_vars
- property error_bit
- class pysiral.l2proc.procsteps.TransferWaveform2L2(*args, **kwargs)
Bases:
Level2ProcessorStepThis class adds the waveform and associated parameters (range, valid_flag) to the l2 data container
module: l2proc.procsteps pyclass: TransferWaveform2L2 options: {}
- execute_procstep(l1: pysiral.l1data.Level1bData, l2: pysiral.l2data.Level2Data) numpy.ndarray
API method for Level2ProcessorStep subclasses. Computes and add rolling statistics based on the processor item options in the Level-2 processor definition file.
- Parameters:
l1 – Level-1 data object
l2 – Level-2 data object
- Raises:
None –
- Returns:
error_status
- property statistics_combinations
- property l2_input_vars
- property l2_output_vars
- property error_bit