docs.rs failed to build astro-io-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
astro-io
I/O operations for astronomical image formats.
Overview
astro-io provides functionality for loading and saving astronomical image formats, including FITS and XISF. It handles the low-level details of file I/O, image data extraction, and compression.
Features
- FITS file loading
- XISF file loading
- Efficient image data handling
- Support for various data types (8-bit, 16-bit, 32-bit float)
Installation
Add to your Cargo.toml:
[]
= "0.2.0"
API Reference
FITS Module
/// Read a FITS file and return its pixel data, width, and height
- Parameters:
path: Path to the FITS file
- Returns:
- A tuple containing:
Vec<f32>: Pixel data as a flattened vector of 32-bit floatsusize: Width of the image in pixelsusize: Height of the image in pixels
- A tuple containing:
- Errors:
- If the file cannot be opened
- If the primary HDU is not an image
- If the image data cannot be read
/// Normalize pixel values to a 0.0-1.0 range
- Parameters:
pixels: Slice of pixel values
- Returns:
Vec<f32>: Normalized pixel values in the range 0.0-1.0
XISF Module
/// Read an XISF file and return its pixel data, width, and height
- Parameters:
path: Path to the XISF file
- Returns:
- A tuple containing:
Vec<f32>: Pixel data as a flattened vector of 32-bit floatsusize: Width of the image in pixelsusize: Height of the image in pixels
- A tuple containing:
- Errors:
- If the file cannot be opened
- If the XISF signature is invalid
- If the XML header cannot be parsed
- If the image data cannot be read
Usage Examples
Loading a FITS file
use fits;
use Path;
Loading an XISF file
use xisf;
use Path;
License
This project is dual-licensed under the MIT License or the Apache License, Version 2.0.