リファレンス · 暗い星 (UCAC4の約300万個、12等まで。見ている空の部分のタイルだけを読み込みます)
decodeFaintTile関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { decodeFaintTile } from "@johnmorrisdotca/hoshi-stars/faint";
定義
function decodeFaintTile(tile: FaintTileId, bytes: Uint8Array): FaintTile
引数
| 名前 | 型 | 説明 |
|---|---|---|
tile | FaintTileId | The tile the bytes are of. |
bytes | Uint8Array<ArrayBufferLike> | The file's bytes. |
戻り値
FaintTile
The stars as parallel arrays.
例
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]);この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。