decodeFaintTilefunction
Decode a tile file: n stars as six planes of n bytes (the step in declination, low and high byte; right ascension, low and high; magnitude; colour), the stars sorted by declination; n is the length over six.
Import it
import { decodeFaintTile } from "@johnmorrisdotca/hoshi-stars/faint";
Definition
function decodeFaintTile(tile: FaintTileId, bytes: Uint8Array): FaintTile
Parameters
| Name | Type | Description |
|---|---|---|
tile | FaintTileId | The tile the bytes are of. |
bytes | Uint8Array<ArrayBufferLike> | The file's bytes. |
Returns
FaintTile
The stars as parallel arrays.
Examples
import { decodeFaintTile } from "@johnmorrisdotca/hoshi-stars/faint";
const response = await fetch("https://johnmorrisdotca.github.io/hoshi-stars/faint-tiles/L2/17-12.bin");
const tile = decodeFaintTile({ level: 2, band: 17, column: 12 }, new Uint8Array(await response.arrayBuffer()));
console.log(tile.count, tile.magnitude[0]);