:py:mod:`gnome.outputters.oil_budget` ===================================== .. py:module:: gnome.outputters.oil_budget .. autoapi-nested-parse:: Outputter for dumping the oil budget as a CSV file (Or maybe other formats in the future) Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.outputters.oil_budget.OilBudgetOutput .. py:class:: OilBudgetOutput(filename='gnome_oil_budget.csv', file_format='csv', cache=None, on=True, output_timestep=None, *args, **kwargs) Bases: :py:obj:`gnome.outputters.weathering.BaseMassBalanceOutputter`, :py:obj:`gnome.outputters.outputter.OutputterFilenameMixin` Outputter for the oil budget table Sets attributes for outputters, like output_timestep, cache, etc. :param cache: sets the cache object from which to read data. The model will automatically set this parameter. :param output_timestep=None: If ``None`` output will be written every model time step. If set, then output is written every output_timestep starting from the model start time. If the output_timestep is less than the model timestep, an Warning will be raised at runtime. :type output_timestep: timedelta object :param output_zero_step=True: If True then output for initial step (showing initial release conditions) is written regardless of ``output_timestep`` or ``output_single_step`` :type output_zero_step: bool :param output_last_step=True: If True then output for final step is written regardless of ``output_timestep`` or ``output_single_step``. This is potentially an extra output, if not aligned with ``output_timestep``. :type output_last_step: bool :param output_single_step=False: If ``True`` then output is written for only one step, the output_start_time, regardless of ``output_timestep``. ``output_zero_step`` and ``output_last_step`` are still respected, set these to False if you want only one time step. :type output_single_step: boolean :param output_start_time=None: Time to start outputting restults. If None it is set to the model start time :type output_start_time: datetime object :param output_dir=None: Directory to dump output in, if it needs to do this. :type output_dir: PathLike :param surface_conc=None: Compute surface concentration Any non-empty string will compute (and output) the surface concentration. The contents of the string determine the algorithm used. "kde" is currently the only available option. :type surface_conc: str or None .. py:attribute:: _valid_file_formats .. py:attribute:: budget_categories :value: ['amount_released', 'evaporated', 'natural_dispersion', 'sedimentation', 'beached', 'floating',... .. py:attribute:: header_row :value: ['Model Time', 'Hours Since Model Start', 'Amount Released (kg)', 'Evaporated (kg)', 'Dispersed... .. py:attribute:: _schema .. py:method:: prepare_for_model_run(model_start_time, spills, **kwargs) start the csv file .. py:method:: write_output(step_num, islast_step=False) Oil budget is only output for forecast spill container, not the uncertain spill container. This is because Weathering has its own uncertainty and mixing the two was giving weird results. The cloned models that are modeling weathering uncertainty do not include the uncertain spill container. .. py:method:: post_model_run() Called after a model run is complete remove the csv file - hopefully resulting in the file being closed.