geogMask {HiClimR} | R Documentation |
Geographic mask from longitude and latitude
Description
geogMask
is a helper function that preprocess input for the
HiClimR
via geogMask
parameter.
Usage
geogMask(continent = NULL, region = NULL, country = NULL, lon = NULL, lat = NULL,
InDispute = TRUE, verbose = TRUE, plot = FALSE, colPalette = NULL, pch = 15, cex = 1)
Arguments
continent |
|
region |
|
country |
|
lon |
a vector of longitudes with length |
lat |
a vector of latitudes with length |
InDispute |
a logical: should the areas in dispute be considered for
geographic masking by country? If |
verbose |
logical to print processing information if |
plot |
logical to call the plotting method if |
colPalette |
a color palette or a list of colors such as that generated
by |
pch |
Either an integer specifying a symbol or a single character to
be used as the default in plotting points. See |
cex |
A numerical value giving the amount by which plotting symbols should
be magnified relative to the |
Details
In some applications, a user may want to focus on an area that is a
mask-defined subset of the full dataset. For instance, the NASA Tropical
Rainfall Measuring Mission (TRMM) data covers ocean and land, while a
researcher might be interested in the precipitation variability only over
land, a country, or a list of countries (e.g., Nile Basin countries). This
masking capability is supported by the geogMask
helper function.
It requires the longitude (lon
) and latitude (lat
) vectors
together with a string (or array of strings) to specify continent
name(s), region
name(s), or country
ISO3 character code(s) via
either continent
, region
, or country
parameters. Valid
values for them can be obtained by running geogMask()
. World mask data
is based on the HIU Large Scale International Boundaries (LSIB) data
(https://hiu.state.gov/data).
Value
A vector of indices for the spatial elements to be masked,
as required by HiClimR
.
Author(s)
Hamada S. Badr <badr@jhu.edu>, Benjamin F. Zaitchik <zaitchik@jhu.edu>, and Amin K. Dezfuli <amin.dezfuli@nasa.gov>.
References
Hamada S. Badr, Zaitchik, B. F. and Dezfuli, A. K. (2015): A Tool for Hierarchical Climate Regionalization, Earth Science Informatics, 8(4), 949-958, doi: 10.1007/s12145-015-0221-7.
Hamada S. Badr, Zaitchik, B. F. and Dezfuli, A. K. (2014): Hierarchical Climate Regionalization, Comprehensive R Archive Network (CRAN), https://cran.r-project.org/package=HiClimR.
See Also
HiClimR
, HiClimR2nc
, validClimR
,
geogMask
, coarseR
, fastCor
,
grid2D
and minSigCor
.
Examples
require(HiClimR)
## Load test case data
x <- TestCase$x
## Generate longitude and latitude mesh vectors
xGrid <- grid2D(lon = unique(TestCase$lon), lat = unique(TestCase$lat))
lon <- c(xGrid$lon)
lat <- c(xGrid$lat)
## Check the valid options for geographic masking
geogMask()
## geographic mask for Africa
gMask <- geogMask(continent = "Africa", lon = lon, lat = lat, plot = TRUE)