EditFrxstPts: Edit the a frxst pts layer in Fulldom

Description Usage Arguments See Also Examples

View source: R/frxst_gage_points_add.R

Description

Note that this function removes any existing frxst_pts by default. The keep keyword keeps existing frxst_pts upto their replacement by ones specifed by gridINds and frxstInds.

Usage

1
2
EditFrxstPts(fullDomFile, newCopyId, gridInds, frxstInds, keep = FALSE,
  overwrite = FALSE)

Arguments

fullDomFile

Character file/path to the Fulldom file to copy.

newCopyId

Character identifier for the new copy of the fullDomFile with specified frxst_pts.

gridInds

Integer vector of gird indices to assign the integer values in frxstInds.

frxstInds

Integer identifiers for gridInds.

keep

Logical Keep existing forecast points in the frxst_pts layer. May still be replaced by frxst_pts specfied by gridInds and frxstInds.

overwrite

Logical If the output path/file created from fullDomFile and newCopyId already exists, then overwrite it.

See Also

Other nudging: AddRouteLinkGage, ChanObsToTimeSlice, MkNudgingParams

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# this example shows how to roughly match frxst_pts to reach gages
fullDomFile <- '~/WRF_Hydro/DOMAIN_library/Boulder_Creek_100m_1km_2sqkm_full_2015_09_03/Fulldom_hires_netcdf_file.nc'
newCopyId <- 'matchRlGages'
gages <- ncdump("~/WRF_Hydro/DOMAIN_library/Boulder_Creek_100m_1km_2sqkm_full_2015_09_03/Route_Link.threeRealGagesTEST.nc", 
                'gages', quiet=TRUE)
link <- ncdump("~/WRF_Hydro/DOMAIN_library/Boulder_Creek_100m_1km_2sqkm_full_2015_09_03/Route_Link.threeRealGagesTEST.nc", 
               'link', quiet=TRUE)
whGages <- which(gages != '               ')
gageLinks <- link[whGages]
names(gageLinks) <- gages[whGages]
linkId <- ncdump(fullDomFile, "LINKID", quiet=TRUE)
whGagesFull <- plyr::llply(gageLinks, function(gl) which(linkId == gl)[1])
EditFrxstPts(fullDomFile, newCopyId, 
             gridInds=unlist(whGagesFull),
             #frxstInds=as.integer(names(whGagesFull)),  ## fails because these cant be represented as short integers
             frxstInds=as.integer(c(500,160,200)), 
             overwrite=TRUE)

## End(Not run)

mccreigh/rwrfhydro documentation built on Feb. 28, 2021, 1:53 p.m.