metobs_toolkit.Obstype#
- class Obstype(obsname, std_unit, description=None, unit_aliases={}, unit_conversions={})[source]#
Object with all info and methods for a specific observation type.
- __init__(obsname, std_unit, description=None, unit_aliases={}, unit_conversions={})[source]#
Initiate an observation type.
- Parameters:
obsname (str) – The name of the new observation type (i.g. ‘sensible_heat_flux’).
std_unit (str) – The standard unit for the observation type (i.g. ‘J/m²’)
obstype_description (str, ptional) – A more detailed description of the obstype (i.g. ‘2m SE inside canopy’). The default is None.
unit_aliases (dict, optional) – A dictionary containing unit alias names. Keys represent a unit and values are lists with aliases for the units at the keys. The default is {}.
unit_conversions (dict, optional) –
A dictionary containing the conversion information to map to the standard units. Here an example of for temperatures (with Celcius as standard unit):
{‘Kelvin’: [“x - 273.15”], #result is in tlk_std_units ‘Farenheit’ : [“x-32.0”, “x/1.8”]}, # –>execute from left to write = (x-32)/1.8
The default is {}.
- Return type:
None.
Methods
__init__
(obsname, std_unit[, description, ...])Initiate an observation type.
add_unit
(unit_name[, conversion])Add a new unit to an observation type.
convert_to_standard_units
(input_data, input_unit)Convert data from a knonw unit to the standard unit.
Return a list with all the known unit (in standard naming).
Return the descrition of the observation type.
get_info
()Print out detailed information of the observation type.
Return the original name of the observation type.
get_plot_y_label
([mapname])Return a string to represent the vertical axes of a plot.
Return the standard unit of the observation type.
set_description
(desc)Set the description of the observation type.
set_original_name
(columnname)Set the original name of the observation type.
set_original_unit
(original_unit)Set the original unit of the observation type.
test_if_unit_is_known
(unit_name)Test is the unit is known.