:py:mod:`gnome.weatherers.roc` ============================== .. py:module:: gnome.weatherers.roc .. autoapi-nested-parse:: oil removal from various cleanup options add these as weatherers Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.weatherers.roc.Response gnome.weatherers.roc.Platform gnome.weatherers.roc.Disperse gnome.weatherers.roc.Burn gnome.weatherers.roc.Skim Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.weatherers.roc._valid_dist_units gnome.weatherers.roc._valid_vel_units gnome.weatherers.roc._valid_vol_units gnome.weatherers.roc._valid_dis_units gnome.weatherers.roc._valid_time_units gnome.weatherers.roc._valid_oil_concentration_units gnome.weatherers.roc._valid_concentration_units gnome.weatherers.roc.d .. py:data:: _valid_dist_units .. py:data:: _valid_vel_units .. py:data:: _valid_vol_units .. py:data:: _valid_dis_units .. py:data:: _valid_time_units .. py:data:: _valid_oil_concentration_units .. py:data:: _valid_concentration_units .. py:class:: Response(timeseries=None, **kwargs) Bases: :py:obj:`gnome.weatherers.Weatherer` Base Weathering agent. This is almost exactly like the base Mover in the way that it acts upon the model. It contains the same API as the mover as well. Not Serializable since it does is partial implementation Base weatherer class; defines the API for all weatherers Passes optional arguments to base (Process) class via super. See base class for optional arguments: `gnome.movers.mover.Process` adds 'mass_components', 'mass' to array_types since all weatherers need these. .. py:property:: units .. py:attribute:: _oc_list :value: ['timeseries'] .. py:attribute:: _schema .. py:method:: _get_thickness(sc) .. py:method:: get(attr, unit=None) .. py:method:: set(attr, value, unit) .. py:method:: _is_active(model_time, time_step) .. py:method:: _setup_report(sc) .. py:method:: _get_substance(sc) return a single substance - recovery options only know about the total amount removed. Unclear how to assign this to multiple substances for now, just log an error if more than one substance is present .. py:method:: _remove_mass_simple(data, amount) .. py:method:: _remove_mass_indices(data, amounts, indices) .. py:method:: index_of(time) Returns the index of the timeseries entry that the time specified is within. If it is not in one of the intervals, -1 will be returned .. py:method:: next_interval_index(time) returns the index of the next interval, even if outside interval. returns None if there is no next interval .. py:method:: time_to_next_interval(time) if within an interval, returns time left in the interval. if between intervals, returns time until start of next interval if past end, or response deactivated, return None .. py:method:: is_operating(time) .. py:method:: _no_op_step() .. py:class:: Platform(units=None, type='Platform', **kwargs) Bases: :py:obj:`gnome.gnomeobject.GnomeId` A class for assigning a unique ID for an object .. py:attribute:: _attr .. py:attribute:: _si_units .. py:attribute:: _units_type .. py:attribute:: base_dir .. py:attribute:: _schema .. py:method:: get(attr, unit=None) .. py:method:: set(attr, value, unit) .. py:method:: release_rate(dosage, unit='gal/acre') return unit = gal/min .. py:method:: one_way_transit_time(dist, unit='nm', payload=False) return unit = sec .. py:method:: max_dosage() return unit = gal/acre .. py:method:: min_dosage() return unit = gal/acre .. py:method:: cascade_time(dist, unit='nm', payload=False) return unit = sec .. py:method:: max_onsite_time(dist, simul=False) return time in sec .. py:method:: num_passes_possible(time, pass_len, pass_type) In a given time (sec) compute maximum number of complete passes before needing to return to base. A pass consists of an approach, spray, u-turn, and reposition. .. py:method:: refuel_reload(simul=False) return unit = sec .. py:method:: pass_duration(pass_len, pass_type, units='nm') pass_len in nm return in sec .. py:method:: pass_duration_tuple(pass_len, pass_type, units='nm') .. py:method:: sortie_possible(time_avail, transit, pass_len) .. py:method:: eff_pump_rate(dosage, unit='gal/acre') given a dosage, determine the pump rate necessary given the airspeed and area covered in a pass return value = m^3/s .. py:method:: spray_time_fraction(pass_len, pass_type, units='nm') .. py:class:: Disperse(transit=None, pass_length=4, dosage=None, dosage_type='auto', cascade_on=False, cascade_distance=None, loading_type='simultaneous', pass_type='bidirectional', disp_oil_ratio=None, disp_eff=None, platform=None, units=None, wind=None, onsite_reload_refuel=False, **kwargs) Bases: :py:obj:`Response` Base Weathering agent. This is almost exactly like the base Mover in the way that it acts upon the model. It contains the same API as the mover as well. Not Serializable since it does is partial implementation Base weatherer class; defines the API for all weatherers Passes optional arguments to base (Process) class via super. See base class for optional arguments: `gnome.movers.mover.Process` adds 'mass_components', 'mass' to array_types since all weatherers need these. .. py:attribute:: _attr .. py:attribute:: _si_units .. py:attribute:: _units_type .. py:attribute:: _ref_as :value: 'roc_disperse' .. py:attribute:: _req_refs :value: ['wind'] .. py:attribute:: _schema .. py:attribute:: wind_eff_list :value: [15, 30, 45, 60, 70, 78, 80, 82, 83, 84, 84, 84, 84, 84, 83, 83, 82, 80, 79, 78, 77, 75, 73, 71,... .. py:attribute:: visc_eff_table .. py:method:: get_mission_data(dosage=None, area=None, pass_len=None, efficiency=None, units=None) Given a dosage and an area to spray, will return a tuple of information as follows: Minimize number of passes by using high swath_width. If pump rate cannot get to the dosage necessary, reduce the swath width until it can. Default units are ('gal/acre', 'm^3, 'nm', percent) Return tuple is as below (num_passes, disp/pass, oil/pass) (number, gal, ft, gal/min) .. py:method:: prepare_for_model_run(sc) Override for weatherers so they can initialize correct 'mass_balance' key and set initial value to 0.0 .. py:method:: dosage_from_thickness(sc) .. py:method:: get_disp_eff_avg(sc, model_time) .. py:method:: get_disp_eff(sc, model_time) .. py:method:: prepare_for_model_step(sc, time_step, model_time) .. py:method:: simulate_boat(sc, time_step, model_time) .. py:method:: simulate_plane(sc, time_step, model_time) .. py:method:: reset_for_return_to_base(model_time, message) .. py:method:: update_time(time_remaining, model_time, time_step) .. py:method:: dispersable_oil_idxs(sc) .. py:method:: dispersable_oil_amount(sc, units='gal') .. py:method:: weather_elements(sc, time_step, model_time) Run the equivalent of get_move for weathering processes. It modifies the SpillContainer's data arrays; most weatherers update 'mass_components' and 'mass' Some objects do not implement this since they update arrays like 'area' in model_step_is_done() .. py:class:: Burn(offset=None, boom_length=None, boom_draft=None, speed=None, throughput=None, burn_efficiency_type=None, units=_si_units, **kwargs) Bases: :py:obj:`Response` Base Weathering agent. This is almost exactly like the base Mover in the way that it acts upon the model. It contains the same API as the mover as well. Not Serializable since it does is partial implementation Base weatherer class; defines the API for all weatherers Passes optional arguments to base (Process) class via super. See base class for optional arguments: `gnome.movers.mover.Process` adds 'mass_components', 'mass' to array_types since all weatherers need these. .. py:attribute:: _si_units .. py:attribute:: _units_type .. py:attribute:: _ref_as :value: 'roc_burn' .. py:attribute:: _schema .. py:method:: prepare_for_model_run(sc) Override for weatherers so they can initialize correct 'mass_balance' key and set initial value to 0.0 .. py:method:: prepare_for_model_step(sc, time_step, model_time) 1. set 'active' flag based on timeseries and model_time 2. Mark LEs to be burned, do them in order right now. assume all LEs that are released together will be burned together since they would be closer to each other in position. .. py:method:: _collect(sc, time_step, model_time) .. py:method:: _transit(sc, time_step, model_time) .. py:method:: _burn(sc, time_step, model_time) .. py:method:: _clean(sc, time_step, model_time) .. py:method:: weather_elements(sc, time_step, model_time) Remove mass from each le equally for now, no flagging for not just make sure it's from floating oil. .. py:class:: Skim(speed=None, storage=None, swath_width=None, group=None, throughput=None, nameplate_pump=None, skim_efficiency_type=None, recovery=None, recovery_ef=None, decant=None, decant_pump=None, discharge_pump=None, rig_time=None, transit_time=None, units=_si_units, **kwargs) Bases: :py:obj:`Response` Base Weathering agent. This is almost exactly like the base Mover in the way that it acts upon the model. It contains the same API as the mover as well. Not Serializable since it does is partial implementation Base weatherer class; defines the API for all weatherers Passes optional arguments to base (Process) class via super. See base class for optional arguments: `gnome.movers.mover.Process` adds 'mass_components', 'mass' to array_types since all weatherers need these. .. py:attribute:: _si_units .. py:attribute:: _units_type .. py:attribute:: _schema .. py:method:: prepare_for_model_run(sc) Override for weatherers so they can initialize correct 'mass_balance' key and set initial value to 0.0 .. py:method:: prepare_for_model_step(sc, time_step, model_time) sets active flag based on time_span and on flag. Object is active if following hold and 'on' is True: 1. active start <= (model_time + time_step/2) so object is on for more than half the timestep 2. (model_time + time_step/2) <= active_stop so again the object is on for at least half the time step flag to true. :param sc: an instance of gnome.spill_container.SpillContainer class :param time_step: time step in seconds :param model_time_datetime: current model time as datetime object .. py:method:: _collect(sc, time_step, model_time) .. py:method:: _transit(sc, time_step, model_time) .. py:method:: _offload(sc, time_step, model_time) .. py:method:: weather_elements(sc, time_step, model_time) Remove mass from each le equally for now, no flagging for now just make sure the mass is from floating oil. .. py:method:: _getRecoveryEfficiency() .. py:data:: d