Distribution Statement
Output Formatters in GeoIPS#
An output formatter is a class-based GeoIPS plugin designed to output a dataset to a file. This encompasses many varied types of output, including geotiff, netCDF, and imagery. Output formatters vary in complexity depending on the output type.
Examples of output formatter plugins can be found in the list of GeoIPS built-in output formatters.
A tutorial for implementing a new output formatter can be found in the GeoIPS Documentation
Output formatters can be executed in two ways:
1. Specification at the Command Line: Output formatters are specified as arguments at the command line. For example:
--output_formatter imagery_annotated
Direct Invocation: Call the output formatter from within a program:
from geoips.interfaces import output_formatters output_fmt_name = "imagery_annotated" output_formatter = output_formatters.get_plugin(output_fmt_name)
Plugin arguments#
The arguments accepted by a output 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.output_formatters.OutputFormatterArgumentsModel[source]
Output-Formatter step argument definition.
Pydantic model defining and validating Output Formatter step arguments.
- Fields:
- Validators:
- field append: bool = False
When True, open the output file in append mode (‘a’) instead of write mode(‘w’). Automatically forced to True for every dataset beyond the firstwhen multiple datasets are written to the same output file.
- field area_def: AreaDefinition | None = None
The domain over which to read data.
- field basedir: str = 'plugin_provided'
Used to construct relative product paths in metadata output. Originally used to strip the TCWWW root path before replacing it with a public URL; now superseded by replace_geoips_paths() and no longer used across the entire implementation.
- field bg_data: Any | None = None
- field bg_datatype_title: str | None = None
background data type
- field bg_mpl_colors_info: dict[str, Any] | None = None
Matplotlib colormap configuration for the background dataset
- field bg_product_name_title: str | None = None
Title of background product
- field bg_xarray: Any | None = None
- field clean_fname: str | None = None
Output file path for a overlay-free elements such as no background imagery, coastlines, gridlines, title, or colorbar. When None, the clean image is skipped.
- field clobber: bool = False
whether to overwrite the output file even if it exists
- field cog: bool = True
Whether to produce a Cloud-Optimized GeoTIFF with internal overview levels. Currently this has no effect as overview generation is handled automatically by cog_translate() call.
- field existing_image: str | None = None
File path to a pre-rendered image onto which new data would be composited
- field hist_colorbar: bool = 'plugin_provided'
Whether to display a histogram-enhanced colorbar instead of the standard colorbar. When True, replaces the standard colorbar with a combined colorbar and data-distribution histogram generated by hist_cmap()
- field is_3d: bool = False
When True, interpret the product data as a 3D array; otherwise,interpret it as a 2D array
- field metadata_dir: str = 'metadata'
Subdirectory name for metadata; using non-default allows for non-operational outputs
- field metadata_fname_dict: dict | None = None
Dictionary of filename metadata passed to the metadata_tc_output_yaml.Only the ‘product_name’ key is accessed to look the product plugin while computing coverage for TC metadata YAML output
- field mpl_colors_info: dict[str, Any] | None = None
Matplotlib colormap configuration dict generated by set_matplotlib_colors_standard(). The common keys include ‘cmap’, ‘norm’, ‘cbar_label’, and / or ‘colorbar’ (bool). When None, a default grayscale colormap spanning the data range is automatically generated. Note: If ‘hist_colorbar=True’, the ‘colorbar’ flage is set to False to suppress the standard colorbar.
- field output_dict: dict | None = None
Only ‘product_spec_override’ key is used to override the product specification used for coverage checking
- field output_fname_dict: dict | None = None
- field overwrite: bool = True
When False, skip writing the output file if it already exists.
- field pressure_range_dict: dict | None = None
- field product_datatype_title: str | None = None
Display name for the data type in figure title.
- field product_name_title: str | None = None
Display name for the product shown in figure titles. When None, falls back to the product_name value
- field remove_duplicate_minrange: Any | None = None
- field savefig_kwargs: dict | None = None
Extra keyword arguments to be used by matplotlib’s savefif(). When None, defaults to an empty dict.
- field title_copyright: str | None = None
copyright string
- field title_formatter: str | None = None
format for title
- field use_compression: bool = False
When True, apply zlib compression (level 5) to all variables when writing netCDF ouput.
- field var_name: str | None = None
Variable name to extract from the xarray Dataset for plotting.When None, falls back to product_name. Useful when the variable to plot differs from the product name.
- field working_directory: str = 'plugin_provided'
Base output directory for generated files, Defaults to GEOIPS_OUTDIRS
- field x_size: int = None
Number of pixels in the x direction of the projected area definition
- field y_size: int = None
Number of pixels in the y direction of the projected area definition