Skip to content

List of APIs for RegionGrids.jl

RegionGrids.GeneralizedGrid Type
julia
GeneralizedGrid

A 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 of Floats, defining the longitudes for each point in the RegionGrid that describe the region.

  • lat - A Matrix of Floats, defining the latitude for each point in the RegionGrid that describe the region.

  • ilon - A Vector of Ints, defining the indices used to extract the longitude vector from the input longitude vector.

  • ilat - A Vector of Ints, 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.

source
RegionGrids.RectilinearGrid Type
julia
RectilinearGrid <: RegionGrid

A 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 of Floats, defining the longitude vector describing the region.

  • lat - A Vector of Floats, defining the latitude vector describing the region.

  • ilon - A Vector of Ints, defining the indices used to extract the longitude vector from the input longitude vector.

  • ilat - A Vector of Ints, 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.

source
RegionGrids.RegionGrid Type
julia
RegionGrid

Abstract supertype for geographical region gridded information. All RegionGrids will contain the following fields:

  • lon - A Vector or Matrix of Floats, defining the longitude grids describing the region.

  • lat - A Vector or Matrix of Floats, defining the latitude grids describing the region.

  • weights - An Vector or Matrix of Floats, 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 of Floats, 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 of Floats, defining the Y-coordinates (in meters) of each point in the "derotated" RegionGrid about the centroid for the shape of the GeoRegion.

  • θ - A Float storing the information on the angle (in degrees) about which the data was rotated in the anti-clockwise direction. Mathematically, it is rotation - geo.θ.

source
RegionGrids.RegionGrid Method
julia
RegionGrid(
    geo :: GeoRegion,
    lon :: Union{Vector{<:Real},AbstractRange{<:Real},
    lat :: Union{Vector{<:Real},AbstractRange{<:Real};
    rotation  :: Real = 0,
    sigdigits :: Int = 10
) -> ggrd :: RectilinearGrid

Creates 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 or AbstractRange containing the longitude points.

  • lat : A vector or AbstractRange containing 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 to geo.θ will turn the final values about the centroid in the anti-clockwise direction. Default is 0.

Returns

  • ggrd : A RectilinearGrid.
source
RegionGrids.RegionGrid Method
julia
RegionGrid(
    geo  :: GeoRegion,
    pnts :: Vector{Point2{FT}};
    rotation  :: Real = 0,
    sigdigits :: Int = 10
) where FT <: Real -> ggrd :: UnstructuredGrid

Creates 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 : A Vector of Point2(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 to geo.θ will turn the final values about the centroid in the anti-clockwise direction. Default is 0.

Returns

  • ggrd : A UnstructuredGrid.
source
RegionGrids.RegionGrid Method
julia
RegionGrid(
    geo  :: GeoRegion,
    pnts :: Array{Point2{FT}};
    rotation  :: Real = 0,
    sigdigits :: Int = 10
) where FT <: Real -> ggrd :: GeneralizedGrid

Creates 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 of Point2(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 to geo.θ will turn the final values about the centroid in the anti-clockwise direction. Default is 0.

Returns

  • ggrd : A GeneralizedGrid.
source
RegionGrids.UnstructuredGrid Type
julia
UnstructuredGrid

A 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 of Floats, defining the longitudes for each point in the RegionGrid that describe the region.

  • lat - A vector of Floats, defining the latitude for each point in the RegionGrid that describe the region.

  • ipoint - A Vector of Ints, defining the indices of the valid points from the original unstructured grid that were extracted into the RegionGrid.

source
RegionGrids.extract! Method
julia
extract!(
    ndata :: AbstractArray{<:Real},
    odata :: AbstractArray{<:Real},
    ggrd  :: GeneralizedGrid
) -> nothing

Extracts 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 : A RegionGrid containing detailed information on what to extract.

source
RegionGrids.extract! Method
julia
extract!(
    ndata :: AbstractArray{<:Real},
    odata :: AbstractArray{<:Real},
    ggrd  :: RectilinearGrid
) -> nothing

Extracts 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 : A RegionGrid containing detailed information on what to extract.

source
RegionGrids.extract! Method
julia
extract!(
    ndata :: AbstractVector{<:Real},
    odata :: AbstractVector{<:Real},
    ggrd  :: UnstructuredGrid
) -> nothing

Extracts 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 : A UnstructuredGrid containing detailed information on what to extract.

source
RegionGrids.extract Method
julia
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 : A RegionGrid containing detailed information on what to extract.

source
RegionGrids.extract Method
julia
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 : A RegionGrid containing detailed information on what to extract.

source
RegionGrids.extract Method
julia
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. UnstructuredGrid containing detailed information on what to extract.

source