@hscmap/fits
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -312,3 +312,3 @@ (function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap | ||
module.exports = function() { | ||
return new Worker(__webpack_require__.p + "f3f526e31a80e57598fc.worker.js"); | ||
return new Worker(__webpack_require__.p + "8a759e0fa39a925b8dd4.worker.js"); | ||
}; | ||
@@ -315,0 +315,0 @@ |
{ | ||
"name": "@hscmap/fits", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "fits (Flexible Image Transport System) reader module", | ||
@@ -5,0 +5,0 @@ "main": "build/dist/index.js", |
@@ -9,3 +9,3 @@ # Introduction | ||
```typescript | ||
import { Fits, DataType } from "@hscmap/fits" | ||
import { Fits, Hdu } from "@hscmap/fits" | ||
const sampleFitsURL = require<string>('file-loader!./sample.fits') | ||
@@ -15,5 +15,14 @@ | ||
window.addEventListener('load', async e => { | ||
const fits = await Fits.fetch(sampleFitsURL, [{ sourceIndex: 0, outputDataType: DataType.uint8, doNotScaleImageData: true }]) | ||
const hdu = fits[0] | ||
const fits = await Fits.fetch(sampleFitsURL, [ | ||
{ outputDataType: Fits.DataType.uint8 }, | ||
{ outputDataType: Fits.DataType.uint8 }, | ||
]) | ||
for (const hdu of fits) { | ||
showHdu(hdu) | ||
} | ||
}) | ||
function showHdu(hdu: Hdu) { | ||
const width = hdu.card('NAXIS1', 'number') | ||
@@ -33,5 +42,6 @@ const height = hdu.card('NAXIS2', 'number') | ||
const j = (height - y) * width + x | ||
imagedata.data[4 * j] = array[i] | ||
imagedata.data[4 * j + 1] = array[i] | ||
imagedata.data[4 * j + 2] = array[i] | ||
const value = array[i] | ||
imagedata.data[4 * j] = value | ||
imagedata.data[4 * j + 1] = value | ||
imagedata.data[4 * j + 2] = value | ||
imagedata.data[4 * j + 3] = 255 | ||
@@ -47,3 +57,5 @@ } | ||
document.body.appendChild(pre) | ||
}) | ||
document.body.appendChild(document.createElement('hr')) | ||
} | ||
``` | ||
@@ -50,0 +62,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
475012
17
15242
60