Build Status | Code Coverage |
---|---|
AstroImage.jl
allows you to plot images from an
astronomical FITS
file using the
popular Images.jl
and Plots.jl
Julia packages.
AstroImage.jl
uses FITSIO.jl
to
read FITS files.
AstroImage.jl
is available for Julia 0.7 and later versions, and can be
installed with Julia built-in package
manager. This packages is not
yet registered, after entering into the package manager by pressing ]
run the
command
pkg> add https://github.com/JuliaAstro/AstroImages.jl
After installing the package, you can start using it with
julia> using AstroImages
You can load and read the the first extension of a FITS file with the load
function, from FileIO.jl
:
julia> load("file.fits")
1300×1200 Array{UInt16,2}:
[...]
The second argument of this load
method is the number of the extension to
read. Read the third extension of the file with:
julia> load("file.fits", 3)
1300×1200 Array{UInt16,2}:
[...]
The package provides a new type, AstroImage
to integrate FITS images with
Julia packages for plotting and image processing. The AstroImage
function has
the same syntax as load
. This command:
julia> img = AstroImage("file.fits")
AstroImages.AstroImage{UInt16,ColorTypes.Gray}[...]
will read the first extension from the file.fits
file and wrap its content in
a Matrix{Gray}
, that can be easily used with Images.jl
and related packages.
If you are working in a Jupyter notebook, an AstroImage
object is
automatically rendered as a PNG image.
An AstroImage
object can be plotted with Plots.jl
package. Just use
julia> using Plots
julia> plot(img)
and the image will be displayed as a heatmap using your favorite backend.
The AstroImages.jl
package is licensed under the MIT "Expat" License. The
original author is Mosè Giordano.