43 releases

0.3.25 Nov 22, 2024
0.3.24 Nov 22, 2024
0.3.14 Oct 20, 2024
0.2.29 Sep 30, 2024
0.2.26 Aug 31, 2024

#400 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 78/week @ 2024-10-07 516/week @ 2024-10-14 348/week @ 2024-10-21 126/week @ 2024-10-28 117/week @ 2024-11-04 7/week @ 2024-11-11 1038/week @ 2024-11-18 75/week @ 2024-11-25 20/week @ 2024-12-02

1,148 downloads per month

GPL-2.0 license

27KB
337 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

~31–60MB
~1M SLoC