16 releases

new 0.5.4 Oct 31, 2024
0.5.3 Jul 26, 2024
0.5.2 Feb 10, 2023
0.5.1 Dec 21, 2022
0.1.4 Jul 13, 2016

#290 in Science

Download history 95/week @ 2024-07-17 252/week @ 2024-07-24 73/week @ 2024-07-31 115/week @ 2024-08-07 288/week @ 2024-08-14 186/week @ 2024-08-21 58/week @ 2024-08-28 63/week @ 2024-09-04 139/week @ 2024-09-11 351/week @ 2024-09-18 750/week @ 2024-09-25 98/week @ 2024-10-02 173/week @ 2024-10-09 656/week @ 2024-10-16 437/week @ 2024-10-23 328/week @ 2024-10-30

1,605 downloads per month
Used in 14 crates (4 directly)

MIT/Apache

6MB
139K SLoC

C 108K SLoC // 0.2% comments Rust 22K SLoC // 0.0% comments Happy 5K SLoC FORTRAN Legacy 2.5K SLoC // 0.3% comments Lex 436 SLoC // 0.1% comments Batch 86 SLoC Pan 59 SLoC // 0.4% comments Bitbake 26 SLoC

Contains (autotools obfuscated code, 220KB) ext/cfitsio/configure

fitsio-sys

See the main documentation


lib.rs:

This package was automatically generated with rust-bindgen and as such was not user-generated.

The functions contained are expected to be used with fitsio, a high level API wrapper around the low level direct C-bindings, though the bindings are complete enough to be usable.

This code will not be directly documented, and so users should refer to the fitsio C documentation for usage.

Note about function names

Unfortunately we must use fits short names throughout. The C-api exposes long names for functions which are more descriptive, for example fits_open_file instead of ffopen, but the symbols available in the library have only short names, and the long names are merely preprocessor definitions.

Examples

use std::ptr;
use std::ffi;

let filename = ffi::CString::new("!/tmp/test.fits").unwrap();
let mut fptr = ptr::null_mut();
let mut status = 0;

unsafe {
    // Create a new file, clobbering any pre-existing file
    ffinit(&mut fptr as *mut *mut _,
        filename.as_ptr(),
        &mut status);

    // Add an empty primary HDU
    ffphps(fptr, 8, 0, ptr::null_mut(), &mut status);

    // Finally close the file
    ffclos(fptr, &mut status);
}

assert_eq!(status, 0);

Dependencies