extract_clim: Produces hourly data for a single location ready for use with...

Description Usage Arguments Value

View source: R/extract_clim.R

Description

'extract_clim' takes an nc file containing hourly ERA5 climate data, and for a given set of coordinates, produces an (optionally) inverse distance weighted mean of each variable, ready for use with 'microclima::runauto'. Also provides the option to implement a diurnal temperature range correction to air temperatures.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_clim(
  nc,
  long,
  lat,
  start_time,
  end_time,
  d_weight = TRUE,
  dtr_cor = TRUE,
  dtr_cor_fac = 1
)

Arguments

nc

character vector containing the path to the nc file. Use the 'build_era5_request' and 'request_era5' functions to acquire an nc file with the correct set of variables. Data within nc file must span the period defined by start_time and end_time.

long

longitude of the location for which data are required (decimal degrees, -ve west of Greenwich Meridian).

lat

latitude of the location for which data are required (decimal degrees, -ve south of the equator).

start_time

a POSIXlt object indicating the first hour for which data are required.

end_time

a POSIXlt object indicating the last hour for which data are required.

d_weight

logical value indicating whether to apply inverse distance weighting using the 4 closest neighbouring points to the location defined by 'long' and 'lat'. Default = 'TRUE'.

dtr_cor

logical value indicating whether to apply a diurnal temperature range correction to air temperature values. Default = 'TRUE'.

dtr_cor_fac

numeric value to be used in the diurnal temperature range correction. Default = 1.

Value

a data frame containing hourly values for a suite of climate variables:

'obs_time' | the date-time (timezone specified in col timezone)

'temperature' | (degrees celsius)

'humidity' | specific humidity (kg / kg)

'pressure' | (Pa)

'windspeed' | (m / s)

'winddir' | wind direction, azimuth (degrees from north)

'emissivity' | downward long wave radiation flux divided by the sum of net long-wave radiation flux and downward long wave radiation flux (unitless)

'cloudcover' | (percent)

'netlong' | Net longwave radiation (MJ / m2 / hr)

'uplong' | Upward longwave radiation (MJ / m2 / hr)

'downlong' | Downward longwave radiation (MJ / m2 / hr)

'rad_dni' | Direct normal irradiance (MJ / m2 / hr)

'rad_dif' | Diffuse normal irradiance (MJ / m2 / hr)

'szenith' | Solar zenith angle (degrees from a horizontal plane)

'timezone' | (unitless)


dklinges9/mcera5 documentation built on Jan. 14, 2022, 9:42 p.m.