GithubHelp home page GithubHelp logo

michitaro / healpix Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 4.0 1.13 MB

An implementation of HEALPix in JavaScript / TypeScript

License: MIT License

TypeScript 74.68% Python 22.29% HTML 1.23% JavaScript 1.80%
healpix javascript typescript

healpix's People

Contributors

cdeil avatar dependabot[bot] avatar michitaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

healpix's Issues

API docs?

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?

Latest version not published

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.

License?

@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?

Clarify x/y vs p/q

@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?

Maximum supported order?

@michitaro - What is the maximum supported norder?

I see 16 here:

for norder in range(16):

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

norder limitation

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.

How deep?

Do you know how deep this module can go. Will it go beyond a nside of 13?

Algorithm in disk query?

@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?

export function query_disc_inclusive_nest(nside: number, v: V3, radius: number, cb: (ipix: number) => void) {

Document how to use as a JS library?

@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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.