Function index for RasterHistograms

RasterHistograms exported functions

RasterHistograms.RasterLayerHistogramType
mutable struct RasterLayerHistogram <: AbstractRasterHistogram

A RasterLayerHistogram. The struct is mutable so that the histogram field can be updated using the normalize (or otherwise) function.

  • layer::Any: The layer (variable) from the Raster

  • dimensions::Any: The dimensions of the Raster

  • raster_size::Any: The size of the Raster

  • histogram::StatsBase.Histogram: The 1-dimensional histogram fitted to the Raster layer data

source
RasterHistograms.RasterLayerHistogramMethod
function RasterLayerHistogram(rs::Raster; closed = :left, nbins = nothing)
function RasterLayerHistogram(rs::Raster, weights::AbstractWeights;
                              closed = :left, nbins = nothing)
function RasterLayerHistogram(rs::Raster, edges::AbstractVector; closed = :left)
function RasterLayerHistogram(rs::Raster, weights::AbstractWeights,
                              edges::AbstractVector; closed = :left)

Construct a RasterLayerHistogram from a Raster. The flattened Raster data, with the missing values removed, is passed to the fit(::Histogram) function from StatsBase.jl and a RasterLayerHistogram type is returned.

source
RasterHistograms.RasterSeriesHistogramType
mutable struct RasterSeriesHistogram <: AbstractRasterHistogram

A RasterSeriesHistogram where the childs of the RasterSeries are RasterStacks or Rasters. The struct is mutable so that the histogram field can be updated using the normalize (or otherwise) function.

  • layers::Any: The layers (variables) from the RasterSeries used to fit the Histogram

  • series_dimension::Any: The dimension of the RasterSeries (usually this will be time)

  • series_length::Any: The length of the `RasterSeries

  • dimensions::Any: The dimensions of the elements (either a Raster or RasterStack) of the RasterSeries

  • raster_size::Any: The size of the elements (either a Raster or RasterStack) of the RasterSeries

  • histogram::StatsBase.Histogram: The N-dimensional Histogram fitted to the N layers from RasterSeries

source
RasterHistograms.RasterSeriesHistogramMethod
function RasterSeriesHistogram(series::RasterSeries, edges::NTuple{N, AbstractVector};
                               closed = :left)
function RasterSeriesHistogram(series::RasterSeries, weights::AbstractWeights,
                               edges::NTuple{N, AbstractVector}; closed = :left)

Construct a RasterSeriesHistogram from a RasterSeries. Note that to merge Histograms the bin edges must be the same, so for this constructor the edges must be passed in. This constructor assumes that the dimensions are the same across all RasterStacks in the RasterSeries.

source
RasterHistograms.RasterStackHistogramType
mutable struct RasterStackHistogram <: AbstractRasterHistogram

A RasterStackHistogram. The struct is mutable so that the histogram field can be updated using the normalize (or otherwise) function.

  • layers::Any: The layers (variables) from the RasterStack used to fit the Histogram

  • dimensions::Any: The dimensions of the RasterStack

  • raster_size::Any: The size of the RasterStack layers

  • histogram::StatsBase.Histogram: The N-dimensional Histogram fitted to the N layers from RasterStack

source
RasterHistograms.RasterStackHistogramMethod
function RasterStackHistogram(stack::RasterStack; closed = :left, nbins = nothing)
function RasterStackHistogram(stack::RasterStack, weights::AbstractWeights;
                              closed = :left, nbins = nothing)
function RasterStackHistogram(stack::RasterStack, edges::NTuple{N, AbstractVector};
                              closed = :left)
function RasterStackHistogram(stack::RasterStack, weights::AbstractWeights,
                              edges::NTuple{N, AbstractVector}; closed = :left)

Construct a RasterStackHistogram from a RasterStack. The resulting Histogram is N-dimensional, where N is the number of layers. The flattened Raster data for each layer, with themissing values removed, is passed to the fit(::Histogram) function from StatsBase.jl and a RasterStackHistogram type is returned.

source
LinearAlgebra.normalize!Method
function normalize!(arh::AbstractRasterHistogram; mode::Symbol = :pdf)

Normalize the Histogram in the AbstractRasterHistogram according the desired mode. See the StatsBase.jl docs for information on the possible modes and how they work.

source
MakieCore.convert_argumentsFunction
function convert_arguments(P::Type{<:AbstractPlot}, arh::AbstractRasterHistogram)

Converting method so Makie.jl can plot an AbstractRasterHistogram. Note for plotting purposes a value correspnding to zero is replaced with NaN. This is to avoid in 2D plotting many zero values and as a result not seeing the distribtution clearly (in Makie.kj heatmap the NaN value is left out in plotting).

source
RasterHistograms.area_weightsMethod
function area_weights(rs::Union{Raster, RasterStack}; equator_one_degree = 111e3)

Return the Weights for a Histogram calculated from the area of each grid cell in a Raster or RasterStack. The Raster or RasterStack must first be sliced over the dimensions one wishes to look at, e.g. for area weights at sea surface the function need rs[Z(1)] to be passed in. If the original Raster only has two spatial dimensions then this step may be skipped. The keyword argument equator_one_degree is one degree at the equator in metres. The function returns a container Weights so can be passed straight into the fit(::Histogram) function.

source
RasterHistograms.volume_weightsMethod
function volume_weights(rs::Union{Raster, RasterStack}; equator_one_degree = 111e3)

Return the Weights for a Histogram calculated from the volume of each grid cell in a Raster or RasterStack. The model resolution is inferred from the X and Y dimensions of the Raster or RasterStack and assumes that along the X and Y the resolution is unique (though it can be different for X and Y). The keyword argument equator_one_degree is one degree at the equator in metres. The function returns a container Weights so can be passed straight into the fit(::Histogram) function.

source

RasterHistograms private functions

RasterHistograms.find_stack_non_missingMethod
function find_stack_non_missing(stack::RasterStack)

Return a Raster of type Bool that contains the intersection of the non-missing values from the layers of a RasterStack.

source