CFITSIO Changelog

What's new in CFITSIO 3.370

Jun 30, 2014
  • added configure options to support reading bzip2 compressed FITS files.This depends on having the bzlib library installed on the local machine.Patch submitted by Dustin Lang.
  • replaced the random Gaussian and Poissonian distribution functions withnew code written by Craig Markwardt derived from public domain C++ functions written by John D Cook.
  • patched fitsio2.h to support CFITSIO on AArch64 (64-bit ARM)architecture (both big and little endian). Supplied byMarcin Juszkiewicz and Sergio Pascual Ramirez, with further updateby Michel Normand.
  • fixed bug in fpackutil.c that caused fpack to exit prematurely ifthe FZALGOR directive keyword was present in the HDU header.

New in CFITSIO 3.360 (Jun 30, 2014)

  • added 9 Dec: small change to the fileseek function in drvrfile.c tosupport large files > 2 GB when building CFITSIO with MinGW on Windows
  • reorganized the CFITSIO code directory structure; added a 'docs'subdirectory for all the documentation, and a 'zlib' directoryfor the zlib/gzip file compression code.
  • made major changes to the compression code for FITS binary tableto support all types of columns, including variable-length arrays.This code is mainly used via the fpack and funpack programs.
  • increased the number of FITS files that can be opened as onetime to 1000, as defined by NMAXFILES in fitsio2.h.
  • made small configuration changes to configure.in, configure,fitsio.h, and drvrfile.c to support large files (64-bit file offsets} when using the mingw-w64 compiler (provided by Benjamin Gilbert).
  • made small change to fits_delete_file to more completely ignoreany non-zero input status value.
  • fixed a logic error in a 'if' test when parsing a keyword namein the ngp_keyword_is_write function in grparser.c (providedby David Binderman).
  • when specifying the image compression parameters as part of thecompressed image file name (using the "[compress]" qualifierafter the name of the file), the quantization level value, ifspecified, was not being recognized by the CFITSIO compressionroutines. The image would always be compressed with the defaultquantization level of 4.0, regardless of what was specified. Thisaffected the imcopy program, and potentially other user-generatedapplication programs that used this method to specify thecompression parameters. This bug did not affect fpack orfunpack. This was fixed in the imcomp_get_compressed_image_parroutine in the imcompress.c file. (reported by Sean Peters)
  • defined a new CFITS_API macro in fitsio.h which is used to export thepublic symbols when building CFITSIO on Windows systems with CMake. Thisworks in conjunction with the new Windows CMake build procedure thatis described in the README.win32 file. This complete revamping of theway CFITSIO is built under Windows now supports building 64-bitversions of the library. Thanks to Daniel Kaneider (Luminance HDRTeam) for providing these new CMake build procedures.
  • modified the way that the low-level file_create routine works whenrunning in the Hera environment to ensure that the FITS file that is created is within the allow user data disk area.
  • modified fits_get_compression_type so that it does not return an errorif the HDU is a normal FITS IMAGE extension, and is not a tile-compressedimage.
  • modified the low-level ffgcl* and ffpcl* routines to ensure that theynever try ro read or write more than 2**31 bytes from disk at one time,as might happen with very large images, to avoid integer overflow errors.Fix kindly provided by Fred Gutsche at NanoFocus AG (www.nanofocus.de).modified Makefile.in so that doing 'make distclean' does not deletenew config.sub and config.guess files that were recently added.
  • adopted a patch from Debian in zcompress.c to "define" the values ofGZBUFSIZE and BUFFINCR, instead of exporting the symbols as 'int's.

