View source: R/extract_clima.R
extract_clima | R Documentation |
'extract_clima' takes an nc file containing hourly ERA5 climate data, and for a given set of coordinates, reconverts climate variables to make ready for use with 'microclimf::modelina' by default. Also provides the option to implement a diurnal temperature range correction to air temperatures.
extract_clima(
nc,
long_min,
long_max,
lat_min,
lat_max,
start_time,
end_time,
dtr_cor = TRUE,
dtr_cor_fac = 1.285,
reformat = TRUE
)
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_min |
minimum longitude of the grid for which data are required (decimal |
long_max |
maximum longitude of the grid for which data are required (decimal degrees, -ve west of Greenwich Meridian). |
lat_min |
minimum latitude of the grid for which data are required (decimal |
lat_max |
maximum latitude of the grid for which data are required (decimal degrees, -ve south of the equator). |
start_time |
a POSIXlt or POSIXct object indicating the first day or hour for which data are required. Encouraged to specify desired timezone as UTC (ERA5 data are in UTC by default), but any timezone is accepted. |
end_time |
a POSIXlt or POSIXct object indicating the last day or hour for which data are required. Encouraged to specify desired timezone as UTC (ERA5 data are in UTC by default), but any timezone is accepted. |
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.285, based on calibration against UK Met Office observations. |
reformat |
a logical indicating whether to reformat the climate variables to be suitable for modeling with microclimf. Default to TRUE. |
a list of spatRasters containing hourly values for a suite of climate variables. The returned climate variables depends on whether the parameter 'reformat' is TRUE or FALSE. If 'reformat' is TRUE:
'temp' | (degrees celsius)
'relhum' | relative humidity (ercentage)
'pres' | atmospheric press (kPa)
'swrad' | Total incoming shortwave radiation (W / m^2)
'difrad' | Diffuse radiation (W / m^2)
'skyem' | Sky emissivity: downward long wave radiation flux divided by the sum of net long-wave radiation flux and downward long wave radiation flux (unitless, 0-1)
'windspeed' | (m / s)
'winddir' | wind direction, azimuth (decimal degrees from north)
If 'reformat' is FALSE:
'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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.