michitaro / healpix Goto Github PK
View Code? Open in Web Editor NEWAn implementation of HEALPix in JavaScript / TypeScript
License: MIT License
An implementation of HEALPix in JavaScript / TypeScript
License: MIT License
Hi, I'm new to Typescript.
Is there a way to generate API docs?
I see https://github.com/michitaro/healpix#progress but to be able to use it I have to look at the code what the inputs / outputs are. Is that how it's usually done for Typescript?
If there is a way to add docs and you want it here, this could be something I contribute to a bit while I familiarise myself with TS and this package?
Hey Koike,
Thanks for the package - I'm playing around with visualizing some CMB data and find it really useful. Just a quick question - the latest version does not seem to be published to npm. I can work around it by building locally, but thought I would just let you know.
@michitaro - Hi, I was looking for a TS / JS HEALPix package, thinking to write one, and now see that you've already done it. Awesome, thanks!
One question concerning license: is it really MIT?
The original C++ lib is GPL, so I assume you didn't copy from there?
@michitaro - I'm still in the process of reading the HEALPix papers, using your code to try to fully understand.
This list of variable names and descriptions is very helpful:
https://github.com/michitaro/healpix/blob/master/src/index.ts#L4
You do sometimes use x/y, but those are not defined in the list.
Note that you have tu2fpq
and fxy2tu
, so maybe x/y and p/q are the same?
Is it possible to make the notation more consistent; or to clarify what x/y are in that list?
@michitaro - What is the maximum supported norder
?
I see 16 here:
healpix/spec/generate-testcase.py
Line 39 in 90c15ad
Why is that?
Naively I would think that orders up to 24 can be supported, given that JS has numbers that can represent int up to 53 bit:
>>> import healpy as hp
>>> hp.nside2npix(hp.order2nside(24)) / (2 ** 53)
0.375
I think healpy supports up to order 29, because they have 64 bit integers available.
>>> import healpy as hp
>>> hp.nside2npix(hp.order2nside(29))
3458764513820540928
>>> hp.nside2npix(hp.order2nside(29)) / (2 ** 64)
0.1875
CC @tboch
Hi,
I'm using healpix for a different project, and have been looking around for implementations and came across yours which seems interesting. However, the limitation is at norder <= 15. Current norder doesn't allow high resolution images of nebulas for example when overlaying different frequency image survey maps (infrared, nir, xray etc). Can you tell me what the exact reason for this is? I might be able to help somehow.
I downloaded healpix 3.8 and the doc provides a healpix2 cpp that allows for much higher resolutions, which indicates that the norder can be increased?
Any pointers to the reasons of the limitations greatly appreciated as I can further investigate.
Do you know how deep this module can go. Will it go beyond a nside of 13?
@michitaro - Is the algorithm you use for disk query described somewhere?
(a webpage or paper?)
If no, could you please add a few comments to the docstring to make it easier to understand what it does?
Line 135 in 99f2305
@michitaro - I'm completely new to Typescript and pretty new to JS, so apologies for the basic question.
How can one use this library as a simple JS library from a HTML web page?
I did this to generate src/index.js
git clone https://github.com/michitaro/healpix.git
cd healpix
npm install -g typescript
tsc src/index.ts
and then made an example.html
with this:
<script src="src/index.js"></script>
<script>
var result = healpix.ang2pix(12, 42, 43);
console.log(result);
<script>
but then in the browser I get these errors:
Uncaught ReferenceError: exports is not defined
at index.js:18
example.html:3 Uncaught ReferenceError: healpix is not defined
at example.html:3
@michitaro - is use as simple JS library something you want to support?
If yes, could you please document the steps and give a minimal example how to do it?
Is it a good or bad idea to store the generated healpix.js
in the repo to make this easier?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.