gnome.outputters.binary¶
Binary Outputter For use in Gnome Analyst
Attributes¶
Classes¶
class that outputs GNOME trajectory results on a time step by time step basis |
Module Contents¶
- gnome.outputters.binary.le_dtype¶
- gnome.outputters.binary.le_dtype¶
- gnome.outputters.binary.header_dtype¶
- gnome.outputters.binary.header_dtype¶
- class gnome.outputters.binary.BinaryOutput(filename, zip_output=True, **kwargs)¶
Bases:
gnome.outputters.outputter.OutputterFilenameMixin
,gnome.outputters.outputter.Outputter
class that outputs GNOME trajectory results on a time step by time step basis this is the format output by desktop GNOME for use in Gnome Analyst
- Parameters:
filename (str) – full path and basename of the zip file
zip_output=True – whether to zip up the output binary files
other arguments as defined in the Outputter class
- name¶
define as property in base class so all objects will have a name by default
- output_dir¶
- zip_output = True¶
- filedir¶
- file_num = 0¶
- prepare_for_model_run(model_start_time, spills, uncertain=False, **kwargs)¶
- prepare_for_model_run(model_start_time,
- cache=None,
- uncertain=False,
- spills=None,
- **kwargs)
Reset file_num and uncertainty
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 separate files.
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)¶
Write data from time step to binary file
- output_to_file(filename, sc)¶
dump a timestep’s data into binary files for Gnome Analyst
- clean_output_files()¶
deletes output files that may be around
called by prepare_for_model_run
here in case it needs to be called from elsewhere