Skip to content

giordano/AstroImages.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AstroImages.jl

Build Status Code Coverage
Build Status
Build Status

Introduction

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.

Installation

AstroImage.jl is available for Julia 0.7 and later versions, and can be installed with Julia built-in package manager. This is not yet registered, so in a Julia session run the command

julia> Pkg.clone("https://github.com/JuliaAstro/AstroImages.jl")

Usage

After installing the package, you can start using it with

julia> using AstroImages

Reading extensions from FITS file

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}:
[...]

AstroImage type

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.

Plotting an AstroImage

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.

License

The AstroImages.jl package is licensed under the MIT "Expat" License. The original author is Mosè Giordano.

About

Visualization of astronomical images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages

  • Julia 100.0%