fitswasm
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

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
    })

Readme

Keywords

none

Package Sidebar

Install

npm i fitswasm

Weekly Downloads

2

Version

0.1.5

License

none

Unpacked Size

77.4 kB

Total Files

6

Last publish

Collaborators

  • bmatthieu3