pysiral.scripts =============== .. py:module:: pysiral.scripts .. autoapi-nested-parse:: Main entry point for pysiral console scripts. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pysiral/scripts/__main__/index /autoapi/pysiral/scripts/_argparse_actions/index /autoapi/pysiral/scripts/_argparse_types/index /autoapi/pysiral/scripts/config/index /autoapi/pysiral/scripts/info/index /autoapi/pysiral/scripts/l1preproc/index /autoapi/pysiral/scripts/l2preproc/index /autoapi/pysiral/scripts/l2proc/index /autoapi/pysiral/scripts/l2procfiles/index /autoapi/pysiral/scripts/l3proc/index /autoapi/pysiral/scripts/parser_items/index Attributes ---------- .. autoapisummary:: pysiral.scripts.__author__ Classes ------- .. autoapisummary:: pysiral.scripts.InfoScriptArguments pysiral.scripts.ConfigScriptArguments pysiral.scripts.L1PreProcScriptArguments pysiral.scripts.L2ProcScriptArguments pysiral.scripts.L2ProcFilesScriptArguments pysiral.scripts.L2PreProcScriptArguments pysiral.scripts.L3ProcScriptArguments Functions --------- .. autoapisummary:: pysiral.scripts.info pysiral.scripts.config pysiral.scripts.l1preproc pysiral.scripts.l2proc pysiral.scripts.l2procfiles pysiral.scripts.l2preproc pysiral.scripts.l3proc pysiral.scripts.main pysiral.scripts.info_cli pysiral.scripts.config_cli pysiral.scripts.l1preproc_cli pysiral.scripts.l2proc_cli pysiral.scripts.l2preproc_cli pysiral.scripts.l3proc_cli Package Contents ---------------- .. py:data:: __author__ :value: 'Stefan Hendricks ' .. py:function:: info(target: str = None, search_string: str = None) -> None Main entry point for the info script. This function provides information about the specified target. :param target: The target to get information about. :param search_string: Optional search string to filter information. .. py:class:: InfoScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-2 Processor. :return: The argument parser object. .. py:function:: config(action: ConfigActions = ConfigActions.INIT, target_or_directory: Optional[Union[pathlib.Path, str]] = None, yes: bool = False) -> None Main entry point for the config script. Can either initialize the pysiral configuration in the default configuration directory or set/update the configuration to a specific directory. :param action: :param target_or_directory: :param yes: :return: None .. py:class:: ConfigScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-2 Processor. :return: The argument parser object. .. py:function:: l1preproc(l1p_settings: Union[str, pathlib.Path] = None, processing_period: dateperiods.DatePeriod = None, exclude_months: Optional[List[int]] = None, hemisphere: str = 'global', platform: str = None, output_handler_cfg: dict = None, source_dataset_id: str = None, use_multiprocessing: bool = False, multiprocessing_num_cores: Optional[int] = None) -> None Workflow script of the pysiral l1b preprocessor. :param l1p_settings: Level-1 preprocessor settings file or ID. :param processing_period: The processing period to run the preprocessor for. :param exclude_months: List of months to exclude from processing (optional). :param hemisphere: Hemisphere to process data for, default is "global". :param platform: Platform identifier (optional). :param output_handler_cfg: Configuration for the output handler (optional). :param source_dataset_id: Identifier for the source repository (optional). :return: None .. py:class:: L1PreProcScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-1 Pre-Processor. :return: The argument parser object. .. py:function:: l2proc(processing_period: dateperiods.DatePeriod = None, l2_settings: Union[str, pathlib.Path] = None, l2_outputs: List[Union[str, pathlib.Path]] = None, exclude_months: List[int] = None, source_dataset_id: str = None, l1p_version: str = None, force_l2def_record_type: bool = False, use_multiprocessing: bool = False, multiprocessing_num_cores: int = None) -> None Main entry point for the Level-2 Processor job. This function initializes the Level-2 processor with the provided settings and processes the Level-1P data files for the specified time range. :param processing_period: Start date for processing in [year, month, [day]] format. :param l2_settings: Path to the Level-2 settings file or its identifier. :param l2_outputs: List of output definitions for Level-2 products. :param exclude_months: List of months to exclude from processing (1-12). :param source_dataset_id: Version of the input data (optional). :param l1p_version: Version of the Level-1P data (optional). :param force_l2def_record_type: If True, forces the use of a specificLevel-2 definition record type. :param use_multiprocessing: If True, enables multiprocessing for the processor. :param multiprocessing_num_cores: Number of CPU cores to use for multiprocessing (optional). .. py:class:: L2ProcScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-2 Processor. :return: The argument parser object. .. py:function:: l2procfiles(l1p_files: list[pathlib.Path] = None, l2_settings: Union[pathlib.Path, str] = None, l2_outputs: list[pathlib.Path] = None, mp_cpu_count: int = None, force_l2def_record_type: bool = False, **_: dict) A more simple Level-2 job with a predefined list of l1b data files :param l1p_files: A list of Level-1P files to process. :param l2_settings: Path to the Level-2 settings file or its identifier. :param l2_outputs: List of output definitions for Level-2 products. :param mp_cpu_count: Number of CPUs to use for multiprocessing (optional). :param force_l2def_record_type: If True, forces the use of a specificLevel-2 definition record type. :param _: :return: .. py:class:: L2ProcFilesScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-2 Processor. :return: The argument parser object. .. py:function:: l2preproc(processing_period: dateperiods.DatePeriod = None, l2i_product_dir: Union[str, pathlib.Path] = None, l2p_outputs: List[Union[str, pathlib.Path]] = None, doi: str = None, exclude_month: List[int] = None) -> None Caller for converting Level-2 Intermediate (l2i) into Level-2 Pre-Processed (l2p) data products. NOTE: At the moment that only means summary of valid freeboard/thickness data points into daily summary files. .. py:class:: L2PreProcScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-2 Processor. :return: The argument parser object. .. py:function:: l3proc(processing_period: dateperiods.DatePeriod = None, l2_product_directory: List[pathlib.Path] = None, l3_product_directory: Union[str, pathlib.Path] = None, l3_settings: Union[str, pathlib.Path] = None, l3_grid_id: str = None, l3_output: List[Union[str, pathlib.Path]] = None, duration: pysiral.core.flags.DurationType = DurationType.P1M, doi: str = None, processing_level: pysiral.core.flags.ProductProcessingLevels = ProductProcessingLevels.LEVEL3_COLLATED, data_record: pysiral.core.flags.DataRecordType = None, exclude_months: List[int] = None) -> None :param processing_period: :param l2_product_directory: :param l3_product_directory: :param l3_settings: :param l3_grid_id: :param l3_output: :param duration: :param doi: :param processing_level: :param data_record: :param exclude_months: List of months to exclude from processing (1-12). If None, no months are excluded. If provided, the months will be filtered out from the processing period. :return: .. py:class:: L3ProcScriptArguments Bases: :py:obj:`object` .. py:attribute:: parser .. py:method:: get(args_list: List[str] = None) -> argparse.Namespace .. py:method:: autocomplete_product_processing_level(l2_product_directory: Union[List[pathlib.Path]]) -> str :staticmethod: Autocomplete the product processing level based on the provided arguments. :param l2_product_directory: The L2 product directory path or multiple thereof. :return: product processing level as a string. .. py:method:: autocomplete_l3_product_directory(l3_product_directory: Union[str, pathlib.Path, None], l2_product_directory: Union[str, pathlib.Path, List[pathlib.Path]], processing_level: str) -> pathlib.Path :staticmethod: Autocomplete the L3 product directory based on the provided arguments. :param l3_product_directory: The L3 product directory path or None if not provided. :param l2_product_directory: The L2 product directory path or multiple thereof. :param processing_level: The target processing level. :return: Updated Level-3 product directory path. .. py:method:: autocomplete_l3_product_duration(duration: Union[str, None], processing_period: dateperiods.DatePeriod) -> str :staticmethod: Autocomplete the L3 product directory based on the provided arguments. :param duration: :param processing_period: :return: Updated arguments namespace with the L3 product directory set (if required) .. py:method:: get_argument_parser() -> argparse.ArgumentParser :staticmethod: Set up the command line argument parser for the Level-2 Processor. :return: The argument parser object. .. py:function:: main() -> None .. py:function:: info_cli(args_list: List = None) -> None Command-line interface entry point for the `pysiral info` script. :param args_list: Command line arguments to be passed to the script. :return: None .. py:function:: config_cli(args_list: List = None) -> None Command-line interface entry point for the `pysiral info` script. :param args_list: Command line arguments to be passed to the script. :return: None .. py:function:: l1preproc_cli(args_list: List = None) -> None Command-line interface entry point for the `pysiral l1preproc` script. :param args_list: Command line arguments to be passed to the script. :return: None .. py:function:: l2proc_cli(args_list: List = None) -> None Command-line interface entry point for the `pysiral l2proc` script. :param args_list: Command line arguments to be passed to the script. :return: None .. py:function:: l2preproc_cli(args_list: List = None) -> None Command-line interface entry point for the `pysiral l2preproc` script. :param args_list: Command line arguments to be passed to the script. :return: None .. py:function:: l3proc_cli(args_list: List = None) -> None Command-line interface entry point for the `pysiral l3proc` script. :param args_list: Command line arguments to be passed to the script. :return: None