fitswasm
v0.1.5
Published
## Install with npm
Downloads
2
Readme
FITS reader written in pure Rust using nom
Install with npm
npm i fitswasm
Example
import * as fitswasm from "fitswasm";
// Fetch the fits file
fetch('http://alasky.u-strasbg.fr/Pan-STARRS/DR1/g/Norder3/Allsky.fits')
// Convert to blob
.then((response) => response.blob())
// Get an array buffer from it
.then((blob) => blob.arrayBuffer())
.then((buf) => {
// Get a bytes buffer
const data = new Uint8Array(buf);
// Call the wasm parser
console.log(fitswasm.read(data));
// The result can contain as data either a
// Uint8Array, Int16Array, Int32Array,
// Float32Array or Float64Array
// depending on the bitpix keyword found
})