pysiral.l1preproc ================= .. py:module:: pysiral.l1preproc Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pysiral/l1preproc/procitems/index Attributes ---------- .. autoapisummary:: pysiral.l1preproc.psrlcfg pysiral.l1preproc.SHOW_DEBUG_MAP pysiral.l1preproc.L1P_HEMISPHERE_NAMING_DICT pysiral.l1preproc.L1PInputCLS pysiral.l1preproc.L1PPROC_CLS_TYPE Classes ------- .. autoapisummary:: pysiral.l1preproc.StopWatch pysiral.l1preproc.ProgressIndicator pysiral.l1preproc.AttrDict pysiral.l1preproc.DefaultLoggingClass pysiral.l1preproc.ErrorStatus pysiral.l1preproc.Hemispheres pysiral.l1preproc.L1bDataNC pysiral.l1preproc.L1bMetaData pysiral.l1preproc.Level1bData pysiral.l1preproc.L1PProcItemDef pysiral.l1preproc.Level1PInputHandlerBase pysiral.l1preproc.Level1POutputHandler pysiral.l1preproc.L1PreProcBase pysiral.l1preproc.L1PreProcCustomOrbitSegment pysiral.l1preproc.L1PreProcHalfOrbit pysiral.l1preproc.L1PreProcFullOrbit pysiral.l1preproc.L1PreProcPolarOceanCheck pysiral.l1preproc.Level1PreProcJobDef Functions --------- .. autoapisummary:: pysiral.l1preproc.get_yaml_config pysiral.l1preproc.get_first_array_index pysiral.l1preproc.get_last_array_index pysiral.l1preproc.rle pysiral.l1preproc.get_preproc pysiral.l1preproc.l1p_debug_map Package Contents ---------------- .. py:data:: psrlcfg .. py:class:: StopWatch Bases: :py:obj:`object` .. py:attribute:: t0 :value: None .. py:attribute:: t1 :value: None .. py:method:: reset() .. py:method:: start() .. py:method:: stop() .. py:method:: get_seconds() .. py:method:: get_duration(fmt='%H:%M:%S') .. py:function:: get_yaml_config(filename: Union[str, pathlib.Path], output: str = 'attrdict') -> Union[Dict, pysiral.core.legacy_classes.AttrDict] Parses the contents of a configuration file in .yaml format and returns the content in various formats :param filename: The full file path of the config file :param output: Dict or AttrDict (depends on `output` keyword) :return: .. py:class:: ProgressIndicator(n_steps) Bases: :py:obj:`object` .. py:attribute:: n_steps .. py:attribute:: index :value: None .. py:method:: reset() .. py:method:: get_status_report(i, fmt='{step} of {n_steps} ({percent:.2f}%)') .. py:property:: step .. py:property:: percent .. py:function:: get_first_array_index(array, value) Get the index in array of the first occurance of ``value`` .. py:function:: get_last_array_index(array, value) Get the index in array of the last occurance of ``value`` .. py:function:: rle(inarray) run length encoding. Partial credit to R rle function. Multi datatype arrays catered for including non Numpy returns: tuple (runlengths, startpositions, values) from: http://stackoverflow.com/questions/1066758/find-length-of-sequences- of-identical-values-in-a-numpy-array .. py:class:: AttrDict(dict=None, /, **kwargs) Bases: :py:obj:`collections.UserDict` Short implementation of attrdict.AttrDict using UserDict. The code is based on the solutions shared here https://stackoverflow.com/a/76231823 and has been modified to allow nested AttrDict instances. .. py:method:: __getattr__(key) .. py:method:: __setattr__(key, value) .. py:class:: DefaultLoggingClass(cls_name=None) Bases: :py:obj:`object` Template for default pysiral class with logging/error handling capabilities .. py:attribute:: error .. py:attribute:: log .. py:class:: ErrorStatus(caller_id='') Bases: :py:obj:`object` .. py:attribute:: caller_id :value: '' .. py:attribute:: status :value: False .. py:attribute:: codes :value: [] .. py:attribute:: messages :value: [] .. py:method:: add_error(code, message) Add an error. Error code and messages are arbitrary .. py:method:: raise_on_error() print error messages and exit program on existing error(s) .. py:method:: get_all_messages() .. py:method:: reset() Remove all error messages and set to clean status .. py:property:: message .. py:class:: Hemispheres Bases: :py:obj:`enum.StrEnum` Enum for hemispheres. .. py:attribute:: NORTH :value: 'nh' .. py:attribute:: SOUTH :value: 'sh' .. py:attribute:: GLOBAL :value: 'global' .. py:method:: get_choices() -> List[str] :classmethod: .. py:class:: L1bDataNC Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` Class to export a L1bdata object into a netcdf file NOTE: This class is different from the other netCDF output classes as it uses data groups. .. py:attribute:: datagroups :value: ['waveform', 'surface_type', 'time_orbit', 'classifier', 'correction'] .. py:attribute:: filename :value: None .. py:attribute:: time_def .. py:attribute:: zlib :value: True .. py:attribute:: _rootgrp :value: None .. py:attribute:: _options :value: None .. py:attribute:: _proc_settings :value: None .. py:attribute:: verbose :value: False .. py:attribute:: output_folder :value: None .. py:attribute:: l1b :value: None .. py:attribute:: parameter_attributes :value: [] .. py:method:: export() .. py:method:: _validate() .. py:method:: _create_filename() .. py:method:: _set_global_attributes(attdict, prefix='') Save l1b.info dictionary as global attributes .. py:method:: _create_root_group(attdict, **global_attr_keyw) Create the root group and add l1b metadata as global attributes :param attdict: A dictionary containing the global attributes :param global_attr_keyw: :return: .. py:method:: _populate_data_groups() .. py:method:: _convert_datetime_attributes(attdict) Change any datetime-like object to a netCDF compatible numerical representation :param attdict: dictionary-like :return: .. py:method:: _convert_bool_attributes(attdict) :staticmethod: Replace l1b info parameters of type bool ['b1'] by a integer representation to match requirements for netCDF attribute data type rules :param attdict: dictionary-like :return: .. py:method:: _convert_nonetype_attributes(attdict) :staticmethod: Change empty (None) values in an attrdict to an empty string :param attdict: dictionary like :return: None, will be changed in place .. py:method:: _get_variable_attr_dict(parameter) Retrieve the parameter attributes .. py:method:: _open_file() .. py:method:: _write_to_file() .. py:class:: L1bMetaData Bases: :py:obj:`object` Container for L1B Metadata information (see property attribute_list for a list of attributes) .. py:attribute:: _attribute_list :value: ['pysiral_version', 'mission', 'mission_data_version', 'mission_sensor', 'mission_data_source',... .. py:attribute:: _attrs .. py:method:: __repr__() .. py:method:: __getattr__(item) Modify the attribute getter to provide a shortcut to the data content :param item: Name of the parameter :return: .. py:property:: attribute_list .. py:property:: attdict Return attributes as dictionary (e.g. for netCDF export) .. py:property:: hemisphere .. py:property:: year .. py:property:: month .. py:method:: set_attribute(tag, value) .. py:method:: check_n_records(n_records: int) -> None First time a data set is set: Store number of records as reference :param n_records: Number of records :return: None :raises: ValueError .. py:class:: Level1bData Bases: :py:obj:`object` Unified L1b Data Class .. py:attribute:: data_groups :value: ['time_orbit', 'correction', 'classifier', 'waveform', 'surface_type'] .. py:attribute:: info .. py:attribute:: waveform .. py:attribute:: time_orbit .. py:attribute:: correction .. py:attribute:: classifier .. py:attribute:: surface_type .. py:method:: append(l1b_annex: Level1bData, remove_overlap: bool = False, warn_if_temporal_offset_seconds: int = 10, raise_on_error: bool = False) -> None Appends another l1b object to this one. The `l1b_annex` object is expected to have data after the self instance. :param l1b_annex: The Level-1B dataset to be appended :param remove_overlap: Trim the appending L1 object in case of temporal overlap :param warn_if_temporal_offset_seconds: :param raise_on_error: Raise an exception if the appending process fails, otherwise an error is logged and the appending is skipped :return: None, current L1 object is changed in-place .. py:method:: trim_to_subset(subset_list: Union[List, numpy.typing.NDArray]) -> None Create a subset from an index list .. py:method:: apply_range_correction(correction) Apply range correction .. py:method:: extract_subset(subset_list) Same as trim_to_subset, except returns a new l1bdata instance .. py:method:: extract_region_of_interest(roi) Extracts data for a given region of interest definition .. py:method:: detect_and_fill_gaps(gap_tolerance=0.02) Some radar altimeter input products are not provided with a regular time/sample spacing, e.g. by omitting short sections of the along-track data. This method is supposed to rectify that by 1. Compute the nominal data repitition rate (in seconds) 2. Detect gaps in the timestamp value 3. Fills all arrays in all data groups with empty values (no interpolation) .. py:method:: update_l1b_metadata() .. py:method:: update_data_limit_attributes() Set latitude/longitude and timestamp limits in the metadata container .. py:method:: update_waveform_statistics() Compute waveform metadata attributes .. py:method:: update_surface_type_statistics() Re-calculate the open ocean percent .. py:method:: update_region_name() Estimate the region (north/south/global) for metatdata class .. py:method:: reduce_waveform_bin_count(target_count: int, maxloc: float = 0.4) -> None Reduce the bin count of waveform power and range arrays. (e.g. for merging CryoSat-2 SAR [256 bins] and SIN [1024 bins]) Creates a subset and updates the l1b.waveform container :param target_count: target number of waveform bins (needs to be smaller than full waveform bin count) :param maxloc: preferred location of the maximum of the waveform in the subset :raises None: :return: None .. py:method:: increase_waveform_bin_count(target_count: int) -> None Increase the bin count of waveform power and range arrays. (e.g. for merging CryoSat-2 LRM [128 bins] and SAR [256 bins]) Creates a subset and updates the l1b.waveform container :param target_count: target number of waveform bins (needs to be bigger than full waveform bin count) :raises None: :return: None .. py:method:: get_parameter_by_name(data_group: str, parameter_name: str) -> Union[None, numpy.ndarray] API method to retrieve any parameter from any data group :param data_group: :param parameter_name: :return: .. py:method:: set_parameter_by_name(data_group_name: str, parameter_name: str, value: numpy.ndarray) -> None API method to set any parameter in any data group .. py:property:: n_records :type: int .. py:property:: tcs :type: datetime.datetime .. py:property:: tce :type: datetime.datetime .. py:property:: radar_modes .. py:class:: L1PProcItemDef(label: str, stage: str, module_name: str, class_name: str, options_dict: dict = None) Bases: :py:obj:`object` Class for validating and processing Level-1 Pre-Processor item definition .. py:attribute:: label .. py:attribute:: stage .. py:attribute:: module_name .. py:attribute:: class_name .. py:attribute:: option_dict .. py:method:: from_l1procdef_dict(procdef_dict: Union[dict, pysiral.core.legacy_classes.AttrDict]) -> L1PProcItemDef :classmethod: Initialize the class from the corresponding excerpt of the Level-1 processor configuration file. :param procdef_dict: :return: .. py:method:: get_initialized_processing_item_instance() -> L1PPROCITEM_CLS_TYPE Return an inialized instance of the processor item described by this configuration class :return: descendent of L1PProcItem .. py:property:: valid_stages .. py:data:: SHOW_DEBUG_MAP :value: False .. py:data:: L1P_HEMISPHERE_NAMING_DICT .. py:class:: Level1PInputHandlerBase(cfg: pysiral.core.legacy_classes.AttrDict, raise_on_error: bool = False, cls_name: str = None) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` Base class (mostly for type checking). .. py:attribute:: error .. py:attribute:: cfg .. py:attribute:: raise_on_error :value: False .. py:method:: get_l1(filepath: pathlib.Path, **kwargs) -> Union[None, pysiral.l1data.Level1bData] :abstractmethod: This method needs to be overwritten by inherting class. :param filepath: :return: .. py:class:: Level1POutputHandler(cfg: pysiral.core.legacy_classes.AttrDict) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` The output handler for l1p product files NOTE: This is not a subclass of OutputHandlerbase due to the special nature of pysiral l1p products .. py:attribute:: error .. py:attribute:: cfg .. py:attribute:: pysiral_cfg .. py:attribute:: _path :value: None .. py:attribute:: _filename :value: None .. py:method:: remove_old_if_applicable(perid: dateperiods.DatePeriod) -> None :staticmethod: .. py:method:: export_to_netcdf(l1: pysiral.l1data.Level1bData) -> None Workflow to export a Level-1 object to l1p netCDF product. The workflow includes the generation of the output path (if applicable). :param l1: The Level-1 object to be exported :return: None .. py:method:: set_output_filepath(l1: pysiral.l1data.Level1bData) -> None Sets the class properties required for the file export :param l1: The Level-1 object :return: None .. py:property:: path :type: pathlib.Path .. py:property:: filename :type: str .. py:property:: last_written_file :type: pathlib.Path .. py:data:: L1PInputCLS .. py:class:: L1PreProcBase(cls_name: str, input_adapter: L1PInputCLS, output_handler: Level1POutputHandler, cfg: pysiral.core.legacy_classes.AttrDict) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` Template for default pysiral class with logging/error handling capabilities .. py:attribute:: error .. py:attribute:: input_adapter .. py:attribute:: output_handler .. py:attribute:: cfg .. py:attribute:: processor_item_dict .. py:method:: _init_processor_items() -> None Popuplate the processor item dictionary with initialized processor item classes for the different stages of the Level-1 pre-processor. This method will evaluate the configuration dictionary passed to this class, retrieve the corresponding classes, initialize them and store in a dictionary. Dictionary entries are the names of the processing stages and the content is a list of classes (cls, label) per processing stage. :return: .. py:method:: process_input_files(input_file_list: List[Union[pathlib.Path, str]]) -> None Main entry point for the Level-1 pre-processor and start of the main loop of this class: 1. Sequentially reads source file from input list of source files 2. Applies processing items (stage: `post_source_file`) 3. Extract polar ocean segments (can be multiple per source file) 4. Applies processing items (stage: `post_polar_ocean_segment_extraction`) 5. Creates a stack of spatially connecting segments a. if this includes all segments of the source file the loop progresses to the next source file b. if the stack contains a spatially unconnected segments 1. merge all connected segments to a single l1 object 2. Applies processing items (stage: `post_merge`) 3. Export to l1p netCDF 6. Export the last l1p segment at the end of the loop. :param input_file_list: A list full filepath for the pre-processor :return: None .. py:method:: extract_polar_ocean_segments(l1: pysiral.l1data.Level1bData) -> List[pysiral.l1data.Level1bData] :abstractmethod: Needs to be implemented by child classes, because the exact algorithm depends on th source data. :param l1: :return: None :raises: NotImplementedError .. py:method:: l1_apply_processor_items(l1: Union[pysiral.l1data.Level1bData, List[pysiral.l1data.Level1bData]], stage_name: str) -> None Apply the processor items defined in the l1 processor configuration file to either a l1 data object or a list of l2 data objects at a defined stage of the procesor. This method is a wrapper that deals with multiple input types. The functionality is implemented in `_l1_apply_proc_item` :param l1: Level-1 data object or list of Level-1 data objects :param stage_name: Name of the processing stage. Valid options are (`post_source_file`, `post_ocean_segment_extraction`, `post_merge`) :return: None, the l1_segments are changed in place .. py:method:: _l1_apply_proc_item_list(l1_list: List[pysiral.l1data.Level1bData], stage_name: str) -> None Apply processor item to full stack :param l1_list: :param stage_name: :return: .. py:method:: _l1_apply_proc_item(l1_item: pysiral.l1data.Level1bData, stage_name: str) -> None Apply a list of :param l1_item: :param stage_name: :return: .. py:method:: l1_get_output_segments(l1_connected_stack: List[pysiral.l1data.Level1bData], l1_po_segments: List[pysiral.l1data.Level1bData]) -> Tuple[List[pysiral.l1data.Level1bData], List[pysiral.l1data.Level1bData]] This method sorts the stack of connected l1 segments and the polar ocean segments of the most recent file and sorts the segments into (connected) output and the new stack, defined by the last (connected) item. :param l1_connected_stack: List of connected L1 polar ocean segments (from previous file(s)) :param l1_po_segments: List of L1 polar ocean segments (from current file) :return: L1 segments for the ouput, New l1 stack of connected items .. py:method:: l1_split_radar_mode_segments(l1_list: List[pysiral.l1data.Level1bData]) -> List[pysiral.l1data.Level1bData] :staticmethod: This method checks if there is more than one radar mode per l1 segment and splits the segments for each radar mode change. This is done, because multiple radar modes per segment may be problematic for Level-1 pre-processor items. The final l1p output file may contain multiple radar modes. NOTE: So far this is only needed for the Sentinel-3A/B L2 thematic sea ice product. No other files have been found so far that have more than one radar mode. :param l1_list: Input list of l1 segments. :return: l1_output_list: Output list of l1 segments with single radar mode .. py:method:: l1_are_connected(l1_0: pysiral.l1data.Level1bData, l1_1: pysiral.l1data.Level1bData) -> bool Check if the start time of l1 segment 1 and the stop time of l1 segment 0 indicate neighbouring orbit segments. -> Assumes explicetly that l1_0 comes before l1_1 :param l1_0: :param l1_1: :return: Flag if l1 segments are connected (True of False) .. py:method:: l1_export_to_netcdf(l1: pysiral.l1data.Level1bData) -> None Exports the Level-1 object as l1p netCDF :param l1: The Level-1 object to exported :return: .. py:method:: trim_single_hemisphere_segment_to_polar_region(l1: pysiral.l1data.Level1bData) -> pysiral.l1data.Level1bData Extract polar region of interest from a segment that is either north or south (not global) :param l1: Input Level-1 object :return: Trimmed Input Level-1 object .. py:method:: trim_two_hemisphere_segment_to_polar_regions(l1: pysiral.l1data.Level1bData) -> Union[None, List[pysiral.l1data.Level1bData]] Extract polar regions of interest from a segment that is either north, south or both. The method will preserve the order of the hemispheres :param l1: Input Level-1 object :return: List of Trimmed Input Level-1 objects .. py:method:: trim_multiple_hemisphere_segment_to_polar_regions(l1: pysiral.l1data.Level1bData) -> Union[None, List[pysiral.l1data.Level1bData]] Extract polar regions segments from an orbit segment that may cross from north to south to north again (or vice versa). :param l1: Input Level-1 object :return: List of Trimmed Input Level-1 objects .. py:method:: trim_full_orbit_segment_to_polar_regions(l1: pysiral.l1data.Level1bData) -> Union[None, List[pysiral.l1data.Level1bData]] Extract polar regions of interest from a segment that is either north, south or both. The method will preserve the order of the hemispheres :param l1: Input Level-1 object :return: List of Trimmed Input Level-1 objects .. py:method:: filter_small_ocean_segments(l1: pysiral.l1data.Level1bData) -> pysiral.l1data.Level1bData This method sets the surface type flag of very small ocean segments to land. This action should prevent large portions of land staying in the l1 segment is a small fjord et cetera is crossed. It should also filter out smaller ocean segments that do not have a realistic chance of freeboard retrieval. :param l1: A pysiral.l1bdata.Level1bData instance :return: filtered l1 object .. py:method:: trim_non_ocean_data(l1: pysiral.l1data.Level1bData) -> Union[None, pysiral.l1data.Level1bData] :staticmethod: Remove leading and trailing data that is not if type ocean. :param l1: The input Level-1 objects :return: The subsetted Level-1 objects. (Segments with no ocean data are removed from the list) .. py:method:: split_at_large_non_ocean_segments(l1: pysiral.l1data.Level1bData) -> List[pysiral.l1data.Level1bData] Identify larger segments that are not ocean (land, land ice) and split the segments if necessary. The return value will always be a list of Level-1 object instances, even if no non-ocean data segment is present in the input data file :param l1: Input Level-1 object :return: a list of Level-1 objects. .. py:method:: split_at_time_discontinuities(l1_list: List[pysiral.l1data.Level1bData]) -> List[pysiral.l1data.Level1bData] Split l1 object(s) at discontinuities of the timestamp value and return the expanded list with l1 segments. :param l1_list: [list] a list of l1b_files :return: expanded list .. py:property:: polar_ocean_props :type: Union[Dict, pysiral.core.legacy_classes.AttrDict] .. py:property:: orbit_segment_connectivity_props :type: Union[Dict, pysiral.core.legacy_classes.AttrDict] .. py:class:: L1PreProcCustomOrbitSegment(*args) Bases: :py:obj:`L1PreProcBase` A Pre-Processor for input files with arbitrary segment lenght (e.g. CryoSat-2) .. py:method:: extract_polar_ocean_segments(l1: pysiral.l1data.Level1bData) -> List[pysiral.l1data.Level1bData] Splits the input Level-1 object into the polar ocean segments (e.g. by trimming land at the edges or by splitting into several parts if there are land masses with the orbit segment). The returned polar ocean segments should be generally free of data over non-ocean parts of the orbit, except for smaller parts within the orbit. NOTE: This subclass of the Level-1 Pre-Processor is designed for input data type with arbitrary orbit segment length (e.g. data of CryoSat-2 where the orbit segments of the input data is controlled by the mode mask changes). :param l1: A Level-1 data object :return: A list of Level-1 data objects (subsets of polar ocean segments from input l1) .. py:class:: L1PreProcHalfOrbit(*args) Bases: :py:obj:`L1PreProcBase` A Pre-Processor for input files with a full orbit around the earth (e.g. ERS-1/2) .. py:method:: extract_polar_ocean_segments(l1: pysiral.l1data.Level1bData) -> List[pysiral.l1data.Level1bData] Splits the input Level-1 object into the polar ocean segments (e.g. by trimming land at the edges or by splitting into several parts if there are land masses with the orbit segment). The returned polar ocean segments should be generally free of data over non-ocean parts of the orbit, except for smaller parts within the orbit. NOTE: This subclass of the Level-1 Pre-Processor is designed for input data type with coverage from pole to pole (e.g. Envisat SGDR) :param l1: A Level-1 data object :return: A list of Level-1 data objects (subsets of polar ocean segments from input l1) .. py:class:: L1PreProcFullOrbit(*args) Bases: :py:obj:`L1PreProcBase` A Pre-Processor for input files with a full orbit around the earth (e.g. ERS-1/2) .. py:method:: extract_polar_ocean_segments(l1: pysiral.l1data.Level1bData) -> List[pysiral.l1data.Level1bData] Splits the input Level-1 object into the polar ocean segments (e.g. by trimming land at the edges or by splitting into several parts if there are land masses with the orbit segment). The returned polar ocean segments should be generally free of data over non-ocean parts of the orbit, except for smaller parts within the orbit. NOTE: This subclass of the Level-1 Pre-Processor is designed for input data type with arbitrary orbit segment length (e.g. data of CryoSat-2 where the orbit segments of the input data is controlled by the mode mask changes). :param l1: A Level-1 data object :return: A list of Level-1 data objects (subsets of polar ocean segments from input l1) .. py:class:: L1PreProcPolarOceanCheck(log_name: str, cfg: pysiral.core.legacy_classes.AttrDict) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` A small helper class that can be passed to input adapter to check whether the l1 segment is wanted or not .. py:attribute:: error .. py:attribute:: cfg .. py:method:: has_polar_ocean_segments(product_metadata: pysiral.l1data.L1bMetaData) -> bool Checks if there are polar oceans segments based on the metadata of a L1 data object :param product_metadata: Metadata container of the l1b data product. :return: Boolean Flag (true: in region of interest, false: not in region of interest) .. py:class:: Level1PreProcJobDef(l1p_settings_id_or_file: Union[str, pathlib.Path], processing_period: dateperiods.DatePeriod, exclude_month: List[int] = None, hemisphere: pysiral.core.flags.Hemispheres = Hemispheres.GLOBAL, platform: str = None, output_handler_cfg: Union[dict, pysiral.core.legacy_classes.AttrDict] = None, source_repo_id: Optional[str] = None) Bases: :py:obj:`pysiral.core.legacy_classes.DefaultLoggingClass` A class that contains all information necessary for the Level-1 pre-processor. .. py:attribute:: error .. py:attribute:: _l1pprocdef :value: None .. py:attribute:: _hemisphere .. py:attribute:: _platform :value: None .. py:attribute:: _source_repo_id :value: None .. py:attribute:: _exclude_month :value: None .. py:attribute:: _time_range .. py:attribute:: _output_handler_cfg :value: None .. py:attribute:: stopwatch .. py:method:: from_args(args: pysiral.core.legacy_classes.AttrDict) -> Level1PreProcJobDef :classmethod: Init the Processor Definition from the pysiral-l1preproc command line argument object :param args: :return: .. py:method:: _set_l1p_processor_def(l1p_settings_id_or_file: Union[str, pathlib.Path]) -> None Parse the content of the processor definition file :param l1p_settings_id_or_file: A pysiral known id or list :return: .. py:method:: _get_l1p_proc_def_filename(l1p_settings_id_or_file: Union[str, pathlib.Path]) -> Union[str, pathlib.Path] Query pysiral config to obtain filename for processor definition file :param l1p_settings_id_or_file: :return: The full file path .. py:method:: _get_local_input_directory() -> None Replace the tag for local machine def with the actual path info .. py:method:: _check_if_unambiguous_platform() -> None Checks if the platform is unique, since some l1 processor definitions are valid for a series of platforms, such as ERS-1/2, Sentinel-3A/B, etc. The indicator is that the platform tag in the l1 preprocessor settings is comma separated list. For the location of the source data, it is however necessary that the exact platform is known. It must therefore be specified explicitly by the -platform argument :raises SysExit: .. py:property:: hemisphere :type: str .. py:property:: target_hemisphere :type: List[str] Get the list of target hemisphere names for the l1p processor definition. `Global` here refers to both polar regions, with the latitude range defined by the `polar_latitude_threshold` option in the l1p processor definition. :return: List of hemisphere names for the l1p processor definition .. py:property:: l1pprocdef :type: pysiral.core.legacy_classes.AttrDict .. py:property:: time_range :type: dateperiods.DatePeriod .. py:property:: period_segments :type: dateperiods.PeriodIterator .. py:property:: output_handler_cfg :type: pysiral.core.legacy_classes.AttrDict .. py:property:: platform :type: str .. py:data:: L1PPROC_CLS_TYPE .. py:function:: get_preproc(preproc_type: str, input_adapter: L1PInputCLS, output_handler: Level1POutputHandler, cfg: pysiral.core.legacy_classes.AttrDict) -> L1PPROC_CLS_TYPE A function returning the pre-processor class corresponding the type definition. :param preproc_type: type of the pre-processor :param input_adapter: A class that return a L1bData object for a given input product file :param output_handler: A class that creates a pysiral l1p product from the merged L1bData object :param cfg: options for the pre-processor :return: Initialized pre-processor class .. py:function:: l1p_debug_map(l1p_list: List[pysiral.l1data.Level1bData], title: str = None) -> None Create an interactive map of l1p segment :param l1p_list: :param title: :return: