Giter Site home page Giter Site logo

healpix.jl's Introduction

Healpix

Stable Dev Build Status Codecov ascl:2109.028

Healpix.jl is a set of Julia functions that implement the HEALPix algorithms to pixelate a 2-sphere. The HEALPix pixelisation has a number of features that make it efficient for the following tasks:

  • All pixels have the same area (equal-area pixelisation);
  • It is efficient to compute the Fourier decomposition in spherical harmonics of a discretized signal on the sphere (using the RING ordering scheme);
  • It is efficient to find neighbour pixels (using the NESTED ordering scheme);
  • The base pixelisation divides the 2-sphere in 12 pixels, but each of these pixels can be divided into four sub-pixels, and the process can be continued; in principle, the size of a pixel can be reduced to arbitrarily small values.

HEALPix is widely used in cosmology to store maps of the CMB temperature and polarization anisotropies, which is the field studied by the authors of this package.

Supported platforms

The purpose of Healpix.jl, is to implement a Julia-only library, instead of providing bindings to the original implementation of the C/C++/Fortran/Python Healpix library. This means that, unlike the original implementation, Healpix.jl is fully supported on Windows systems, among with Linux and Mac OS X.

Installation

From the Julia REPL, run

import Pkg
Pkg.add("Healpix.jl")

Usage examples

Here are some code snippets that show how to use Healpix.jl. It is interesting to have a look at test/runtests.jl as well.

Refer to the documentation for more examples.

Dealing with resolutions

The resolution of a HEALPix map is uniquely determined by the NSIDE parameter. Healpix.jl precalculates a number of values from NSIDE to save time during computations; such values are saved in a Healpix.Resolution object:

import Healpix
res = Healpix.Resolution(256)
print("The pixel index is $(Healpix.ang2pixNest(res, 0.1, 0.2))\n")

Reading a map from a FITS file

This snippet loads a map named planck_70GHz.fits into an array of 64-bit floating-point numbers:

import Healpix

m = Healpix.readMapFromFITS("planck_70GHz.fits", 1, Float64)
print("average: $(mean(m.pixels))\n")

How to contribute

See the document CONTRIBUTING.md.

Citing Healpix.jl

If you have used Healpix.jl in your research and want to acknowledge the library in your academic publications, you can reference its ASCL entry through the code ascl:2109.028:

Tomasi M., Li Z. 2021 Healpix.jl: Julia-only port of the HEALPix library, 0.30, Astrophysics Source Code Library ascl:2109.028

Be sure to append ascl:2109.028 to the end of the citation, so that ADS and other bibliographic databases can create a reference to this package.

Here is a BibTeX entry ready to be used, generated by ADS:

@MISC{2021ascl.soft09028T,
       author = {{Tomasi}, Maurizio and {Li}, Zack},
        title = "{Healpix.jl: Julia-only port of the HEALPix library}",
     keywords = {Software},
      version = {3.0},     
         year = 2021,
        month = sep,
          eid = {ascl:2109.028},
        pages = {ascl:2109.028},
archivePrefix = {ascl},
       eprint = {2109.028},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2021ascl.soft09028T},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Please update the version number (version = {โ€ฆ}) accordingly.

See the ASCL guidelines for more information.

License

Healpix.jl is released under the GPL license. Versions before 2.3.0 were released under a MIT license, but this was considered incompatible with the way the code has been written (#15).

healpix.jl's People

Contributors

ziotom78 avatar xzackli avatar leeobianchi avatar giordano avatar juliatagbot avatar fincardona avatar

Stargazers

Arthur Loureiro avatar

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.