New in CFITSIO 3.350 (Jul 2, 2013)

  • In imcompress.c, declared some arrays that are used to store the dimensions of the image from 'int' to 'long', to support very large images (at least on systems where sizeof(long) = 8),
  • Modified the routines that convert a string value to a float or double to prevent them from returning a NaN or Inf value if the string is "NaN" or "Inf" (as can happen with gcc implementation of the strtod function).
  • Removed/replaced the use of the assert() functions when locking or unlocking threads because they did not work correctly if NDEBUG is defined.
  • Made modifications to the way the command-line file filters are parsed to 1) remove the 1024-character limit when specifying a column filter, 2) fixed a potential character buffer-overflow risk in fits_get_token, and 3) improved the parsing logic to remove any possible of confusing 2 slash characters ("//") in the string as the beginning of a comment string.
  • Modified configure and Makefile.in so that when building CFITSIO as a shared library on linux or Mac platforms, it will use the SONAME convention to indicate whether each new release of the CFITSIO library is binary-compatible with the previous version. Application programs that link with the shared library will not need to be
  • recompiled as long as the versions are compatible. In practice, this means that the shared library binary file that is created (on Linux systems) will have a name like 'libcfitsio.so.I.J.K', where I is the SONAME version number, J is the major CFITSIO version number (e.g. 3), and K is the minor CFITSIO version number (e.g., 34).
  • Fixed bug in fits_insert_col when computing the new table row width when inserting a '1Q' variable length array column.
  • Modified the image compression routines so that the output compressed image (stored in a FITS binary table) uses the '1Q' variable length array format (instead of '1P') when the input file is larger than 4 GB.
  • Added support for "compression directive" keywords which indicate how that HDU should be compressed (e.g., which compression algorithm to use, what tiling pattern to use, etc.). The values of these keywords will override the compression parameters that were specified on the command line when running the fpack FITS file compression program.
  • Globally changed the variable and/or subroutine name "dither_offset" to "dither_seed" and "quantize_dither" to "quantize_method" so that the names more accurately reflects their purpose.
  • Added support for a new SUBTRACTIVE_DITHER_2 method when compressing floating point images. The only difference with the previous method is that pixels with a value exactly equal to 0.0 will not be dithered, and instead will be exactly preserved when the image is compressed.
  • Added support for an alias of "RICE_ONE" for "RICE_1" as the value of the ZCMPTYPE keyword, which gives the name of the image compression algorithm. This alias is used if the new SUBTRACTIVE_DITHER_2 option is used, to prevent old versions of funpack from creating a corrupted uncompressed image file. Only newer versions of funpack will recognize this alias and be able to uncompress the image.
  • Made performance improvement to fits_read_compressed_img so that when reading a section of an compressed image that includes only every nth pixel in some dimension, it will only uncompressed a tile if there are actually any pixels of interest in that tile.
  • Fixed several issues with the beta FITS binary table compression code that is used by fpack: added support for zero-length vector columns, made improvements to the output report when using the -T option in fpack, changed the default table compression method to 'Rice' instead of 'Best', and now writes the 'ZTILELEN' keyword to document the number of table rows in each tile.
  • Fixed error in ffbinit in calculating the total length of the binary table extension if the THEAP keyword was used to override the default starting location of the heap.

New in CFITSIO 3.34 (Apr 1, 2013)

  • modified configure and configure.in to support cross-compiled cfitsio
  • as a static library for Windows on a Linux platform using MXE
  • (http://mxe.cc)a build environment for mingw32. (contributed by
  • Niels Kristian Bech Jensen)
  • added conditional compilation statementsfor the mingw32 environment in
  • drvrfile.c because mingw32 does not include the ftello and fseeko functions.
  • (contributed by Niels Kristian Bech Jensen)
  • fixed a potential bug in ffcpcl (routine to copy a column from one table
  • to another table) when dealing with the rare case of a '0X' column (zero
  • length bit column).
  • fixed an issue in the routines that update or modify string-valued
  • keyword values, as a result of the change to ffc2s in the previous
  • release.These routines would exit with a 204 error status if the
  • current value of the keyword to be updated or modified is null.
  • fixed typo in the previous modification that was intended to ignore
  • numerical overflows in Hcompress when decompressing an image.
  • moved the 'startcol' static variable out of the ffgcnn routine and
  • instead added it as a member of the 'FITSfile' structure that is defined
  • in fitsio.h.This removes a possible race condition in ffgcnn in
  • multi-threaded environments.

