This project augments the open source NASA FITS file software with many high level functions . These save and read float and double images with one to two slices. Two slices are needed for complex data, Here are a few of the floats functions:

int SaveFITSFile44(const char* filename, const float* pdata1,
const float* pdata2, long nx, long ny, double xleft, double ytop, double dx, double dy, int itype);

int SaveFITSFile4(const char* filename, const float* pdata,
long nx, long ny, double xleft, double ytop, double dx, double dy, int itype);

int ReadFltFITSFileImage(const char* filename, FloatPtrPtr ppdata1, FloatPtrPtr ppdata2, ong naxes[3], long* p_ndims, long* p_ndata,
DoublePtr p_xleft, DoublePtr p_ytop, DoublePtr p_dx, DoublePtr p_dy, int* itype, CharPtrPtr p_card_string);

Fields: XLEFT, YTOP, DX, DY. ITYPE, TITLE, XLABEL, YLABEL, ZLABEL

ITYPE=1 => Cartesian ITYPE=2 => Polar
There are functions for double data and many variants for float data.

Features

  • High level functions for saving and reading FITS images with 1 or 2 slices (real imag or mod arg)
  • Code is C Libraries can be built with Unix gcc or, for Windows, with Microsoft Visual Studio 2022 or with the cross platform mingw-w64 x86_64-w64-mingw32-gcc
  • Build .sh scripts provided for both static linked libfits.a library and dynamic linked libfits.so library for g++ and gcc in Unix. Also a .sh script for building libfits.dll for Windows executables using mingw-w64 C and C++ 64 bit cross platform compilers in Unix.
  • Test C++ program built with g++, either statically linked or dynamically linked
  • High level functions have been added for both float and double precision images
  • The data cube can have either one or two slices. Two slices are needed for complex data, either real imag cartesian data or mod arg polar data, according to whether ITYPE is 1 or 2, respectively.
  • The free programs SAOImage DS9, GIMP, and FITS Liberator 3 can read FITS files.. The SourceForge project C++ Complex Calculator (c-complex-calculator) uses this library.
  • There is a C++ test program which creates and saves and reads images in FITS files.
  • The NASA source code is old and had to be slightly modified to work in other newer environments, such as with mingw-w64 in Ubuntu WSL2 and Raspberry Pi OS. In several places in fitsio2.h and eval_l.c there are additional tests with compiler-defined pre-processor directives. These additional tests do not affect prior devices. In fitsio2.h, __aarch64__ and __linux__ are used to decide the byte order and length of the LONGLONG for the Raspberry Pi. In it and in eval_l.c, __GNUC__, __MINGW32__ and __MINGW64__ aer used to decide if strcasecmp and strncasecmp are defined,
  • Some already built libraries are included, such as libfits.a (static linked) and libfits.so (dynamic linked) for Ubuntu WSL2 (Windows Subsystem for Linux) and libfits.dll for Microsoft Windows x86 x64. libfits.dll was built using the cross platform mingw-w64.
  • Already built test programs for various platforms are also included
  • The zipped file contains a directory structure stripped of the .o object files. In the fitsdll-distro top folder, there are several build folders. There are also several .sh build scripts which use compile and link scripts. In particular, Unix libfits.a and libfits.so libraries can be built. And libfits.dll can be built for Windows using mingw-w64. The test program can be either dynamically linked, statically linked, or standalone, that is built together with all the NASA FITS.c files.

Project Activity

See All Activity >

Follow FITS DLL

FITS DLL Web Site

You Might Also Like
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of FITS DLL!

Additional Project Details

Registered

2025-05-16