gnome.outputters.kmz

kmz outputter

Module Contents

Classes

KMZOutput

class that outputs GNOME results in a kmz format.

Attributes

DOT

X

class gnome.outputters.kmz.KMZOutput(filename, **kwargs)

Bases: gnome.outputters.outputter.OutputterFilenameMixin, gnome.outputters.outputter.Outputter

class that outputs GNOME results in a kmz format.

Suitable for Google Earth, and semi-suitable for MarPlot

Parameters:

output_dir=None (str) – output directory for kmz files.

uses super to pass optional **kwargs to base class __init__ method

_schema
time_formatter = '%m/%d/%Y %H:%M'
prepare_for_model_run(model_start_time, spills, **kwargs)
prepare_for_model_run(model_start_time,
cache=None,
uncertain=False,
spills=None,
**kwargs)

Write the headers, png files, etc for the KMZ file

This must be done in prepare_for_model_run because if model _state changes, it is rewound and re-run from the beginning.

If there are existing output files, they are deleted here.

This takes more than standard ‘cache’ argument. Some of these are required arguments - they contain None for defaults because non-default argument cannot follow default argument. Since cache is already 2nd positional argument for Renderer object, the required non-default arguments must be defined following ‘cache’.

If uncertainty is on, then SpillContainerPair object contains identical _data_arrays in both certain and uncertain SpillContainer’s, the data itself is different, but they contain the same type of data arrays. If uncertain, then data arrays for uncertain spill container are written to the KMZ file.

Note

Does not take any other input arguments; however, to keep the interface the same for all outputters, define kwargs in case future outputters require different arguments.

write_output(step_num, islast_step=False)

dump a timestep’s data into the kmz file

rewind()

reset a few parameter and call base class rewind to reset internal variables.

gnome.outputters.kmz.DOT = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAJOgAACToB8GSSSgAAA...'
gnome.outputters.kmz.X = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAA...'