Miscellaneous functions

Functions here are usually general "helper" or "utility" type functions that a likely used throughout different parts of RetrievalToolbox.

RetrievalToolbox.FWHM_to_sigmaMethod
FWHM_to_sigma(FWHM::Number) -> Any

Calculates the standard deviation of a Gaussian for a given full width at half the maximum value.

RetrievalToolbox.check_for_not_finiteMethod
check_for_not_finite(x::AbstractArray) -> Bool

For an array x, returns true if any element is not finite (as per isfinite), or false if all elements are finite.

RetrievalToolbox.findanyMethod
findany(x::AbstractVector, a) -> Bool

Returns true if a is found within x, does not allocate.

Examples

julia> findany(["a", "b", "c", "d"], "b")
true
julia> findany([1,2,3,4,5], 10)
false
RetrievalToolbox.findanytypeMethod
findanytype(x::AbstractVector, T) -> Bool

Returns true if any element within x is of type T, does not allocate.

RetrievalToolbox.ingest!Method
ingest!(obj, field::Symbol, val::AbstractArray)

Sets a RetrievalToolbox type field and applies the correct unit conversion. This is the specialized function to deal with array-type values. This should be mostlya allocation-free.

Details

RetrievalToolbox.ingest!Method
ingest!(obj, field::Symbol, val::Number)

Sets a RetrievalToolbox type field and applies the correct unit conversion

Details

RetrievalToolbox.levels_to_layers!Method
levels_to_layers!(
    layers::AbstractVector,
    levels::AbstractVector;
    logspace
)

For a given level vector, calculate the mid-layer values and store into layers. This function assumes that the layer-value is evaluated at the center point between the two adjacent levels.

RetrievalToolbox.levels_to_layersMethod
levels_to_layers(levels::AbstractVector; logspace) -> Any

For a given level object, create a new vector that contains the mid-layer vector. This function assumes that the layer-value is evaluated at the center point between the two adjacent levels.

RetrievalToolbox.maxminMethod
maxmin(x::AbstractArray) -> Any

For an array x, returns the difference between the largest and smallest element maximum(x) - minimum(x).