New in CFITSIO 3.330 (Mar 6, 2013)

  • modified the imcomp_decompress_tile routine to ignore any numerical
  • overflows that might occur when using Hcompress to decompress the
  • image. If Hcompress is used in its 'lossy' mode, the uncompressed
  • image pixel values may slightly exceed the range of an integer*2
  • variable. This is generally of no consequence, so we can safely ignore
  • any overflows in this case and just clip the values to the legal range.
  • the default tiling pattern when writing a tile-compressed image
  • has been changed. The old behaviour was to compress the whole image
  • as one single large tile. This is often not optimal when dealing
  • with large images, so the new default behavior is to treat each
  • row of the image as one tile. This is the same default behavior
  • as in the standalone fpack program. The default tile size can
  • be overridden by calling fits_set_tile_dim.
  • fixed bug bug that resulted in a corrupted output FITS image when
  • attempting to write a float or double array of values to a
  • tile-compressed integer data type image. CFITSIO does not support
  • implicit data type conversion in this case and now correctly
  • returns an appropriate error status.
  • modified ricecomp.c to define the nonzero_count lookup table as an
  • external variable, rather then dynamically allocating it within the
  • 3 routines that use it. This simplifies the code and eliminates the
  • need for special thread locking and unlocking statements. (Thanks to
  • Lars Kr. Lundin for this suggestion).
  • modifed how the uncompressed size of a gzipped file is computed in the
  • mem_compress_open routine in drvrmem.c. Since gzip only uses 4 bytes
  • in the compressed file header to store the original file size, one may
  • need to apply a modulo 2^32 byte correction in some cases. The logic
  • here was modified to allow for corner cases (e.g., very small files, and
  • when running on 32-bit platforms that do not support files larger than
  • 2^31 bytes in size).
  • added new public routine to construct a 80 keyword record from the 3 input
  • component strings, i.e, the keyword name string, the value string, and
  • the comment string: fits_make_key/ffmkky. (This was already an undocumented
  • internal routine in previous versions of CFITSIO).
  • modified ffc2s so that if the input keyword value string is a null string,
  • then it will return a VALUE_UNDEFINED (204) status value. This makes it
  • consistent with the behavior when attempting to read a null keyword
  • (which has no value) as a logical or as a number (which also returns
  • the 204 error). This should only affect cases where the header keyword
  • does not have an equal sign followed by a space character in columns 9
  • and 10 of the header record.
  • Changed the "char *" parameter declarations to "const char *" in many
  • of the routines (mainly the routines that modify or update keywords) to
  • avoid compiler warnings or errors from C++ programs that tend to be more
  • rigorous about using "const char *" when appropriate.
  • added support for caching uncompressed image tiles, so that the tile does
  • not need to be uncompressed again if the application program wants
  • to read more data from the same tile. This required changes to the
  • main FITS file structure that is defined in fitsio.h, as well as
  • changes to imcompress.c.
  • enhanced the previous modification to drvrfile.c to handle additional user
  • cases when running in the HEASARC's Hera environment.

