build_weather_station: Weather Station

View source: R/weather_station.R

build_weather_stationR Documentation

Weather Station

Description

Creates a list of class "weather_station, that contains all data regarding the weather station, its location and its measurements.

Usage

build_weather_station(
  lat,
  lon,
  elev,
  surface_type = "Meadow",
  obs_height = 0.3,
  z1,
  z2,
  datetime,
  t1,
  t2,
  v1,
  v2,
  hum1,
  hum2,
  p1 = NULL,
  p2 = NULL,
  sw_in = NULL,
  sw_out = NULL,
  lw_in = NULL,
  lw_out = NULL,
  soil_flux = NULL,
  ...
)

Arguments

lat

Latitude of location. Preset: 50.840503 (climate station caldern).

lon

Longitude of location. Preset: 8.683300 (climate station caldern).

elev

Elevation of location above sea level in m. Preset: 270 m (climate station caldern).

surface_type

Surface Type. Form: Character string. One of: "Wiese", "Acker", "Gruenflaeche", "Strasse", "Landwirtschaft", "Siedlung", "Nadelwald", "Laubwald", "Mischwald", "Stadt". Preset: "Wiese.

obs_height

Height of vegetation in m. Preset: 0.3.

z1

Lower measurement height in m. Preset: 2m.

z2

Upper measurement height in m. Preset: 2m.

datetime

Name of datetime-coloumn in data. Form: POSIX-Object (See base::as.POSIXlt and base::strptime for conversion.)

t1

Vector containing lower temperature data in degrees C.

t2

Vector containing upper temperature data in degrees C.

v1

Vector containing lower wind speed data in m/s.

v2

Vector containing upper wind speed data in m/s.

hum1

Vector containing lower humidity data in %.

hum2

Vector containing upper humidity data in %.

p1

Vector containing lower pressure data in hPa.

p2

Vector containing upper pressure data in hPa.

sw_in

Vector containing incoming shortwave radiation in W/m^2.

sw_out

Vector containing outgoing shortwave radiation in W/m^2.

lw_in

Vector containing incoming longwave radiation in W/m^2.

lw_out

Vector containing outgoing shortwave radiation in W/m^2.

soil_flux

Vector containing soil flux in W/m^2.

...

Additional parameters, see details for usage.

Details

Parameters with preset NULL can be estimated using calculations. However some additional variables need to be passed for the estimation of some parameters. For usage examples see the examples below.

If p1 and p2 are NULL, they will get estimated using the elevation and air temperature.

If sw_in is NULL, it will get estimated using TOA radiation and average atmospheric transmittance (see rad_sw_in). By setting slope, sky_view and exposition, sw_in will be topographically corrected (see rad_sw_in_topo).

If sw_out is NULL, albedo needs to be set (see rad_sw_out).

If lw_in is NULL, it will get estimated using the air temperature and pressure (see rad_lw_in). By setting sky_view, lw_in will be topographically corrected (see rad_lw_in_topo).

If lw_out is NULL, t_surface needs to be set (see rad_lw_out).

If soil_flux is NULL, ts1, ts2, depth1, depth2, moisture and texture need to be set. (see soil_heat_flux and soil_thermal_cond).

Value

List of class "weather_station", that contains:

  1. list of location properties

  2. list of weather station properties

  3. list of measurements, which will contain NULLs if they were not defined in the input

Examples

## Not run: 
# Standard parameters
test_station <- build_weather_station(lat = 50.840503,
                                     lon = 8.6833,
                                     elev = 270,
                                     surface_type = "Meadow",
                                     obs_height = 0.3, # obstacle height
                                     z1 = 2, # measurement heights
                                     z2 = 10,
                                     datetime = ws$datetime,
                                     t1 = ws$t1, # temperature
                                     t2 = ws$t2,
                                     v1 = ws$v1, # windspeed
                                     v2 = ws$v2,
                                     hum1 = ws$hum1, # humidity
                                     hum2 = ws$hum2,
                                     sw_in = ws$rad_sw_in, # shortwave radiation
                                     sw_out = ws$rad_sw_out,
                                     lw_in = ws$rad_lw_in, # longwave radiation
                                     lw_out = ws$rad_lw_out,
                                     soil_flux = ws$heatflux_soil)
