CCDReduction.jl

This package provides tools for basic reduction methods of CCD images.

GitHub Build Status PkgEval Codecov License

Installation

From Julia enter Pkg mode

julia>]

(1.3) pkg> add CCDReduction

Usage

You'll recognize most of the familiar reduction operations allow us to quickly and easily operate on data.

using CCDReduction

noise = randn(512, 512)
bias_frame = reshape(1:262144, 512, 512) |> collect
img = reshape(1:262144, 512, 512) .+ noise

subtract_bias(img, bias_frame)

In addition to working on array-like data, we can directly load from a FITSIO.ImageHDU or from a filename

using FITSIO

# make fits file
bias_frame = reshape(1:262144, 512, 512) |> collect
FITS("master_bias.fits", "w") do f
    write(f, bias_frame)
end
img = 10 .* randn(512, 512)
debiased = subtract_bias(img, "master_bias.fits")

Finally, we can use function chaining (or tools like Underscores.jl) for creating a simple processing pipeline!

using Underscores

# 5 science frames
imgs = (10 .* randn(512, 524) for _ in 1:5)

# create pipeline using Underscores.jl
pipeline(img) = @_ img |>
    subtract_overscan(__, (:, 513:524)) |>
    trim(__, (:, 513:524)) |>
    subtract_bias(__, "master_bias.fits")

# apply pipeline to images using broadcast syntax
calib_imgs = pipeline.(imgs)

License

This work is distributed under the MIT "expat" license. See LICENSE for more information.