hdu = file[pred]
can be used to retrieve the first HDU of the FITSfile
for which predicate functionpred
is true.
-
read!(dict::AbstractDict,hdu::FitsTableHDU,...)
merges some columns of the FITS table inhdu
with the contents ofdict
but no longer deletes existing contents ofdict
. Callread!(empty!(dict),hdu,...)
for that. -
merge!(dict::AbstractDict,hdu::FitsTableHDU,...)
to merge some columns of the FITS table inhdu
with the contents ofdict
is no longer supported as it is inconsistent with the ususal meaning ofmerge!
. Callread!(dict,hdu,...)
instead. -
push!(vec::AbstractVector,hdu::FitsTableHDU,...)
to append some columns of the FITS table inhdu
to the vectorvec
is no longer supported as it is inconsistent with the usual meaning ofpush!
. Callappend!(vec, read(Vector,hdu,...))
instead.
Deprecate some methods that are either redundant with shorter calls or which do not implement the usual behavior of a base method:
-
Deprecate
hdu = write(T::Type{<:FitsHDU},file::FitsFile,...)
in favor ofhdu = T(file,...)
because (i) it is shorter to directly call the constructor, (ii) creating the HDU does not actually write something to the file (this is deferred until data is written or another HDU is created), and (iii) is is unusual in Julia to store the value returned by awrite
call in a variable for further use. -
Deprecate
file = open(FitsFile,filename,...)
in favor offile = openfits(filename,...)
orfile = FitsFile(filename,...)
. -
Deprecate
read([R::Type,]FitsFile,filename,...)
in favor ofreadfits([R::Type,],filename,...)
. -
Deprecate
read!(dest,FitsFile,filename,...)
in favor ofreadfits!(dest,filename,...)
. -
Deprecate
write(FitsFile,filename,...)
andwrite!(FitsFile,filename,...)
in favor ofwritefits(filename,...)
andwritefits!(filename,...)
. -
Deprecate
openfits
method in favor of constructorFitsFile
.
-
Avoid an ambiguity: union
EasyFITS.ColumnIdent
is for specifying a single column while unionEasyFITS.Columns
is for specifying several columns. -
Fix
Base.show
andBase.length
for closedFitsFile
(solves issue #10). -
Extend
Base.haskey
forFitsFile
. -
Restrict version of
CFITSIO_jll
to solve CFITSIO bug related to non-US locales (solves issue #7).
-
HDUs are created using their constructor,
FitsImageHDU
orFitsTableHDU
. Users should replace calls likewrite(file,FitsImageHDU{T},dims)
byFitsImageHDU{T}(file,dims)
and calls likewrite(file,FitsTableHDU,cols)
byFitsTableHDU{T}(file,cols)
. -
Calling an HDU constructor to retrieve the HDU of a specific extension in a FITS file is no longer supported. Users should use the
file[ext]
syntax or call thegetindex
base method, possibly, with a type assertion. For example writefile[ext]::FitsImageHDU{Float32,3}
instead ofFitsImageHDU{Float32,3}(file,ext)
.
FITSHeaders
is an official package.
- Update compatibility for
TypeUtils
.
- Add property
hdu.data_axes
for FITS Image HDUs.
-
Can read columns with given number of dimensions.
-
Column data dimensions are considered in a more flexible way: the last array dimension is the row index, the other leading dimensions are the cell dimensions. For columns of strings, the first cell dimension is not smaller than the maximal number of bytes (ASCII characters) of any string in that column. The cell dimensions are considered to be the same if the leading dimensions are equal and the extra trailing dimensions, if any, are all ones.
-
Package
FITSBase
has been renamed asFITSHeaders
.
- Columns of strings in FITS tables:
- An error is raised when attempting to write strings longer than the maximal length in a column of strings. The previous behavior was to truncate the strings and display a warning.
- When cell dimensions are not specified in a column definition, it is assumed that a single value is stored by each cell of that column. This is inappropriate for strings for which the default amounts to storing a single character per cell. Cell dimensions are therefore now mandatory for defining columns of strings in a table HDU. Note that this is the simplest way to specify the maximum length of the strings.
- Reading/writing a column of strings of length 1 has been fixed.
- Extend
haskey
forFitsHDU
instances.
- Fix compatibility.
-
New non-exported constant
EasyFITS.OptionalHeader
to matchnothing
or anything that can represent a FITS header. -
Other packages may simply extend
Base.write(file::FitsFile,header::EasyFITS.OptionalHeader,data::CustomType)
and/orBase.read(::Type{<:CustomType},hdu::FitsHDU)
for their own type of dataCustomType
to specify how to save and/or load such kind of data.
- Import predicate functions
is_comment
,is_end
,is_naxis
, andis_structural
fromBaseFITS
.
- Package
AsType
is nowTypeUtils
.
This version introduces many changes mostly for reading/writing FITS table extensions:
-
The
rename
keyword can be used to specify a function to rename column names when reading a FITS table in a dictionary. -
Keywords
first
andlast
to specify the range of rows to read in a FITS table with theread
method have been replaced by arows
argument which may be a single row index, a unit range of row numbers, or a colon:
to read all rows (the default). Theread!
method keeps itsfirst
keyword to specify the first row to read. -
Reading a single row (e.g. by specifying
rows = 3
but notrows = 3:3
), for a table yield a 0-dimensional result along the corresponding dimension. -
read!(dict,hdu[,cols[,rows]])
replaces the contents of dictionarydict
with columnscols
of the FITS tablehdu
whilemerge!(dict,hdu[,cols[,rows]])
merges columnscols
of the FITS tablehdu
to the contents the dictionarydict
. -
Reading column(s) from a FITS table can yield the column(s) values or the column(s) values and their units.
-
FITS table extensions can be written by
write(file,hdr,cols)
withhdr
specifying additional header records, columnscols
specified by a collection of pairs likekey => vals
orkey => (vals, units)
withkey
the (symbolic) name of the column,vals
its values, andunits
its optional units. The collectioncols
can be a dictionary, a named tuple, a vector of pairs, or a tuple of pairs. -
To avoid ambiguities, when writing complete FITS extensions in a single
write
call, two arguments must be supplied for each extension: one for the header (possiblynothing
) and one for the data. -
Columns of strings:
-
Columns with string values and, possibly, multi-dimensional cells can be read/written as strings or as raw bytes. Although specified by FITS standard, multi-dimensional cells of strings may not be correctly supported by all software (notably not by
fv
). CFITSIO itself implements its own mechanisms for multi-dimensional cells of strings which are not part of FITS standard and does not understand the FITS standard rules. For this reason inEasyFITS
, raw bytes are always used as an intermediate by to represent strings so as to shortcut the handling of strings by CFITSIO. -
As assumed in the CFITSIO library and by the FITS standard, trailing spaces are not significant (and discarded) unless the string only consists in spaces if which case the first space is considered as significant (and kept). This is intended to distinguish null (empty) and non-null strings.
-
There are also some changes not related to FITS table extensions:
- The constant
EasyFITS.CFITSIO_VERSION
gives the version of the CFITSIO library for which the package has been built. At load time, it is checked that this version matches that of the dynamic library.
-
read(FitsHeader,filename;ext=...)
can be used to read the header of FITS extensionext
in filefilename
. -
Empty FITS image extensions can be written.
-
Use
AsType
package. -
Save arrays of Booleans as bytes in FITS image extensions.
- Fix directly writing a FITS image extension in a file with a given header and image array.
-
Call
write(file::FitsFile,FitsImageHDU{T},dims...)
to create a new FITS image HDU with elements of typeT
and dimensionsdims...
. -
Fix writing image extensions with values of type
Bool
. In CFITSIO library, logical values must be considered as bytes in FITS image extensions.
- The function
hduname
imported by some other packages is back.
This version introduces lots of changes in the API. The syntax should be more intuitive and consistent. To reduce the number of exported functions and avoid using non-exported ones, properties are used extensively.
-
Type-stability has been improved in many places.
-
The number of exported functions has been reduced to
write!
,readfits
,openfits
,writefits
, andwritefits!
. All exported types are prefixed byFits
and all exported constants are prefixed byFITS_
. -
String prefix
fits
can be used to mark names of FITS files when calling standard functions likeopen
,read
, andwrite
. DecorationFitsFile(filename)
can also be used if the file name is bound to a variable (also works for literal strings). -
EasyFITS
no longer wraps overFITSIO
but directly useCFITSIO_jll
. -
exists(path)
is no longer provided, callispath(path)
instead.
-
Access to header cards has been completely rewritten for speed and type stability.
-
Headers are now specified as vectors of
key => val
pairs withkey
the keyword string andval
the associated value and/or comment. -
Properties, that is the
card.field
syntax, are used to retrieve the different parts of a FITS header card (name, value, and comment), to parse the card value, and to get the card units if any.
-
When creating table extensions, columns are defined by vectors of
col => def
pairs with column namecol
and column definitiondef
that must include the type of the column values and may also include their units and the dimensions of the column cells. -
Writing columns is done by
write(hdu,col=>vals,...)
wherehdu
is the header data unit object of the FITS table extension,col
is the column name/number, andvals
are the values to write. The ellipsis...
may be any other column data to write. Automatic type conversion is performed. Partial writing is possible by using the keywordfirstrow
to specify the first row to write. -
Reading column values is done by
read(hdu,col)
wherehdu
is the header data unit object of the FITS table extension andcol
is the column name/number. Partial reading is possible by using the keywordsfirst
andlast
to specify the first and last rows to read.
Fix type piracy for get
method when FITSIO
version is greater or equal
0.17.
This version requires FITSIO.jl and CFITSIO.jl.
This release is intended to work with FITSIO.jl prior to the introduction of CFITSIO.jl for the low-level interface to the C library.