pysiral.l2proc.procsteps ======================== .. py:module:: pysiral.l2proc.procsteps .. autoapi-nested-parse:: @author: Stefan Hendricks Classes ------- .. autoapisummary:: pysiral.l2proc.procsteps.Level2ProcessorStep pysiral.l2proc.procsteps.Level2ProcessorStepOrder pysiral.l2proc.procsteps.L1BL2TransferVariables pysiral.l2proc.procsteps.L2ApplyRangeCorrections pysiral.l2proc.procsteps.CS2InstrumentModeflag pysiral.l2proc.procsteps.ParameterRollingStatistics pysiral.l2proc.procsteps.TransferWaveform2L2 Module Contents --------------- .. py:class:: Level2ProcessorStep(cfg) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` Parent 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 .. py:attribute:: cfg .. py:attribute:: msgs :value: [] .. py:attribute:: error_flag_bit_dict .. py:method:: execute(l1b: pysiral.l1data.Level1bData, l2: pysiral.l2data.Level2Data) -> None The main entry point for the :param l1b: :param l2: :return: .. py:method:: 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) :return: .. py:method:: execute_procstep(l1b, l2) :abstractmethod: .. py:method:: get_clean_error_status(shape) :staticmethod: Return an empty (all nominal error status array) :param shape: :return: .. py:property:: classname .. py:property:: error_bit :abstractmethod: .. py:property:: l2_input_vars :abstractmethod: .. py:property:: l2_output_vars :abstractmethod: .. py:class:: Level2ProcessorStepOrder(cfg) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` A container providing the ordered list of processing steps as initialized classes for each trajectory .. py:attribute:: cfg .. py:attribute:: _classes :value: [] .. py:method:: 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: .. py:method:: get_algorithm_error_flag_bit(procstep_module) Return the corresponding bit (0-15) for the procstep module :param procstep_module: str :return: .. py:method:: validate() -> bool Checkout the difference processing steps and validate input/output variables in the order of the steps :return: .. py:property:: class_list Return a list of not initialized classes (class instances with the options from the level-2 :return: .. py: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: .. py:class:: L1BL2TransferVariables(*args, **kwargs) Bases: :py:obj:`Level2ProcessorStep` Level-2 Processor step class to transfer variables from the l1b to the l2 data object .. py:method:: execute_procstep(l1b, l2) Mandatory method of Level-2 processor :param l1b: :param l2: :return: error_status .. py:property:: l2_input_vars .. py:property:: l2_output_vars .. py:property:: error_bit .. py:class:: L2ApplyRangeCorrections(*args, **kwargs) Bases: :py:obj:`Level2ProcessorStep` Level-2 processing step class for applying geophysical range corrections to the elevations .. py:method:: execute_procstep(l1, l2) Mandatory method of Level-2 processor :param l1: :param l2: :return: error_status .. py:method:: fill_nan_gaps(range_correction: numpy.typing.NDArray, extrapolate: bool = True) -> numpy.typing.NDArray :staticmethod: Fills gaps in range correction. If the range correction is all-NaN, just return zeros :param range_correction: :param extrapolate: :return: .. py:property:: target_variables Return target variables from config file or default value :return: .. py:property:: l2_input_vars .. py:property:: l2_output_vars .. py:property:: error_bit .. py:class:: CS2InstrumentModeflag(*args, **kwargs) Bases: :py:obj:`Level2ProcessorStep` A class creating an instrument_mode flag from radar_mode: instrument_mode = radar_mode + 1 .. py:method:: execute_procstep(l1b, l2) Mandatory method of Level-2 processor :param l1b: :param l2: :return: error_status .. py:property:: l2_input_vars .. py:property:: l2_output_vars .. py:property:: error_bit .. py:class:: ParameterRollingStatistics(*args, **kwargs) Bases: :py:obj:`Level2ProcessorStep` This 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: statistics: [ - - ... For each parameter & statistics combination a new parameter will be added with the naming convention: _rolling_ 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. .. py:method:: 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. :param l1: Level-1 data object :param l2: Level-2 data object :raises None: :return: error_status .. py:property:: statistics_combinations .. py:property:: l2_input_vars .. py:property:: l2_output_vars .. py:property:: error_bit .. py:class:: TransferWaveform2L2(*args, **kwargs) Bases: :py:obj:`Level2ProcessorStep` This class adds the waveform and associated parameters (range, valid_flag) to the l2 data container - module: l2proc.procsteps pyclass: TransferWaveform2L2 options: {} .. py:method:: 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. :param l1: Level-1 data object :param l2: Level-2 data object :raises None: :return: error_status .. py:property:: statistics_combinations .. py:property:: l2_input_vars .. py:property:: l2_output_vars .. py:property:: error_bit