#image #fits #pyref

pyref_ccd

Rust library to analyze fits files from the CCD camera for the PyRef project

5 releases

0.2.3 Aug 28, 2024
0.2.2 Aug 28, 2024
0.2.1 Aug 28, 2024
0.2.0 Aug 28, 2024
0.1.0 Aug 25, 2024

#12 in #fits

Download history 376/week @ 2024-08-22 127/week @ 2024-08-29 20/week @ 2024-09-12 6/week @ 2024-09-19

389 downloads per month
Used in pyref_ccd

GPL-2.0 license

435KB
351 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 ┆ Higher Order Suppressor ┆ EXPOSURE ┆ Image                           │
│ ---------------                             │
│ f64f64f64f64      ┆ list[list[u32]]                 │
╞══════════════╪═════════════════╪═════════════════════════╪══════════╪═════════════════════════════════╡
│ 60.0249.992915.5000531.0[[33356, 33372,33365], [333… │
│ 56.112249.9966945.5000531.0[[33367, 33368,33395], [333… │
└──────────────┴─────────────────┴─────────────────────────┴──────────┴─────────────────────────────────┘
┌──────────────┬─────────────────┬─────────────────────────┬──────────┬─────────────────────────────────┐
│ Sample Theta ┆ Beamline Energy ┆ Higher Order Suppressor ┆ EXPOSURE ┆ Image                           │
│ ---------------                             │
│ f64f64f64f64      ┆ list[list[u32]]                 │
╞══════════════╪═════════════════╪═════════════════════════╪══════════╪═════════════════════════════════╡
│ 60.0249.992915.5000531.0[[33356, 33372,33365], [333… │
│ 0.0249.9985857.7995470.001[[33352, 33347,33347], [333… │
│ 0.0249.9966947.8000230.001[[33317, 33324,33327], [333… │
│ 0.0249.992917.8000230.001[[33354, 33359,33351], [333… │
│ 0.0249.992917.8000230.001[[33332, 33358,33330], [333… │
│ …            ┆ …               ┆ …                       ┆ …        ┆ …                               │
│ 40.556250.0080625.5000531.0[[33366, 33358,33355], [333… │
│ 44.444250.0080625.5000531.0[[33367, 33358,33350], [333… │
│ 48.334250.0099615.5000531.0[[33363, 33344,33352], [333… │
│ 52.222249.9985855.5000531.0[[33366, 33369,33359], [333… │
│ 56.112249.9966945.5000531.0[[33367, 33368,33395], [333… │
└──────────────┴─────────────────┴─────────────────────────┴──────────┴─────────────────────────────────┘

Dependencies

~33–62MB
~1M SLoC