metadump module

metadump.attribute_contains(ds, var, substring)
metadump.get_model_dim_name(dims, dim_name, meta_coords, source='generic')
metadump.has_multiple_time_levels(ds, var, tc)
metadump.is_plottable(ds, var, space_coords, zc, tc)
metadump.json_compatible(value)

Ensure all values in metadata are JSON-compatible Apply recursively to each item as needed

metadump.main()

Driver to generate source metadata and, optionally, YAML files required by autoviz

To run:

python metadump.py filepath [options]

metadump.metadump(filepath_1, filepath_2=None, app_output=None, specs_output=None, json_output=None, ignore_vars=None, vars=None, source='generic')
metadump.parse_command_line() Namespace

Parse command line arguments.

Example

>>> python metadump /path/to/file.nc
>>> python metadump /path/to/file.nc --json
>>> python metadump /path/to/file.nc --app foo.yaml --specs foo_specs.yaml
>>> python metadump /path/to/file.nc --app foo.yaml --specs foo_specs.yaml --ignore Var
>>> python metadump /path/to/file.nc --app foo.yaml --specs foo_specs.yaml --vars var1 var2 var3
>>> python metadump /path/to/file.nc --source wrf

Notes

  1. Prints “filtered” plottable variables to STDOUT

  2. Writes metadata to json file

  3. Creates specified app and specs files

  4. Creates specified app and specs files with ignored subset

  5. Creates specified app and specs files with specified vars

  6. Processes a file with a non-‘generic’ source metadata Sources are generic (default), wrf, lis

Once app and specs files are created one can run autoviz as follows:

python autoviz.py -s <source_name> -f /path/to/app.yaml

Returns:

populated namespace containing parsed arguments.

Return type:

parser