# Specify pressure
test_station <- build_weather_station(lat = 50.840503, lon = 8.6833, elev = 270,
                                     surface_type = "Meadow", obs_height = 0.3,
                                     z1 = 2, z2 = 10, datetime = ws$datetime,
                                     t1 = ws$t1, t2 = ws$t2, v1 = ws$v1, v2 = ws$v2,
                                     hum1 = ws$hum1, hum2 = ws$hum2,
                                     sw_in = ws$rad_sw_in,
                                     sw_out = ws$rad_sw_out,
                                     lw_in = ws$rad_lw_in,
                                     lw_out = ws$rad_lw_out,
                                     soil_flux = ws$heatflux_soil,
                                     # ADDED PRESSURE
                                     p1 = ws$p1,
                                     p2 = ws$p2)

# Alternative calculation of soil flux
test_station <- build_weather_station(lat = 50.840503, lon = 8.6833, elev = 270,
                                     surface_type = "Meadow", obs_height = 0.3,
                                     z1 = 2, z2 = 10, datetime = ws$datetime,
                                     t1 = ws$t1, t2 = ws$t2, v1 = ws$v1, v2 = ws$v2,
                                     hum1 = ws$hum1, hum2 = ws$hum2,
                                     sw_in = ws$rad_sw_in,
                                     sw_out = ws$rad_sw_out,
                                     lw_in = ws$rad_lw_in,
                                     lw_out = ws$rad_lw_out,
                                     # Alternative Soil flux:
                                     depth1 = 0,
                                     depth2 = 0.3,
                                     ts1 = ws$t_surface,
                                     ts2 = ws$ts1,
                                     moisture = ws$water_vol_soil,
                                     texture = "clay")
# Alternative shortwave
test_station <- build_weather_station(lat = 50.840503, lon = 8.6833, elev = 270,
                                     surface_type = "Meadow", obs_height = 0.3,
                                     z1 = 2, z2 = 10, datetime = ws$datetime,
                                     t1 = ws$t1, t2 = ws$t2, v1 = ws$v1, v2 = ws$v2,
                                     hum1 = ws$hum1, hum2 = ws$hum2,
                                     lw_in = ws$rad_lw_in,
                                     lw_out = ws$rad_lw_out,
                                     soil_flux = ws$heatflux_soil,
                                     # Alternative shortwave radiation:
                                     albedo = 0.3,
                                     # Topographic correction
                                     slope = 10, # In degrees
                                     exposition = 20, # North = 0, South = 180
                                     sky_view = 0.82 # Sky view factor (0-1)
)

# Alternative longwave
test_station <- build_weather_station(lat = 50.840503, lon = 8.6833, elev = 270,
                                     surface_type = "Meadow", obs_height = 0.3,
                                     z1 = 2, z2 = 10, datetime = ws$datetime,
                                     t1 = ws$t1, t2 = ws$t2, v1 = ws$v1, v2 = ws$v2,
                                     hum1 = ws$hum1, hum2 = ws$hum2,
                                     sw_in = ws$rad_sw_in,
                                     sw_out = ws$rad_sw_out,
                                     soil_flux = ws$heatflux_soil,
                                     # Alternative longwave radiation:
                                     t_surface = ws$t_surface,
                                     # Different emissivity:
                                     # lw_out = rad_lw_out(ws$t_surface, emissivity_surface = 0.92),
                                     # Topographic correction
                                     sky_view = 0.82 # Sky view factor (0-1)
)


## End(Not run)

jonasViehweger/fieldClim documentation built on June 22, 2022, 3:17 p.m.