Utilities
The following routines are general utility or otherwise don't fit into a category
Index
HCIToolbox.mask_annulus
HCIToolbox.mask_annulus!
HCIToolbox.mask_circle
HCIToolbox.mask_circle!
HCIToolbox.normalize_par_angles
HCIToolbox.normalize_par_angles!
HCIToolbox.radial_profile
API/Reference
HCIToolbox.mask_circle
— Functionmask_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
HCIToolbox.mask_circle!
— Functionmask_circle!(::AbstractMatrix, npix; fill=0, center=center(arr))
mask_circle!(::AbstractArray, npix; fill=0, center=center(arr))
In-place version of mask_circle
HCIToolbox.mask_annulus
— Functionmask_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
HCIToolbox.mask_annulus!
— Functionmask_annulus!(::AbstractMatrix, npix_in, npix_out; fill=0, center=center(arr))
In-place version of mask_annulus
HCIToolbox.normalize_par_angles
— Functionnormalize_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
HCIToolbox.normalize_par_angles!
— Functionnormalize_par_angles!(angles)
In-place version of normalize_par_angles
HCIToolbox.radial_profile
— Functionradial_profile(image; center=center(image))
Calculates the radial profile of image
, centered around center
. Returns the radii and corresponding profile.
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])