metobs_toolkit.ModelObstype#

class ModelObstype(obstype, model_equivalent_dict={})[source]#

Extension of the Obstype class specific for the obstypes of Modeldata.

__init__(obstype, model_equivalent_dict={})[source]#

Initiate an Modelobservation type.

A ModelObstype has the same properties as an Obstype but with some extra attributes and methods.

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 Celsius 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 {}.

  • model_equiv_dict (dict) –

    A dictionary with information of how the observation type is found in modeldata. A example for pressure is:

    {‘ERA5_hourly’: {‘name’: ‘surface_pressure’, ‘units’: ‘pa’,

    ’band_desc’: “Pressure (force per ….

Return type:

None.

Methods

__init__(obstype[, model_equivalent_dict])

Initiate an Modelobservation type.

add_new_band(mapname, bandname, bandunit[, ...])

Add a new representing dataset/bandname to the obstype.

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.

get_all_units()

Return a list with all the known unit (in standard naming).

get_bandname(mapname)

Return the representing bandname of the obstype from a given gee dataset.

get_bandname_mapper(mapname)

Return the representing bandname with tlk standard name as a dict.

get_current_data_unit()

Get the current unit of the corresponding data.

get_description()

Return the descrition of the observation type.

get_info()

Print out detailed information of the observation type.

get_mapped_datasets()

Return all gee datasets with a representing band for this obstype.

get_modelunit(mapname)

Return the units of the representing bandname of the obstype from a given gee dataset.

get_orig_name()

Return the original name of the observation type.

get_plot_y_label(mapname)

Return a string to represent the vertical axes of a plot.

get_standard_unit()

Return the standard unit of the observation type.

has_mapped_band(mapname)

Test is a gee dataset has a representing band.

set_current_data_unit(current_data_unit)

Set the current data unit.

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.

setup_current_data_unit(mapname)

Set the current data unit to the one define by the corresponding band.

test_if_unit_is_known(unit_name)

Test is the unit is known.