Distribution Statement
# # # This source code is subject to the license referenced at

Filename Formatters in GeoIPS#

A filename formatter is a class-based GeoIPS plugin that defines how an output file is named. Filename formatters generally produce a unique filename based on the metadata of the xarray dataset, but this plugin type is flexible. The output of this plugin is a string, so it can be formatted however the user desires.

For a simple example of a filename formatter, see the basic filename formatter.

A more advanced example is the standard GeoIPS filename formatter.

Filename formatters can be applied in two ways:

1. Specification at the Command Line: Filename formatters are specified as arguments at the command line. For example:

--filename_formatter geoips_fname

For an example of calling a filename formatter from a test script, see the ABI Infrared test script.

2. Direct Invocation: If you have your own output formatter, the filename formatter can be called directly:

from geoips.interfaces import filename_formatters
fname_fmt = "geoips_fname"
output_filename = filename_formatters.get_plugin(fname_fmt)

The output of the plugin can then be used when saving the file.

Plugin arguments#

The arguments accepted by a filename formatter step (validated in Order-Based Processing workflows) are defined by the model below. These fields are generated directly from the code, so they always reflect the current validation rules.

pydantic model geoips.pydantic_models.v1.filename_formatters.FilenameFormatterArgumentsModel[source]

Filename-Formatter step argument definition.

Pydantic model defining and validating Filename Formatter step arguments.

Fields:
Validators:

field area_def: AreaDefinition | None = None

Spatial domain to process.

field basedir: str = 'plugin_provided'

Full path to base directory of final product

field coverage: float | None = None

Image coverage, float between 0.0 and 100.0

Constraints:
  • ge = 0.0

  • le = 100.0

field extension: str = None

Extension of filename

field extra: str | None = None

String to include in filename ‘extra’ field If None, use fillval of ‘x’

field metadata_dir: str = 'metadata'
field metadata_type: str = 'sector_information'
field output_dict: dict[str, Any] | None = None
field output_type: str = 'plugin_provided'

Requested output format, ie png, jpg, tif, etc, defaults to None

field output_type_dir: str = None

If None, default to output_type.

field product_dir: str = None
field product_filename: str | None = None
field product_subdir: str = None
field source_dir: str = None