pyref_core/lib.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
extern crate core;
pub mod loader;
/// # Rust Backend for accessing CCD data in FITS files
///
/// This crate is a light wrapper over the [astrors](https://github.com/Schwarzam/astrors)
/// crate. It provides a simple interface to access CCD data in FITS files.
///
/// ## Usage
///
/// ```rust
/// 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:
///
/// ```rust
/// ┌──────────────┬─────────────────┬──────────┬─────────────────────────────────┐
/// │ Sample Theta ┆ Beamline Energy ┆ EXPOSURE ┆ Image │
/// │ --- ┆ --- ┆ --- ┆ --- │
/// │ f64 ┆ f64 ┆ f64 ┆ list[list[u32]] │
/// ╞══════════════╪═════════════════╪══════════╪═════════════════════════════════╡
/// │ 60.0 ┆ 249.99291 ┆ 1.0 ┆ [[33356, 33372, … 33365], [333… │
/// │ 56.112 ┆ 249.996694 ┆ 1.0 ┆ [[33367, 33368, … 33395], [333… │
/// └──────────────┴─────────────────┴──────────┴─────────────────────────────────┘
/// ┌──────────────┬─────────────────┬──────────┬─────────────────────────────────┐
/// │ Sample Theta ┆ Beamline Energy ┆ EXPOSURE ┆ Image │
/// │ --- ┆ --- ┆ --- ┆ --- │
/// │ f64 ┆ f64 ┆ f64 ┆ list[list[u32]] │
/// ╞══════════════╪═════════════════╪══════════╪═════════════════════════════════╡
/// │ 60.0 ┆ 249.99291 ┆ 1.0 ┆ [[33356, 33372, … 33365], [333… │
/// │ 0.0 ┆ 249.998585 ┆ 0.001 ┆ [[33352, 33347, … 33347], [333… │
/// │ 0.0 ┆ 249.996694 ┆ 0.001 ┆ [[33317, 33324, … 33327], [333… │
/// │ 0.0 ┆ 249.99291 ┆ 0.001 ┆ [[33354, 33359, … 33351], [333… │
/// │ 0.0 ┆ 249.99291 ┆ 0.001 ┆ [[33332, 33358, … 33330], [333… │
/// │ … ┆ … ┆ … ┆ … │
/// │ 40.556 ┆ 250.008062 ┆ 1.0 ┆ [[33366, 33358, … 33355], [333… │
/// │ 44.444 ┆ 250.008062 ┆ 1.0 ┆ [[33367, 33358, … 33350], [333… │
/// │ 48.334 ┆ 250.009961 ┆ 1.0 ┆ [[33363, 33344, … 33352], [333… │
/// │ 52.222 ┆ 249.998585 ┆ 1.0 ┆ [[33366, 33369, … 33359], [333… │
/// │ 56.112 ┆ 249.996694 ┆ 1.0 ┆ [[33367, 33368, … 33395], [333… │
/// └──────────────┴─────────────────┴──────────┴─────────────────────────────────┘
/// ```
pub mod documentation {
// No code changes needed here
}