gnome.environment.water ======================= .. py:module:: gnome.environment.water .. autoapi-nested-parse:: The Water environment object. The Water object defines the Water conditions for the spill Temperature, Salinity, etc. NOTE: this is simple, constant water conditions -- at some point, we will make it a proper Environment object Classes ------- .. autoapisummary:: gnome.environment.water.WaterProperty gnome.environment.water.Temperature gnome.environment.water.Salinity gnome.environment.water.Sediment gnome.environment.water.WaveHeight gnome.environment.water.Water Functions --------- .. autoapisummary:: gnome.environment.water.make_water_property Module Contents --------------- .. py:class:: WaterProperty(water) Bases: :py:obj:`gnome.environment.environment.Environment` Base class for making an Environment object for a water property This one uses a Water object for the data itself Needs to be wrapped with the make_water_property decorator to be functional base class for environment objects :param name=None: .. py:attribute:: data_start .. py:attribute:: data_stop .. py:attribute:: water .. py:function:: make_water_property(property, default_unit) .. py:class:: Temperature(water) Bases: :py:obj:`WaterProperty` Base class for making an Environment object for a water property This one uses a Water object for the data itself Needs to be wrapped with the make_water_property decorator to be functional base class for environment objects :param name=None: .. py:class:: Salinity(water) Bases: :py:obj:`WaterProperty` Base class for making an Environment object for a water property This one uses a Water object for the data itself Needs to be wrapped with the make_water_property decorator to be functional base class for environment objects :param name=None: .. py:class:: Sediment(water) Bases: :py:obj:`WaterProperty` Base class for making an Environment object for a water property This one uses a Water object for the data itself Needs to be wrapped with the make_water_property decorator to be functional base class for environment objects :param name=None: .. py:class:: WaveHeight(water) Bases: :py:obj:`WaterProperty` Base class for making an Environment object for a water property This one uses a Water object for the data itself Needs to be wrapped with the make_water_property decorator to be functional base class for environment objects :param name=None: .. py:class:: Water(temperature=300.0, salinity=35.0, sediment=0.005, wave_height=None, fetch=None, units=None, name='Water', **kwargs) Bases: :py:obj:`gnome.environment.environment.Environment` Define the environmental conditions for a spill, like water_temperature, Single values for all time and space Defined in a Serializable class since user will need to set/get some of these properties through the client Includes attributes with an Environment interface: Temperature Salinity Sediment WaveHeight Example: water.Temperature.at(points, time, unit) Assume units are SI for all properties. 'units' attribute assumes SI by default. This can be changed, but initialization takes SI. Units is dict, with some subset of these keys:: { 'temperature': 'K', 'salinity': 'psu', 'sediment': 'kg/m^3', 'wave_height': 'm', 'fetch': 'm', } So to set units of temperature to F: ``units = {'temperature': 'F'}`` .. py:attribute:: temperature :value: 300.0 .. py:attribute:: salinity :value: 35.0 .. py:attribute:: sediment :value: 0.005 .. py:attribute:: wave_height :value: None .. py:attribute:: fetch :value: None .. py:attribute:: kinematic_viscosity :value: 1e-06 .. py:attribute:: name :value: 'Water' define as property in base class so all objects will have a name by default .. py:property:: units .. py:attribute:: Temperature .. py:attribute:: Salinity .. py:attribute:: Sediment .. py:attribute:: WaveHeight .. py:property:: data_start The Water object doesn't directly manage a time series of data, so it will not have a data range. We will just return an infinite range for Water. .. py:property:: data_stop .. py:method:: get(attr, unit=None) return value in desired unit. If None, then return the value in SI units. The user_units are given in 'units' attribute and each attribute carries the value as given in these user_units. .. py:method:: set(attr, value, unit) provide a corresponding set method that requires value and units. The attributes can be directly set. This function just sets the desired property and also updates the units dict .. py:property:: density return the density based on water salinity and temperature. The salinity is in 'psu'; it is not being converted to absolute salinity units - for our purposes, this is sufficient. Using gsw.rho() internally which expects salinity in absolute units.