fits-io 0.1.0

A pure-Rust FITS file handling library inspired by CFITSIO, focused on safety, clarity, and performance.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub fn is_fits_file(path: &std::path::Path) -> bool {
    if let Some(file_name) = path.file_name() {
        if let Some(file_name) = file_name.to_str() {
            file_name.ends_with(".fit")
                || file_name.ends_with(".fits")
                || file_name.ends_with(".fts")
                || file_name.ends_with(".fit.gz")
                || file_name.ends_with(".fits.gz")
                || file_name.ends_with(".fts.gz")
        } else {
            false
        }
    } else {
        false
    }
}