Introduction

FITSFiles.jl is a Julia implementation of the Flexible Image Transport System (FITS) file IO standard.

FITSFiles.fitsMethod
fits(io::IO; <keywords>)
fits(filename::AbstractString; <keywords>)

Open and read a FITS file, returning a vector of header-data units (HDUs).

The default data stucture for Random and Bintable HDUs is a named tuple of arrays.

Keywords

  • record::Bool=false: structure the data as a list of records
  • scale::Bool=true: apply the scale and zero keywords to the data
source
FITSFiles.infoMethod
info(hdus::Vector{HDU})

Briefly describe the list of header-data units (HDUs).

source
FITSFiles.writeMethod

write(io::IO, hdus::Vector{HDU}) write(filename::AbstractString, hdus::Vector{HDU})

Write a vector of header-data units (HDUs) to a file.

source
FITSFiles.BintableType
Bintable header-data unit (HDU)

A Bintable HDU consists of a vector of cards and optionally a 2-dimensional array of binary data structured as a vector of records.

source
FITSFiles.HDUType
HDU{T}(cards, data)
HDU([data, [cards]]; <keywords>)
HDU(cards; <keywords>)
HDU(type, nothing, [cards]; <keywords>)
HDU(type, data, [cards]; <keywords>)

Create an header-data unit described by data and cards of type AbstractHDU.

The HDU function tries to determine the HDU type based on the data and cards. If only data is provided, then an array is interpreted as a Primary HDU and a Tuple or NamedTuple as a BinaryTable. If mandatory cards are provided, then they are used to determine the HDU type. Otherwise, the HDU type must be specified.

HDU types are: Primary, Random, Image, Table, Bintable, and Conform.

arguments

  • data::U=nothing: the binary or ASCII data, where U<:Union{AbstractArray, Tuple, NamedTuple, Nothing}
  • cards::U=nothing: the list of cards, where U<:Union{Card, Vector{Card}, Nothing}

Keywords

  • record::Bool=false: structure the data as a list of records
  • scale::Bool=true: apply the scale and zero keywords to the data
  • append::Bool=false: append CONTINUE cards for long strings (>68 characters)
  • fixed::Bool=true: create fixed format cards
  • slash::Integer=32: character index of the comment separator (/)
  • lpad::Integer=1: number of spaces before the comment separator
  • rpad::Integer=1: number of spaces after the comment separator
  • truncate::Bool=true: truncate the comment string at the end of the card
source
FITSFiles.ImageType
Image header-data unit (HDU)

An Image HDU consists of a vector cards and optionally a multidimensional array (<=999 dimensions).

source
FITSFiles.PrimaryType
Primary header-data unit (HDU)

A Primary HDU consists of a vector of cards and optionally a multidimensional array (<=999 dimensions). The Primary HDU is the first HDU in a vector of HDUs.

source
FITSFiles.RandomType
Random header-data unit (HDU)

A Random HDU consists of a vector of cards and optionally a vector of records containing a list of parameters followed by a multidimensional array. The Random HDU is the first HDU in a vector of HDUs.

source
FITSFiles.TableType
Table header-data unit (HDU)

A Table HDU consists of a vector of cards and optionally a 2-dimensional array of ASCII data structured as vector of records.

source
FITSFiles.typeofhduMethod
typeofhdu(data)
typeofhdu(dict)
typeofhdu(data, dict)

Determine the HDU type based on the data structure, the mandatory keywords, or both.

source
FITSFiles.CardType
Card(type, key, value, comment, format)
Card([key, [value, [comment]]]; <keywords>)
Card("HIERARCH", key, [key, [value, [comment]]]; <keywords>)

Create a card type, where type is Comment, End, Hierarch, History, Invalid, or Value{T}.

Argments

  • key::AbstractString="": keyword string
  • value::U=missing: keyword value, where U is Bool, Number, or String
  • comment::AbstractString="": comment string

Keywords

  • append::Bool=false: append CONTINUE cards for long strings (>68 characters)
  • fixed::Bool=true: use fixed format
  • slash::Integer=32: index of comment separator (/)
  • lpad::Integer=1: number of spaces before comment separator
  • rpad::Integer=1: number of spaces after comment separator
  • truncate::Bool=true: truncate comment at end of card
source
FITSFiles.join_cardsMethod
join_cards(cards)

Join CONTINUE cards to initial long string card to create a long value and comment card

source
FITSFiles.split_cardMethod
split_card(key, value, comment, format)

Split card having long value and comment fields into multiple cards

If length of comment field is 0 because comment separator index is too large, then comment is deleted. Decreasing comment separator index will allow inclusion of comment.

source