metobs_toolkit.Dataset.add_new_observationtype#
- Dataset.add_new_observationtype(Obstype)[source]#
Add a new observation type to the known observation types.
The observation can only be added if it is not already present in the knonw observation types. If that is the case that you probably need to use use the Dataset.add_new_unit() method.
- Parameters:
add. (The new Obstype to)
- Return type:
None.
Examples
>>> import metobs_toolkit >>> co2_concentration = metobs_toolkit.Obstype(obsname='co2', ... std_unit='ppm') >>> #add other units to it (if needed) >>> co2_concentration.add_unit(unit_name='ppb', ... conversion=['x / 1000'], #1 ppb = 0.001 ppm ... ) >>> #Set a description >>> co2_concentration.set_description(desc='The CO2 concentration measured at 2m above surface') >>> #Add it to a Dataset >>> dataset = metobs_toolkit.Dataset() >>> dataset.add_new_observationtype(co2_concentration) >>> dataset.obstypes {'temp': Obstype instance of temp, 'humidity': Obstype instance of humidity, 'radiation_temp': Obstype instance of radiation_temp, 'pressure': Obstype instance of pressure, 'pressure_at_sea_level': Obstype instance of pressure_at_sea_level, 'precip': Obstype instance of precip, 'precip_sum': Obstype instance of precip_sum, 'wind_speed': Obstype instance of wind_speed, 'wind_gust': Obstype instance of wind_gust, 'wind_direction': Obstype instance of wind_direction, 'co2': Obstype instance of co2}