List of APIs for RegionGrids.jl
RegionGrids.GeneralizedGrid Type
GeneralizedGridA GeneralizedGrid is a RegionGrid that is created based on longitude/latitude grids that are not rectilinear - this can range from curvilinear grids to unstructured grids. It has its own subtypes: RegionMask and VectorMask.
All GeneralizedGrid type will contain the following fields:
lon- A Matrix ofFloats, defining the longitudes for each point in the RegionGrid that describe the region.lat- A Matrix ofFloats, defining the latitude for each point in the RegionGrid that describe the region.ilon- A Vector ofInts, defining the indices used to extract the longitude vector from the input longitude vector.ilat- A Vector ofInts, defining the indices used to extract the latitude vector from the input latitude vector.mask- An Array of NaNs and 1s, defining the gridpoints in the RegionGrid where the data is valid.
RegionGrids.RectilinearGrid Type
RectilinearGrid <: RegionGridA RectilinearGrid is a RegionGrid that is created based on rectilinear longitude/latitude grids. It has its own subtypes: RectGrid, TiltGrid and PolyGrid.
All RectilinearGrid types contain the following fields:
lon- A Vector ofFloats, defining the longitude vector describing the region.lat- A Vector ofFloats, defining the latitude vector describing the region.ilon- A Vector ofInts, defining the indices used to extract the longitude vector from the input longitude vector.ilat- A Vector ofInts, defining the indices used to extract the latitude vector from the input latitude vector.mask- An Array of NaNs and 1s, defining the gridpoints in the RegionGrid where the data is valid.
RegionGrids.RegionGrid Type
RegionGridAbstract supertype for geographical region gridded information. All RegionGrids will contain the following fields:
lon- A Vector or Matrix ofFloats, defining the longitude grids describing the region.lat- A Vector or Matrix ofFloats, defining the latitude grids describing the region.weights- An Vector or Matrix ofFloats, defining the latitude-weights of each valid point in the grid. Will be NaN if outside the bounds of the GeoRegion used to define this RectilinearGrid.X- A Vector or Matrix ofFloats, defining the X-coordinates (in meters) of each point in the "derotated" RegionGrid about the centroid for the shape of the GeoRegion.Y- A Vector or Matrix ofFloats, defining the Y-coordinates (in meters) of each point in the "derotated" RegionGrid about the centroid for the shape of the GeoRegion.θ- AFloatstoring the information on the angle (in degrees) about which the data was rotated in the anti-clockwise direction. Mathematically, it isrotation - geo.θ.
RegionGrids.RegionGrid Method
RegionGrid(
geo :: GeoRegion,
lon :: Union{Vector{<:Real},AbstractRange{<:Real},
lat :: Union{Vector{<:Real},AbstractRange{<:Real};
rotation :: Real = 0,
sigdigits :: Int = 10
) -> ggrd :: RectilinearGridCreates a RectilinearGrid type based on the following arguments. This method is suitable for rectilinear grids of longitude/latitude output such as from Isca, or from satellite and reanalysis gridded datasets.
Arguments
geo: A GeoRegion of interest.lon: A vector orAbstractRangecontaining the longitude points.lat: A vector orAbstractRangecontaining the latitude points.
Keyword Arguments
rotation: Angle (in degrees) of rotation for the final "derotated" data about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θwill turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
ggrd: ARectilinearGrid.
RegionGrids.RegionGrid Method
RegionGrid(
geo :: GeoRegion,
pnts :: Vector{Point2{FT}};
rotation :: Real = 0,
sigdigits :: Int = 10
) where FT <: Real -> ggrd :: UnstructuredGridCreates a UnstructuredGrid type. This method is more suitable for unstructured grids and mesh grid of longitude and latitude points, such as in the output of CESM2 when it is run in the cubed-sphere configuration.
Arguments
geo: A GeoRegion of interest.pnts: AVectorofPoint2(lon,lat)types.
Keyword Arguments
rotation: Angle (in degrees) of rotation for the final "derotated" data about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θwill turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
ggrd: AUnstructuredGrid.
RegionGrids.RegionGrid Method
RegionGrid(
geo :: GeoRegion,
pnts :: Array{Point2{FT}};
rotation :: Real = 0,
sigdigits :: Int = 10
) where FT <: Real -> ggrd :: GeneralizedGridCreates a GeneralizedGrid type based on the following arguments. This method is more suitable for structured non-rectilinear (e.g., curvilinear) grids of longitude and latitude points, such as in the output of WRF.
Arguments
geo: A GeoRegion of interest.pnts: An array ofPoint2(lon,lat)types.
Keyword Arguments
rotation: Angle (in degrees) of rotation for the final "derotated" data about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θwill turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
ggrd: AGeneralizedGrid.
RegionGrids.UnstructuredGrid Type
UnstructuredGridA UnstructuredGrid is a RegionGrid that is created based on an unstructured grid often used in cubed-sphere or unstructured-mesh grids.
All UnstructuredGrid type will contain the following fields:
lon- A vector ofFloats, defining the longitudes for each point in the RegionGrid that describe the region.lat- A vector ofFloats, defining the latitude for each point in the RegionGrid that describe the region.ipoint- A Vector ofInts, defining the indices of the valid points from the original unstructured grid that were extracted into the RegionGrid.
RegionGrids.extract! Method
extract!(
ndata :: AbstractArray{<:Real},
odata :: AbstractArray{<:Real},
ggrd :: GeneralizedGrid
) -> nothingExtracts data from odata, an Array of dimension N (where N ∈ 2,3,4) that contains data of a Parent GeoRegion, into ndata, another Array of dimension N, containing only within a sub GeoRegion we are interested in.
This allows for iterable in-place modification to save memory space and reduce allocations if the dimensions are fixed.
Warning
Please ensure that the 1st dimension is longitude and 2nd dimension is latitude before proceeding. The order of the 3rd and 4th dimensions (when used), however, is not significant.
Arguments
ndata: An array of dimension N meant as a placeholder for the extracted data to minimize allocations.odata: An array of dimension N containing gridded data in the region we are interesting in extracting from.ggrd: ARegionGridcontaining detailed information on what to extract.
RegionGrids.extract! Method
extract!(
ndata :: AbstractArray{<:Real},
odata :: AbstractArray{<:Real},
ggrd :: RectilinearGrid
) -> nothingExtracts data from odata, an Array of dimension N (where N ∈ 2,3,4) that contains data of a Parent GeoRegion, into ndata, another Array of dimension N, containing only within a sub GeoRegion we are interested in.
This allows for iterable in-place modification to save memory space and reduce allocations if the dimensions are fixed.
Warning
Please ensure that the 1st dimension is longitude and 2nd dimension is latitude before proceeding. The order of the 3rd and 4th dimensions (when used), however, is not significant.
Arguments
ndata: An array of dimension N meant as a placeholder for the extracted data to minimize allocations.odata: An array of dimension N containing gridded data in the region we are interesting in extracting from.ggrd: ARegionGridcontaining detailed information on what to extract.
RegionGrids.extract! Method
extract!(
ndata :: AbstractVector{<:Real},
odata :: AbstractVector{<:Real},
ggrd :: UnstructuredGrid
) -> nothingExtracts data from odata, an Array of dimension N (where N ∈ 2,3,4) that contains data of a Parent GeoRegion, into ndata, another Array of dimension N, containing only within a sub GeoRegion we are interested in.
This allows for iterable in-place modification to save memory space and reduce allocations if the dimensions are fixed.
Warning
Please ensure that the 1st dimension is longitude and 2nd dimension is latitude before proceeding. The order of the 3rd and 4th dimensions (when used), however, is not significant.
Arguments
ndata: An array of dimension N meant as a placeholder for the extracted data to minimize allocations.odata: An array of dimension N containing gridded data in the region we are interesting in extracting from.ggrd: AUnstructuredGridcontaining detailed information on what to extract.
RegionGrids.extract Method
extract(
odata :: AbstractArray{<:Real},
ggrd :: GeneralizedGrid
) -> Array{<:Real}Extracts data from odata, an Array that contains data of a Parent GeoRegion, into another Array of dimension N, containing only within a sub GeoRegion we are interested in.
Warning
Please ensure that the 1st dimension is longitude and 2nd dimension is latitude before proceeding. The order of the 3rd and 4th dimensions (when used), however, is not significant.
Arguments
odata: An array of dimension N containing gridded data in the region we are interesting in extracting from.ggrd: ARegionGridcontaining detailed information on what to extract.
RegionGrids.extract Method
extract(
odata :: AbstractArray{<:Real},
ggrd :: RectilinearGrid
) -> Array{<:Real}Extracts data from odata, an Array that contains data of a Parent GeoRegion, into another Array of dimension N, containing only within a sub GeoRegion we are interested in.
Warning
Please ensure that the 1st dimension is longitude and 2nd dimension is latitude before proceeding. The order of the 3rd and 4th dimensions (when used), however, is not significant.
Arguments
odata: An array of dimension N containing gridded data in the region we are interesting in extracting from.ggrd: ARegionGridcontaining detailed information on what to extract.
RegionGrids.extract Method
extract(
odata :: AbstractVector{<:Real},
ggrd :: UnstructuredGrid
) -> Array{<:Real}Extracts data from odata, an Array that contains data of a Parent GeoRegion, into another Array of dimension N, containing only within a sub GeoRegion we are interested in.
Warning
Please ensure that the 1st dimension is longitude and 2nd dimension is latitude before proceeding. The order of the 3rd and 4th dimensions (when used), however, is not significant.
Arguments
odata: An array of dimension N containing gridded data in the region we are interesting in extracting from.ggrd: A.UnstructuredGridcontaining detailed information on what to extract.