Utilities

The following routines are general utility or otherwise don't fit into a category

Index

API/Reference

HCIToolbox.mask_circleFunction
mask_circle(::AbstractMatrix, npix; fill=0, center=center(arr))
mask_circle(::AbstractArray, npix; fill=0, center=center(arr))

Mask the inner-circle of an image with radius npix with value fill. Note that the input type must be compatible with the fill value's type. If the input is a cube it will mask each frame individually.

See Also

mask_circle!

source
HCIToolbox.mask_circle!Function
mask_circle!(::AbstractMatrix, npix; fill=0, center=center(arr))
mask_circle!(::AbstractArray, npix; fill=0, center=center(arr))

In-place version of mask_circle

source
HCIToolbox.mask_annulusFunction
mask_annulus(::AbstractMatrix, npix_in, npix_out; fill=0, center=center(arr))

Mask an annular region of an image with inner-radius npix_in, outer-radius npix_out with value fill. Note that the input type must be compatible with the fill value's type.

See Also

mask_annulus!

source
HCIToolbox.normalize_par_anglesFunction
normalize_par_angles(angles)

Ensures parallactic angle list (in degrees) is positive monotonic with no jumps greater than 180°.

Examples

julia> normalize_par_angles([-10, 20, 190])
3-element Vector{Int64}:
 350
  20
 190
source
HCIToolbox.radial_profileFunction
radial_profile(image; center=center(image))

Calculates the radial profile of image, centered around center. Returns the radii and corresponding profile.

Understanding bin edges

The radii returned here are integral, for example [0, 1, 2, ...]. These are equivalent to the centers of the contours of an annulus between r - 0.5, r + 0.5 pixels. These annuli are centered on pixels (at least those orthogonal to the axes).

Examples

julia> X = [0 1 1 1 0
            1 2 2 2 1
            1 2 3 2 1
            1 2 2 2 1
            0 1 1 1 0];

julia> r, prof = radial_profile(X);

julia> r .=> prof # radius => value
4-element Vector{Pair{Int64, Float64}}:
 0 => 3.0
 1 => 2.0
 2 => 1.0
 3 => 0.0

julia> radial_profile([1 2; 2 2], center=(1, 1))
([0, 1], [1.0, 2.0])
source