npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

astrometry.js

v1.1.5

Published

Extract star pixel coordinates from a FITS image using JavaScript

Readme

astrometry.js

Extract star pixel coordinates from a FITS image using JavaScript (supported on Node.js and your Browser)

image2xy

A port of the blind image2xy solver utility from astrometry.net using Emscripten.


Install (Node.js)

npm install astrometry.js

Usage

Read a FITS image file into a buffer (or Uint8Array in the browser, see browser example below))

const fs = require('fs');
const buf = fs.readFileSync('./example.fits');

const image2xy = require('astrometry.js').image2xy;

const result = image2xy(buf, { verbose: true, extension: 0 });

Install (Browser)

<script src="https://cdn.jsdelivr.net/npm/astrometry.js"></script>

Usage

You'll need to do a little bit of work to get a file buffer on the browser.

var reader = new FileReader();

reader.onload = function (e) {
    // Get the image file as a buffer
    var buf = new Uint8Array(e.currentTarget.result);

    // Get a fits file buffer containing a star list
    const results = astrometry(buf, { verbose: true, extension: 0 });
};

reader.readAsArrayBuffer(file);

Example

The following shows an example output.

const result = image2xy(buf, { verbose: true, extension: 0 });

>   infile=fits_buf.fits
    outfile=fits_buf.xy.fits
    nhdus=1
    Got naxis=2, na1=4096, na2=4096
    simplexy: nx=4096, ny=4096
    simplexy: dpsf=1.000000, plim=8.000000, dlim=1.000000, saddle=5.000000
    simplexy: maxper=1000, maxnpeaks=10000, maxsize=2000, halfbox=100
    simplexy: median smoothing...
    simplexy: measuring image noise (sigma)...
    Sampling sigma at 42025 points
    Nsigma=0.7, s=13.132
    simplexy: found sigma=13.132.
    simplexy: finding objects...
    simplexy: found 734 blobs
    simplexy: finding peaks...
    simplexy: found 743 sources.

Options

You may use the same options that image2xy supports by providing the flags directly, or you may use the following human friendly versions.

Options List

|Option|Flag|Type|Description| |------|----|----|-----------| |help|'h'| boolean | Print available options and usage instructions| |verbose|'v'| boolean | Print verbose messages| |extension|'e'| number | Read from a single FITS extension| |downsampleFactor|'D'| number | Downsample, if necessary, by this many factors of two| |medianFilteringScale|'s'| number | Set median-filter box size (default 100 pixels)| |psfWidth|'w'| number | Set Gaussian PSF sigma (default 1 pixel)| |noiseLevel|'g'| number | Set image noise level| |peakSigma|'p'| number | Set significance level of peaks (default 8 sigmas)| |saddleLevel|'a'| number | Set saddle level joining peaks (default 5 sigmas)| |disableBackgroundSubtraction|'b'| boolean |Don't do (median-based) background subtraction| |backgroundLevel|'G'| number | Subtract this 'global' background value; implies -b| |outputFilename|'o'| filename | Write XYlist to given filename.| |backgroundSubtractedImageName|'S'| filename | Save background-subtracted image to this filename (FITS float image)| |backgroundImageName|'B'| filename | Save background image to filename| |smoothedImageName|'U'| filename | Save smoothed background-subtracted image to filename| |maskImageName|'M'| filename | Save mask image to filename| |blobImageName|'C'| filename | Save connected-components image to filename|