Description Usage Arguments Value Author(s) See Also Examples
Grids station interval temperature values, so that they can
be used as MESH inputs. The gridding method is performed by the hydroTSM
function hydrokrige
, using the IDW (inverse distance weighting) algorithm.
The gridding uses a basin-scale lapse rate, which is determined by fitting a
linear model to the difference between each site's temperature and that of the
lowest site, and the difference in elevation relative to the lowest site. The
procedure is the same as used in the the function basinLapseRates
.
In effect, all site temperatures are converted to have the same elevation before
gridding. After gridding, each temperature is raised to its specified elevation
using the same lapse rate. Where there are only 1 or 2 stations with available
air temperatures, the hourly x monthly lapse rates returned by basinLapseRates
are used.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
temp |
Required. A list containing 3 elements: 1. the header meta data,
2. the column meta data, and 3. the air temperature values (in K). These values
are returned automatically by the MESHr command |
source_file_name |
Required. The name of the original |
shed_raster |
Required. A |
site_elev |
Required. A data frame of station elevations. Note that the first column must contain the station names (which must be the same as in the air temperatures), and the second column must contain the elevation (in m). |
lapse_rates |
Optional. If there are 2 or fewer air temperatures in any
interval, then the lapse rate cannot be calculated. In this case, if the
historical |
IDW_file |
Required. Output file which holds gridded air temperatures for all time steps. |
tmin |
Required. The minimum permitted air temperature of the gridded
(and lapsed) air temperatures. All values exceeding |
tmax |
Required. The maximum permitted air temperature of the gridded
(and lapsed) air temperatures. All values exceeding |
missing_value |
Required. Value to be used if all values in an interval
are missing. Default is |
quiet |
Optional. If |
progress_bar |
Optional. If |
If unsuccessful, returns FALSE
. If successful, returns
TRUE
and the gridded temperatures values are written to the
IDW_file
. Note that each interval's temperatures are written as they
is gridded. This saves on memory, but can be quite slow. Note that the
air temperatures in the file are in K.
Kevin Shook
gridPrecip
basinLapseRates
read_r2c_shed
read_tb0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
hourly_temp_file <- "Red_Deer_all_hourly_temp_new.tb0"
temp <- read_tb0(hourly_temp_file, values_only = FALSE, timezone = "Etc/GMT+7", NAvalue = -0.1)
source_file_name <- hourly_temp_file
shedfile <- "RedDeer_MESH_drainage_database.r2c"
shed_raster <- read_r2c_shed(shedfile, as_rasters = TRUE, values_only = TRUE)
elev_file <- "site_elevations.csv"
site_elev <- read.csv(elev_file, header = TRUE, stringsAsFactors = FALSE)
lapse_rates_file <- "RedDeerLapseRates.csv"
lapse_rates <- read.csv(lapse_rates_file, header = TRUE, stringsAsFactors = FALSE, row.names = 1)
IDW_file <- "RedDeerTemp.idw"
gridPrecip(temp = temp, source_file_name = source_file_name,
shed_raster = shed_raster, site_elev = site_elev,
lapse_rates = lapse_rates)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.