New in CFITSIO 3.26 (Jan 14, 2011)

  • Enhancements:
  • defined 2 new macros in fitsio.h: #define CFITSIO_MAJOR 3 #define CFITSIO_MINOR 26 These may be used within other macros to detect the CFITSIO version number at compile time. - modified group.c to initialize the output URL to a null string in fits_url2relurl. Also added more robust tests to see if 2 file pointers point to the same file.
  • enhanced the template keyword parsing code in grparser.c to support the 'D' exponent character in the ASCII representation of floating point keyword values (as in TVAL = 1.23D03). Previously, the parser would have writen this keyword with a string value (TVAL = '1.23D03').
  • modified the low-level routines that write a keyword record to a FITS header so that they silently replace any illegal characters (ASCII values less than 32 or greater than 126) with an ASCII space character. Previously, these routines would have returned with an error when encountering these illegal characters in the keyword record (most commonly tab, carriage return, and line feed characters).
  • made substantial internal changes to imcompress.c in preparation for possible future support for compression methods for FITS tables analogous to the tiled image compression method.
  • replaced all the source code in CFITSIO that was distributed under the GNU General Public License with freely available code. In particular, the gzip file compression and uncompression code was replaced by the zlib compression library. Thus, beginning with this version 3.26 of CFITSIO, other software applications may freely use CFITSIO without necessarily incurring any GNU licensing requirement. See the License.txt file for the CFITSIO licensing requirements.
  • added support for using cfitsio in different 'locales' which use a comma, not a period, as the decimal point character in ASCII representation of a floating point number (e.g., France). This affects how floating point keyword values and floating point numbers in ASCII tables are read and written with the 'printf' and 'strtod' functions.
  • added a new utility routine called fits_copy_rows/ffcprw that copies a specified range of rows from one table to another.
  • enhanced the test for illegal ASCII characters in a header (fftrec) to print out the name of the offending character (e.g TAB or Line Feed) as well as the Hex value of the chracter. - modified ffgtbc (in fitscore.c) to support nonstandard vector variable length array columns in binary tables (e.g. with TFORMn = 2000PE(500)'). - modified the configure file to add "-lm" when linking CFITSIO on Solaris machines. - added new routine, fits_get_inttype, to parse an integer keyword value string and return the minimum integer datatype (TBYTE, TSHORT, TLONG, TLONGLONG) required to store the integer value.
  • added new routine, fits_convert_hdr2str, which is similar to fits_hdr2str except that if the input HDU is a tile compressed image (stored in a binary table) then it will first convert that header back to that of a normal uncompressed FITS image before concatenating the header keyword records.
  • modified the file template reading routine (ngp_line_from_file in grparser.c) so that it ignores any carriage return characters (\r) in the line, that might be present, e.g. if the file was created on a Windows machine that uses \r\n as end of line characters.
  • modified the ffoptplt routine in cfileio.c to check if the PCOUNT keyword in the template file has a non-zero value, and if so, resets it to zero in the newly created file.
  • Bug Fixes:
  • fixed a bug when updating the value of the CRPIXn world coordinate system keywords when extracting a subimage from larger FITS image, using the extended CFITSIO syntax (e.g. myimage[1:500:2, 1:500:2]). This bug only affects casee where the pixel increment value is not equal to 1, and caused the coordinate grid to be shifted by between 0.25 pixels (in the case of a pixel increment of 2) and 0.5 pixels (for large pixel increment values).
  • fixed a potential string buffer overflow error in the ffmkls routine that modifies the value and comment strings in a keyword that uses the HEASARC long string keyword convention.
  • fixed a bug in imcompress.c that could cause programs to abort on 64-bit machines when using gzip to tile-compress images. Changed the declaration of clen in imcomp_compress_tile from int to size_t.

New in CFITSIO 3.25 (Jun 10, 2010)

  • fixed typo in the definition of the ftgprh Fortran wrapper routine
  • in f77_wrap3.c.
  • modified the cfitsio.pc.in configuration file to make the lib path
  • a variable, instead of hard coding the path. The provides more
  • flexibility for projects such as suse and fedora when building CFITSIO.
  • fixed bug in imcomp_compress_tile in imcompress.c which caused
  • null pixel values to be written incorrectly in the rare case where
  • the floating-point tile of pixels could not be quantized into integers.
  • modified imcompress.c to add a new specialized routine to uncompress
  • an input image and then write it to a output image on a tile by tile basis.
  • This appears to be faster than the old method of uncompressing the
  • whole image into memory before writing it out. It also supports
  • large images with more than 2**31 pixels.
  • made trivial changes to 2 statements in drvrfile.c to suppress
  • nuisance compiler warnings.
  • some compilers define CLOCKS_PER_SEC as a double instead of an integer,
  • so added an explicted integer type conversion to 2 statements in
  • imcompress.c that used this macro.

New in CFITSIO 3.24 (May 5, 2010)

  • modified fits_translate_keywords so that it silently ignores any
  • illegal ASCII characters in the value or comment fields of the input
  • FITS file. Otherwise, fpack would abort without compressing input
  • files that contained this minor violation of the FITS rules.
  • added support for Super H cpu in fitsio2.h
  • updated funpack to correctly handle the -S option, and to use a
  • more robust algorithm for creating temporary output files.
  • modified the imcomp_compress_tile routine to support the NOCOMPRESS
  • debugging option for real*4 images.

New in CFITSIO 3.21 (Dec 8, 2009)

  • multithreaded programs now run correctly on Mac OS (they used to give a bus error),
  • increased the length of a character string in fpack.c that caused the "fpack -V" command to crash on some platforms
  • fixed an invalid comment delimiter ( //* ) in imcompress.c that some compilers complained about.

New in CFITSIO 3.18 Beta (May 12, 2009)

  • Made extensive changes to make CFITSIO thread safe. Previously, all opened FITS files shared a common pool of memory to store the most recently read or written FITS records in the files. In a multi-threaded environment different threads could simultaneously read or write to this common area causing unpredictable results. This was changed so that every opened FITS file has its own private memory area for buffering the file. Most of the changes were in buffers.c, fitsio.h, and fitsio2.h. Additional changes were made to cfileio.c, mainly to put locks around small sections of code when setting up the low-level drivers to read or write the FITS file. Also, locks were needed around the GZIP compression and uncompression code in compress.c., the error message stack access routine in fitscore.c, the encode and decode routines in fits_hcompress.c and fits_hdecompress.c, in ricecomp.c, and the table row selection and table calculator functions. Also, removed the 'static' declaration of the local variables in pliocomp.c which did not appeared to be required and prevented the routines from being thread safe.
  • As a consequence of having a separate memory buffer for every FITS file (by default, about 115 kB per file), CFITSIO may now allocate more memory than previously when an application program opens multiple FITS files at once. The read and write speed may also be slightly faster, since the buffers are not shared between files.
  • Added new families of Fortran wrapper routines to read and write values to large tables that have more than 2**31 rows. The arguments that define the first row and first element to read or write must be I*8 integers, not ordinary I*4 integers. The names of these new routines have 'LL' appended to them, so for example, ftgcvb becomes ftgcvbll.
  • Fixes:
  • Corrected an obscure bug in imcompress.c that would have incorrectly written the null values only in the rare case of writing a signed byte array that is then tile compressed using the Hcompress or PLIO algorithm.