Application Programming Interface (API) Reference

Full program as executed from CLI

main()

Perform end-to-end model-to-observational co-location.

Core functions

Data input and compliance

get_files_to_individually_colocate(path)

TODO.

read_obs_input_data(obs_data_path)

Read in all observational input data.

read_model_input_data(model_data_path)

Read in all model input data.

get_input_fields_of_interest(fl, chosen_field)

Return the field(s) of interest from the input dataset.

vertical_parametric_computation(model_field, ...)

Return a model field with arbitrary computed vertical coordinates.

vertical_parametric_computation_ahhc(...)

Return a model field with computed vertical coordinate of altitude.

vertical_parametric_computation_ahspc(...)

Return a model field with computed 'air_pressure' vertical coordinate.

ensure_cf_compliance(field, plugin[, ...])

Ensure the chosen field is CF compliant with the correct format.

check_time_coverage(obs_times, model_times)

TODO

ensure_unit_calendar_consistency(obs_field, ...)

Ensure the chosen fields have consistent units and calendars.

set_start_datetime(obs_times, ...)

Replace observational time data with those starting from a new value.

get_time_coords(obs_field, model_field[, ...])

Return the relevant time coordinates from the fields.

Co-location and bounding

colocate_single_file(file_to_colocate, ...)

Perform model-to-observational colocation using a single file source.

bounding_box_query(model_field, model_id, ...)

Apply a custom query to get the bounding box.

subspace_to_spatiotemporal_bounding_box(...)

Extract only relevant data in the model field via a 4D subspace.

spatial_interpolation(obs_field, ...[, ...])

Interpolate the flight path spatially (3D for X-Y and vertical Z).

time_subspace_per_segment(index, ...)

TODO.

time_interpolation(obs_times, model_times, ...)

Interpolate the flight path temporally (in time T).

Data output

create_contiguous_ragged_array_output(...)

Create a compressed contiguous ragged array DSG output.

write_output_data(final_result_field, ...)

Write out the 4D (XYZT) colocated result as output data.

Helper

logger

Instances of the Logger class represent a single logging channel.

timeit(func)

A decorator to measure and report function execution time.

get_env_and_diagnostics_report()

Provide an optional report of environment and diagnostics.

Performance

persist_all_metadata(field)

Persist all of the metadata for a field.

Custom exceptions

CFComplianceIssue

Raised for cases of errors caused by lack of CF Compliance.

IncompatibleDataInputsIssue

Raised for cases of incompatibility between the Model and Obs inputs.

DataReadingIssue

Raised for cases of failure to read appropriate data input file(s).

ConfigurationIssue

Raised for cases of configuration values being invalid or unsuitable.

InternalsIssue

Raised for cases of the toolkit behaviour emerging wrong.

Plotting

plotting.preview_plots(obs_field, ...[, index])

Generate plots of the flight track for a pre-colocation preview.

plotting.output_plots(output, ...[, ...])

Generate a post-colocation result plot of the track(s) or swath(s).

make_preview_plots(obs_field, ...[, index])

Generate plots of the flight track for a pre-colocation preview.

make_output_plots(output, obs_t_identifier, ...)

Generate a post-colocation result plot of the track(s) or swath(s).

Command-line parsing

cli.setup_logging(verbosity)

Configure the package log level assuming CLI counted '-v' flag input.

cli.process_cli_arguments(parser)

Parse and process all command-line arguments.

cli.process_config()

Process all configuration, from CLI, file or a default if neither set.

cli.validate_config(final_config_namespace)

TODO

cli.process_config_file(config_file)

Process a configuration file.

Default values

constants.CONFIG_DEFAULTS

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

Plugins

For Satellite observational data

satellite_plugin(fieldlist[, config])

Pre-processing of a field from a satellite swath.

plugins.satellite_compliance_converter.satellite_compliance_plugin(...)

The converter.

For WRF Data

plugins.wrf_data_compliance_fixes.wrf_extra_compliance_fixes(...)

Extra CF compliance fixes for WRF data.

plugins.wrf_data_compliance_fixes.wrf_further_compliance_fixes(...)

More CF compliance fixes for WRF data.