Description Usage Arguments Value Author(s) See Also Examples
Grids station interval precipitation values, so that they can
be used as MESH inputs. The station values are distributed over the domain of
the basin. Values outside of the basin are set to the missing value.
The gridding method is performed by the hydroTSM
function hydrokrige
, using the IDW (inverse distance weighting) algorithm
for each time interval. If there are no values present in a given interval, then the
entire domain will be set to the missing value. If all of the values are identical,
or if there is a single value, then all of the domain will have
that value.
It is possible that the IDW algorithm will be unable to grid the specified values
in a given interval. In this case, the error is trapped, and the mean of the station
values is used for the entire domain.
1 2 3 4 5 6 7 8 9 10 |
precip |
Required. A list containing 3 elements: 1. the header meta data,
2. the column meta data, and 3. the precipitation values (in mm). These values
are returned automatically by the MESHr command |
source_file_name |
Required. The name of the original |
shed_raster |
Required. A |
IDW_file |
Required. Name of the output file which will hold the gridded precipitation for all time intervals. |
missing_value |
Required. Value to be used if all values in an interval
are missing. Default is |
zeromissing |
Required. If there are enough precipitation values for gridding
to take place, but there are still missing values, setting |
quiet |
Optional. If |
progress_bar |
Optional. This function can take a long time to execute,
depending on the number of time intervals, and the number of stations.
If |
If unsuccessful, returns FALSE
. If successful, returns
TRUE
and the gridded precipitation values are written to the
IDW_file
. Note that each interval's precipitation is written as it
is gridded. This saves on memory, and will save at least some of the values
in case there is a crash, but is slow. The gridded precipitation
is in mm/s
.
Kevin Shook
gridTemp
read_r2c_shed
read_tb0
1 2 3 4 5 6 7 8 9 10 | ## Not run:
hourly_precip_file <- "Red_Deer_all_hourly_precip_new.tb0"
precip <- read_tb0(hourly_precip_file, values_only = FALSE, timezone = "Etc/GMT+7", NAvalue = -0.1)
shedfile <- "RedDeer_MESH_drainage_database.r2c"
shed_raster <- read_r2c_shed(shedfile, as_rasters = TRUE, values_only = TRUE)
IDW_file <- "RedDeerPrecip_idw.r2c"
source_file_name <- "Red_Deer_all_hourly_precip_new.tb0"
gridPrecip(precip, source_file_name, shed_raster, IDW_file, missing_value = -999)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.