pysiral.scripts.parser_items ============================ .. py:module:: pysiral.scripts.parser_items .. autoapi-nested-parse:: This module defines default command line arguments for pysiral scripts. Attributes ---------- .. autoapisummary:: pysiral.scripts.parser_items.__author__ Classes ------- .. autoapisummary:: pysiral.scripts.parser_items.ArgparseArgumentsArgs pysiral.scripts.parser_items.PlatformID pysiral.scripts.parser_items.ProcessingPeriod pysiral.scripts.parser_items.Hemisphere pysiral.scripts.parser_items.Duration pysiral.scripts.parser_items.ProductProcessingLevel pysiral.scripts.parser_items.DataRecord pysiral.scripts.parser_items.ExcludeMonths pysiral.scripts.parser_items.InputVersion pysiral.scripts.parser_items.SourceDatasetID pysiral.scripts.parser_items.L1PFile pysiral.scripts.parser_items.L1PSettings pysiral.scripts.parser_items.L2Settings pysiral.scripts.parser_items.L3Settings pysiral.scripts.parser_items.L2Outputs pysiral.scripts.parser_items.L2POutputs pysiral.scripts.parser_items.L3Outputs pysiral.scripts.parser_items.MultiProcesssingNumCores pysiral.scripts.parser_items.UseMultiProcesssing pysiral.scripts.parser_items.ForceL2DefRecordType pysiral.scripts.parser_items.L1PFiles pysiral.scripts.parser_items.L2iDirectory pysiral.scripts.parser_items.L3Directory pysiral.scripts.parser_items.L3Grid pysiral.scripts.parser_items.DOI pysiral.scripts.parser_items.DefaultCommandLineArguments Module Contents --------------- .. py:data:: __author__ :value: 'Stefan Hendricks ' .. py:class:: ArgparseArgumentsArgs .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: [] .. py:attribute:: action :type: Union[str, Callable, None] :value: None .. py:attribute:: nargs :type: Optional[str] :value: None .. py:attribute:: const :type: Union[str, int, None] :value: None .. py:attribute:: default :type: Any :value: None .. py:attribute:: type :type: Optional[Callable] :value: None .. py:attribute:: choices :type: List[Any] | None :value: None .. py:attribute:: required :type: Optional[bool] :value: None .. py:attribute:: help :type: str :value: None .. py:attribute:: metavar :type: Optional[str] :value: None .. py:attribute:: dest :type: str :value: None .. py:method:: get() -> Tuple[List[str], dict[str, Any]] Returns the input arguments and keyword arguments to `parser.add_argument()` :return: A tuple containing a list of argument names or flags and a ictionary of keyword arguments .. py:method:: as_positional(argument_name: str) -> ArgparseArgumentsArgs Redefines the argument to be a positional argument :param argument_name: The argparse parser to add the argument to. .. py:class:: PlatformID Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-p', '--platform'] .. py:attribute:: action :type: str :value: 'store' .. py:attribute:: dest :type: str :value: 'platform' .. py:attribute:: type :type: Callable .. py:attribute:: choices :type: List[Any] .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Radar altimeter platform id as defined in pysiral (see `pysiral info --platforms`). This option is required only if the processor configuration file is applicable to multiple platforms (e.g. sentinel3a, sentinel3b, etc.). If the processor configuration file is platform-specific, this option has no effect. """ .. raw:: html
.. py:class:: ProcessingPeriod Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['processing_period'] .. py:attribute:: action :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Period definition for processing, given as a string in the format "YYYY-MM[-DD][:YYYY-MM[-DD]]". If only one date is given, it will be interpreted as a period (e.g., "2023-01" for January 2023 and ("2023-01-01" for one day). If two colon-separated dates are given, they will be interpreted as a start and end date or month. """ .. raw:: html
.. py:class:: Hemisphere Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-H', '--hemisphere'] .. py:attribute:: action :type: str :value: 'store' .. py:attribute:: dest :type: str :value: 'hemisphere' .. py:attribute:: default :type: Any .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: choices :type: List[Any] .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Target hemisphere for processing. Options are 'global', 'nh', or 'sh'. """ .. raw:: html
.. py:class:: Duration Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-d', '--duration'] .. py:attribute:: action :type: str :value: 'store' .. py:attribute:: dest :type: str :value: 'duration' .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: choices :type: List[Any] .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Duration type for splitting the processing period into segments. Options are 'daily', 'isoweekly', or 'monthly' and will be passed `dateperiod.Dateperiod().get_segments()`. If left empty, the duration type will be inferred from the processing period definition. """ .. raw:: html
.. py:class:: ProductProcessingLevel Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-p', '--processing-level'] .. py:attribute:: dest :type: str :value: 'processing_level' .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: choices :type: List[Any] .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Target processing level. Setting this argument will overwrite any processing levels defined in the input data or processor definition. Valid processing levels are: []""" .. raw:: html
.. py:class:: DataRecord Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-D', '--data-record'] .. py:attribute:: dest :type: str :value: 'data_record' .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: choices :type: List[Any] .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Target data record. Setting this argument will overwrite any value defined in the input data or processor definition. Valid data records are: []""" .. raw:: html
.. py:class:: ExcludeMonths Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-E', '--exclude-months'] .. py:attribute:: nargs :type: str :value: '+' .. py:attribute:: type :type: Callable .. py:attribute:: dest :type: str :value: 'exclude_months' .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: 'List of months to be excluded from processing, given as integers (1-12).' .. py:class:: InputVersion Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-v', '--input-version'] .. py:attribute:: action :type: str :value: 'store' .. py:attribute:: dest :type: str :value: 'input_version' .. py:attribute:: default :type: Any :value: 'default' .. py:attribute:: metavar :type: str :value: 'v{minor}p{major}|default' .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Input version name (e.g., v1p0, v2p1, or 'default'). This is used to identify the version of the input data. """ .. raw:: html
.. py:class:: SourceDatasetID Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-s', '--source-dataset-id'] .. py:attribute:: action :type: str :value: 'store' .. py:attribute:: dest :type: str :value: 'source_dataset_id' .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier of the source dataset to be used for processing, summarizing the platform, version, and timeliness information. The source dataset ID must be specified in the local machine definition file ({pysiral-cfg-location}/local_machine_def.yaml, e.g. `root.l1b_repository..`) """ .. raw:: html
.. py:class:: L1PFile Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['l1p_file'] .. py:attribute:: type :type: Callable .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Path to Level-1 Pre-Processed (l1p) input file for the Level-2 processor. """ .. raw:: html
.. py:class:: L1PSettings Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['l1p_settings'] .. py:attribute:: type :type: Callable .. py:attribute:: action :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier or file path to the Level-1 Pre-Processor definition file. This file contains the settings for the Level-1 processor. The default location for these files is `{pysiral-cfg-location}/proc/l1/`. The identifier is the filename without the `.yaml` extension. E.g.`cryosat2_pds_ipf1e_v1p2` will be resolved to `{pysiral-cfg-location}/proc/l1/cryosat2_pds_ipf1e_v1p2.yaml`. """ .. raw:: html
.. py:class:: L2Settings Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['l2_settings'] .. py:attribute:: type :type: Callable .. py:attribute:: action :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier or file path to the Level-2 Processor definition file. This file contains the settings for the Level-2 processor. The default location for these files is `{pysiral-cfg-location}/proc/l2/`. The identifier is the filename without the `.yaml` extension. E.g.`awi_cryosat2_nh_v2p6_rep` will be resolved to `{pysiral-cfg-location}/proc/l2/awi/v2p6/awi_cryosat2_nh_v2p6_rep.yaml`. """ .. raw:: html
.. py:class:: L3Settings Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['l3_settings'] .. py:attribute:: action :type: Callable .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier or file path to the Level-3 Processor definition file. This file contains the settings for the Level-2 processor. The default location for these files is `{pysiral-cfg-location}/proc/l3/`. The identifier is the filename without the `.yaml` extension. E.g.`l3c_cci_v4p0` will be resolved to `{pysiral-cfg-location}/proc/l3/cci/l3c_cci_v4p0.yaml`. """ .. raw:: html
.. py:class:: L2Outputs Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-o', '--l2-output'] .. py:attribute:: nargs :type: str :value: '+' .. py:attribute:: dest :type: str :value: 'l2_outputs' .. py:attribute:: action :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier or file path of one ore several Level-2 output definition files. Each file contains the output definition for the l2/l2i dataformat. The default location for these files is `{pysiral-cfg-location}/output/l2/`. The identifier is the filename without the `.yaml` extension. E.g.`l2i_cci_v4p0` will be resolved to `{pysiral-cfg-location}/output/l2i/cci/l2i_cci_v4p0.yaml`. """ .. raw:: html
.. py:class:: L2POutputs Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-o', '--l2p-output'] .. py:attribute:: action :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier or file path of one Level-2 output definition file. Each file contains the output definition for the l2/l2i dataformat. The default location for these files is `{pysiral-cfg-location}/output/l2/`. The identifier is the filename without the `.yaml` extension. E.g.`l2i_cci_v4p0` will be resolved to `{pysiral-cfg-location}/output/l2i/cci/l2i_cci_v4p0.yaml`. """ .. raw:: html
.. py:class:: L3Outputs Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-o', '--l3-output'] .. py:attribute:: nargs :type: str :value: '+' .. py:attribute:: type :type: Callable .. py:attribute:: action :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Identifier or file path of one or several Level-3 output definition files. Each file contains the output definition for the l3 dataformat. The default location for these files is `{pysiral-cfg-location}/output/l3/`. The identifier is the filename without the `.yaml` extension. E.g.`l3c_cci_v4p0` will be resolved to `{pysiral-cfg-location}/output/l3/cci/l3c_cci_v4p0.yaml`. """ .. raw:: html
.. py:class:: MultiProcesssingNumCores Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-m', '--multiprocessing-num-cores'] .. py:attribute:: dest :type: str :value: 'multiprocessing_num_cores' .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: default :type: Any :value: None .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Set the number of CPU cores to be used for multiprocessing. If not set, the default value (derived from `multiprocessing.cpu_count()`) will be used. NOTE: In some managed environments, the default value is not reliable, which may lead to performance issues. In this case, it is recommended to set this value manually to the known number of available CPU cores. """ .. raw:: html
.. py:class:: UseMultiProcesssing Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['--multiprocessing'] .. py:attribute:: dest :type: str :value: 'use_multiprocessing' .. py:attribute:: action :type: Any .. py:attribute:: default :type: Any :value: True .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Flag to allow disabling multiprocessing. If set, the processor will run in single-threaded mode. Default is True, meaning multiprocessing is enabled. (also see option -m/--multiprocessing-num-cores) """ .. raw:: html
.. py:class:: ForceL2DefRecordType Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['--force-l2def-record-type'] .. py:attribute:: dest :type: str :value: 'force_l2def_record_type' .. py:attribute:: default :type: Any :value: False .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ By default, the Level-2 processor will use the record_type defined in the l1p input files. If this flag is set, the processor will use the record_type defined in the Level-2 definition file (l2def) instead. This is useful if the l1p input files are not consistent with the l2def record_type, e.g. in case of metadata errors or if data from another timeliness is to be used for filling gaps. This flag should only be set in special cases. """ .. raw:: html
.. py:class:: L1PFiles Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['l1p_files'] .. py:attribute:: nargs :type: str :value: '+' .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Target Level-1P (l1p) file(s) to be processed by the Level-2 processor. """ .. raw:: html
.. py:class:: L2iDirectory Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-i', '--l2i-product-dir', '--l2-product-dir'] .. py:attribute:: nargs :type: Optional[str] :value: '+' .. py:attribute:: dest :type: str :value: 'l2_product_directory' .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Target Level-2i (l2i) product directory where the Level-2 output files will be written. The l2i files need to be organized in `yyyy/mm/` subdirectory structure. """ .. raw:: html
.. py:class:: L3Directory Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['-O', '--l3-product-directory'] .. py:attribute:: dest :type: str :value: 'l3_product_directory' .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Target Level-3 product directory where the Level-3 output files will be written. The last sub-directory must be a valid Level-3 processing level code [l3c|l3s]. If not given, the directory will be inferred from the l2 input directory. """ .. raw:: html
.. py:class:: L3Grid Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['l3_grid_id'] .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ The grid definition id for the Level-3 processor. Valid grid ids are: []""" .. raw:: html
.. py:class:: DOI Bases: :py:obj:`ArgparseArgumentsArgs` .. py:attribute:: name_or_flags :type: ClassVar[list[str]] :value: ['--doi'] .. py:attribute:: type :type: Callable .. py:attribute:: metavar :type: str :value: '' .. py:attribute:: help :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ The DOI (Digital Object Identifier) to be written in the global attributes of the product files. """ .. raw:: html
.. py:class:: DefaultCommandLineArguments Bases: :py:obj:`object` .. py:attribute:: _args .. py:method:: get_argparse_dict(name, destination, required)