Apertures

All apertures will rely on a position and the shape parameters.

aperture = Aperture(x0, y0, shape_params...)

The position can be pixels or sky coordinates. The sky coordinate positions utilize SkyCoords.jl and WCS.jl for conversion.

Warning

Sky coordinates are not supported yet.

Note

See Pixel Convention - The origin is the bottom-left with (1, 1) being the center of the pixel.

Circular Apertures

These apertures are parametrized by radius.

Photometry.Aperture.CircularApertureType
CircularAperture(x, y, r)
CircularAperture(position, r)

A circular aperture.

A circular aperture with radius r. r must be greater than or equal to 0.

Examples

julia> ap = CircularAperture(0, 0, 10)
CircularAperture(0, 0, r=10)
source
Photometry.Aperture.CircularAnnulusType
CircularAnnulus(x, y, r_in, r_out)
CircularAnnulus(position, r_in, r_out)

A circular annulus with inner radius r_in and outer radius r_out. 0 ≤ r_inr_out.

Examples

julia> ap = CircularAnnulus(0, 0, 5, 10)
CircularAnnulus(0, 0, r_in=5, r_out=10)
source

Elliptical Apertures

These apertures are parametrized by the semi-major axis a, semi-minor axis b and position angle in degrees counter-clockwise from the positive x-axis θ

Photometry.Aperture.EllipticalApertureType
EllipticalAperture(x, y, a, b, θ)
EllipticalAperture(position, a, b, θ)

An elliptical aperture with semi-major axis a, semi-minor axis b, and position angle θ. a and b must be ≥ 0, θ is measured in degrees counter-clockwise the standard x-axis.

Examples

julia> ap = EllipticalAperture(0, 0, 4, 2, 35)
EllipticalAperture(0, 0, a=4, b=2, θ=35°)
source
Photometry.Aperture.EllipticalAnnulusType
EllipticalAnnulus(x, y, a_in, a_out, b_out, θ)
EllipticalAnnulus(position, a_in, a_out, b_out, θ)

An elliptical annulus with inner semi-major axis a_in, outer semi-major axis a_out, outer semi-minor axis b_out, and position angle θ. a_outa_in ≥ 0 and b_out must be ≥ 0, θ is measured in degrees counter-clockwise the standard x-axis.

b_in will automatically be calculated from (a_in / a_out) * b_out. Note this may cause a type instability.

Examples

julia> ap = EllipticalAnnulus(0, 0, 4, 10, 5, 45)
EllipticalAnnulus(0.0, 0.0, a_in=4.0, a_out=10.0, b_in=2.0, b_out=5.0, θ=45.0°)
source

Rectangular Apertures

These apertures are parametrized by width w, height h, and position angle in degrees counter-clockwise from the positive x-axis θ.

Photometry.Aperture.RectangularApertureType
RectangularAperture(x, y, w, h, θ)
RectangularAperture(position, w, h, θ)

A rectangular aperture.

A rectangular aperture with width w, height h, and position angle θ in degrees.

Examples

julia> ap = RectangularAperture(0, 0, 10, 4, 0)
RectangularAperture(0, 0, w=10, h=4, θ=0°)
source
Photometry.Aperture.RectangularAnnulusType
RectangularAnnulus(x, y, w_in, w_out, h_out, θ)
RectangularAnnulus(position, w_in, w_out, h_out, θ)

A rectangular annulus with inner width w_in, outer width w_out, outer height h_out, and position angle θ in degrees. h_in is automatically calculated from w_in / w_out * h_out. Note that w_out ≥ w_in > 0.

Examples

julia> ap = RectangularAnnulus(0, 0, 5, 10, 8, 45)
RectangularAnnulus(0.0, 0.0, w_in=5.0, w_out=10.0, h_in=4.0, h_out=8.0, θ=45.0°)
source

API/Reference

Photometry.Aperture.cutoutFunction
cutout(::AbstractAperture, data)

Get the cutout of the aperture from the data. This will handle partial overlap by padding the data with zeros.

source