2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
MeteoStationList Class Reference

A list of meteorological stations. More...

Detailed Description

A list of meteorological stations.

Can find the nearest station for a position and calculate the temperature lapse

Public Member Functions

 MeteoStationList ()
 Create empty list.
 
 MeteoStationList (const MeteoStationList &copy)
 Copy c'tor.
 
MeteoStation::ptr add_station (std::string name, cmf::geometry::point position, double latitude=51.0, double longitude=8.0, double tz=1.0, cmf::math::Time startTime=cmf::math::Time(1, 1, 2001), cmf::math::Time timestep=cmf::math::day)
 Creates a meteorological station at a certain position and adds it to the list.
 
double calculate_Temp_lapse (cmf::math::Time begin, cmf::math::Time step, cmf::math::Time end)
 Calculates the temperature lapse from all stations in the list and sets the T_lapse attribute of each station.
 
MeteoStation::ptr operator[] (const std::string &Name) const
 gets a station by name
 
MeteoStation::ptr operator[] (ptrdiff_t index) const
 Gets the station at index.
 
MeteoStationReference reference_to_nearest (const cmf::geometry::point &position, double z_weight=0) const
 Creates a MeteoStationReference from the nearest station to position at position.
 
ptrdiff_t remove_station (ptrdiff_t index)
 Removes a station and returns the number of remaining references to the removed station. If the station is deleted, 0 is returned.
 
size_t size () const
 Returns the number of stations.
 

Member Function Documentation

◆ add_station()

MeteoStation::ptr add_station ( std::string name,
cmf::geometry::point position,
double latitude = 51.0,
double longitude = 8.0,
double tz = 1.0,
cmf::math::Time startTime = cmf::math::Time(1, 1, 2001),
cmf::math::Time timestep = cmf::math::day )

Creates a meteorological station at a certain position and adds it to the list.

Parameters
nameName of the station
positionThe location of the station in map coordinates
latitudeLatitude of the study area (for solar radiation)
longitudeLongitude of the study area (for solar time)
tzTime zone of the study area (e.g Germany +1,U.S. Pacific time -8
startTimeDate of the beginning of the climatic data (may be changed for each time series later)
timestepFrequency of climatic data (may be changed for each time series later)

◆ calculate_Temp_lapse()

double calculate_Temp_lapse ( cmf::math::Time begin,
cmf::math::Time step,
cmf::math::Time end )

Calculates the temperature lapse from all stations in the list and sets the T_lapse attribute of each station.

Returns the average lapse over the whole period.

◆ reference_to_nearest()

MeteoStationReference reference_to_nearest ( const cmf::geometry::point & position,
double z_weight = 0 ) const

Creates a MeteoStationReference from the nearest station to position at position.

The distance is calculated as \( d=\sqrt{(x_{s} - x_{l})^2 + (y_{s} - y_{l})^2} + \lambda_z\|z_{s} - z_{l}\| \) Where \(s\) is the station and \(l\) is the locatable

Returns
A Meteorology using the data of the nearest station to position
Parameters
positionThe position (any locatable, like e.g. Cell possible) to look for the station. The reference should be owned by the locatable
z_weightThe weight of the height difference \(\lambda_z\)