All Projects → mindriot101 → rust-fitsio

mindriot101 / rust-fitsio

Licence: Apache-2.0 and 2 other licenses found Licenses found Apache-2.0 LICENSE-APACHE Unknown LICENSE-CFITSIO MIT LICENSE-MIT
FFI wrapper around cfitsio in Rust

Programming Languages

c
50402 projects - #5 most used programming language
rust
11053 projects
Yacc
648 projects
fortran
972 projects
shell
77523 projects
Lex
420 projects

Projects that are alternatives of or similar to rust-fitsio

FITSIO.jl
Flexible Image Transport System (FITS) file support for Julia
Stars: ✭ 46 (+170.59%)
Mutual labels:  astronomy, cfitsio
NICERsoft
Analysis software for the NICER mission
Stars: ✭ 12 (-29.41%)
Mutual labels:  astronomy
cygrid
Cygrid is a cython-powered convolution-based gridding module for astronomy
Stars: ✭ 32 (+88.24%)
Mutual labels:  astronomy
Nasa-And-Spacex-Cooperation
Theme Outer Space
Stars: ✭ 41 (+141.18%)
Mutual labels:  astronomy
nightlight
Nightlight: Astronomic Image Processing
Stars: ✭ 25 (+47.06%)
Mutual labels:  astronomy
ephemeris-compute-de405
A command-line tool for producing tables of the positions of solar system objects over time.
Stars: ✭ 14 (-17.65%)
Mutual labels:  astronomy
PandExo
A Community Tool for Transiting Exoplanet Science with the JWST & HST
Stars: ✭ 23 (+35.29%)
Mutual labels:  astronomy
phantom
Phantom Smoothed Particle Hydrodynamics and Magnetohydrodynamics code
Stars: ✭ 52 (+205.88%)
Mutual labels:  astronomy
phantom-config
Parse, convert, modify, and generate Phantom config files.
Stars: ✭ 12 (-29.41%)
Mutual labels:  astronomy
kosmorro
A program to calculate your ephemerides.
Stars: ✭ 53 (+211.76%)
Mutual labels:  astronomy
marvin
Data access and visualization for MaNGA. http://sdss-marvin.readthedocs.io/en/latest/
Stars: ✭ 48 (+182.35%)
Mutual labels:  astronomy
api-rest
API - The Solar System OpenData
Stars: ✭ 18 (+5.88%)
Mutual labels:  astronomy
pyuvdata
A pythonic interface for radio astronomy interferometry data (uvfits, miriad, others)
Stars: ✭ 62 (+264.71%)
Mutual labels:  astronomy
curvit
Create light curves from UVIT data.
Stars: ✭ 14 (-17.65%)
Mutual labels:  astronomy
sherpa
Fit models to your data in Python with Sherpa.
Stars: ✭ 125 (+635.29%)
Mutual labels:  astronomy
indi-allsky
Software to manage a Linux-based All Sky Camera.
Stars: ✭ 59 (+247.06%)
Mutual labels:  astronomy
PyNeb devel
PyNeb development repository
Stars: ✭ 22 (+29.41%)
Mutual labels:  astronomy
planisphere
Make your own cardboard model planisphere
Stars: ✭ 28 (+64.71%)
Mutual labels:  astronomy
TART
Transient Array Radio Telescope
Stars: ✭ 20 (+17.65%)
Mutual labels:  astronomy
spherical geometry
A Python package for handling spherical polygons that represent arbitrary regions of the sky
Stars: ✭ 45 (+164.71%)
Mutual labels:  astronomy

rust-fitsio

FFI wrapper around cfitsio in Rust

Join the chat at https://gitter.im/mindriot101/rust-fitsio Build Status Coverage Status

Platform support

Platform Support level
Linux arm Tier 1
Linux x86_64 Tier 1
macos x86_64 Tier 1
Linux arm64 Tier 2
Linux i386 Tier 2
macos arm64 Tier 2
Windows msys2 Tier 3
Windows msvc -

Where the tiers refer to:

  • Tier 1: guaranteed to work, tested in CI
  • Tier 2: should work but not tested by CI
  • Tier 3: may work, and not tested by CI

Installation

fitsio supports versions of cfitsio >= 3.08.

cfitsio must be compiled with reentrant support (making it thread-safe) if it is to be compiled with the --enable-reentrant flag passed to configure. This affects developers of this library as the tests by default are run in parallel.

For example on a mac with homebrew, install cfitsio with:

brew install cfitsio --with-reentrant

Alternatively, it is possible to automatically have cargo automatically compile cfitsio from source. To do this, you are required to have a C compiler, autotools (to run the configure script) and make (to run the Makefile). This functionality is made available with the fitsio-src feature:

cargo build --features fitsio-src

For the time being, it's best to stick to the development version from github. The code is tested before being pushed and is relatively stable. Add this to your Cargo.toml file:

[dependencies]
fitsio = { git = "https://github.com/mindriot101/rust-fitsio" }

If you want the latest release from crates.io then add the following:

[dependencies]
fitsio = "*"

Or pin a specific version:

[dependencies]
fitsio = "0.20.0"

This repository contains fitsio-sys-bindgen which generates the C wrapper using bindgen at build time. This requires clang to build, and as this is likely to not be available in general, I do not recommend using it. It is contained here but is not actively developed, and untested. Use at your own peril. To opt in to building with bindgen, compile as:

cargo build --no-default-features --features bindgen

or use from your Cargo.toml as such:

[dependencies]
fitsio = { version = "0.20.0", default-features = false, features = ["bindgen"] }

Documentation

fitsio fitsio documentation
fitsio-sys fitsio-sys documentation
fitsio-sys-bindgen fitsio-sys-bindgen documentation

Feature support

Supported features of the underlying cfitsio library that are available in fitsio are detailed in this tracking issue. If a particular function is not implemented in fitsio, then the underlying fitsfile pointer can be accessed through an unsafe API.

Examples

Open a fits file

let f = fitsio::FitsFile::open("test.fits");

Accessing the underlying fitsfile object

fn main() {
    let filename = "../testdata/full_example.fits";
    let fptr = fitsio::FitsFile::open(filename).unwrap();

    /* Find out the number of HDUs in the file */
    let mut num_hdus = 0;
    let mut status = 0;

    unsafe {
        let fitsfile = fptr.as_raw();

        /* Use the unsafe fitsio-sys low level library to call a function that is possibly not
       implemented in this crate */
        fitsio_sys::ffthdu(fitsfile, &mut num_hdus, &mut status);
    }
    assert_eq!(num_hdus, 2);
}

Development

See ./CONTRIBUTING.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].