25 releases

0.3.7 Oct 4, 2024
0.3.6 Oct 4, 2024
0.2.29 Sep 30, 2024
0.2.26 Aug 31, 2024

#201 in Science

Download history 757/week @ 2024-08-26 41/week @ 2024-09-02 68/week @ 2024-09-16 6/week @ 2024-09-23 1408/week @ 2024-09-30

1,483 downloads per month

GPL-2.0 license

220KB
238 lines

Rust Backend for accessing CCD data in FITS files

This crate is a light wrapper over the astrors crate. It provides a simple interface to access CCD data in FITS files.

Usage

use pyref_ccd::*;
use std::path::Path;

fn main() {
    let path = "path/to/fits/file.fits";
    let df = read_fits(path).unwrap();
    println!("{:?}", df);

    // Or to load all data in a directory

    let path = "path/to/directory";
    let all_df = read_experiment(path, ExperimentType::Xrr).unwrap();
    println!("{:?}", all_df);
}

output:

┌──────────────┬─────────────────┬──────────┬─────────────────────────────────┐
│ Sample Theta ┆ Beamline Energy ┆ EXPOSURE ┆ Image                           │
│ ------------                             │
│ f64f64f64      ┆ list[list[u32]]                 │
╞══════════════╪═════════════════╪══════════╪═════════════════════════════════╡
│ 60.0249.992911.0[[33356, 33372,33365], [333… │
│ 56.112249.9966941.0[[33367, 33368,33395], [333… │
└──────────────┴─────────────────┴──────────┴─────────────────────────────────┘
┌──────────────┬─────────────────┬──────────┬─────────────────────────────────┐
│ Sample Theta ┆ Beamline Energy ┆ EXPOSURE ┆ Image                           │
│ ------------                             │
│ f64f64f64      ┆ list[list[u32]]                 │
╞══════════════╪═════════════════╪══════════╪═════════════════════════════════╡
│ 60.0249.992911.0[[33356, 33372,33365], [333… │
│ 0.0249.9985850.001[[33352, 33347,33347], [333… │
│ 0.0249.9966940.001[[33317, 33324,33327], [333… │
│ 0.0249.992910.001[[33354, 33359,33351], [333… │
│ 0.0249.992910.001[[33332, 33358,33330], [333… │
│ …            ┆ …               ┆ …        ┆ …                               │
│ 40.556250.0080621.0[[33366, 33358,33355], [333… │
│ 44.444250.0080621.0[[33367, 33358,33350], [333… │
│ 48.334250.0099611.0[[33363, 33344,33352], [333… │
│ 52.222249.9985851.0[[33366, 33369,33359], [333… │
│ 56.112249.9966941.0[[33367, 33368,33395], [333… │
└──────────────┴─────────────────┴──────────┴─────────────────────────────────┘

Dependencies

~34–62MB
~1M SLoC