Questions tagged [healpy]

Healpy provides a python package to manipulate healpix maps. It is based on the standard numeric and visualisation tools for Python, Numpy and matplotlib.

Healpy provides a python package to manipulate healpix maps. It is based on the standard numeric and visualization tools for Python, Numpy, and matplotlib.

The documentation can be found at https://healpy.readthedocs.io/, tutorial at https://healpy.readthedocs.io/en/latest/tutorial.html.

122 questions
9
votes
1 answer

Make a 2D histogram with HEALPix pixellization using healpy

The data are coordinates of objects in the sky, for example as follows: import pylab as plt import numpy as np l = np.random.uniform(-180, 180, 2000) b = np.random.uniform(-90, 90, 2000) I want to do a 2D histogram in order to plot a map of the…
AlbertBranson
  • 375
  • 1
  • 5
9
votes
2 answers

Healpy: From Data to Healpix map

I have a data grid where the rows represent theta (0, pi) and the columns represent phi (0, 2*pi) and where f(theta,phi) is the density of dark matter at that location. I wanted to calculate the power spectrum for this and have decided to use…
user3188290
  • 91
  • 1
  • 5
7
votes
0 answers

Write a number on centers of each HealPix pixels

I have a HealPix plot, made with HEALPY, as in Healpy: From Data to Healpix map (with less pixels, for instance taking nside=2, see code below). import healpy as hp import numpy as np import matplotlib.pyplot as plt # Set the number of sources and…
AlbertBranson
  • 375
  • 1
  • 5
5
votes
0 answers

How to plot vectors on a healpy map (quiver for healpy?)

I'd like to know the simplest way to plot vectors or oriented line segments on a healpy map, e.g. Fig 22 of this paper: https://arxiv.org/abs/1807.06212, screenshotted below. Is something like matplotlib's quiver available to plot on e.g.…
S E Clark
  • 395
  • 2
  • 14
4
votes
3 answers

mollview: use matplotlib colormaps and change background color

I'm trying to use others colormaps on healpy.mollview I succeded with this code from healpy import mollview from pylab import arange, show, cm m = arange(768) mollview(m, cmap=cm.bwr) show() but I get an unexpected blue background and there is no…
user5626202
4
votes
3 answers

Apply rotation to HEALPix map in healpy

I have a HEALPix map that I have read in using healpy, however it is in galactic coordinates and I need it in celestial/equatorial coordinates. Does anybody know of a simple way to convert the map? I have tried using healpy.Rotator to convert from…
aim
  • 585
  • 1
  • 7
  • 22
3
votes
2 answers

Healpy plotting: How do i make a figure with subplots using the healpy.mollview projection?

I've just recently started trying to use healpy and i can't figure out how to make subplots to contain my maps. I have a thermal emission map of a planet as function of time and i need to look at it at several moments in time (lets say 9 different…
3
votes
2 answers

Installation problems with Healpy python-3..4 on ubuntu-14.04

I am new to ubuntu and using ubuntu 14.04 on lenovo t410 with python-3.4 For installing Healpy I have followed following steps; I have installed pthon3-dev package using sudo apt-get install python3-dev and python-vm-builder by: sudo…
Sibte Raza
  • 167
  • 1
  • 3
  • 7
3
votes
1 answer

Adding tick labels to healpy mollview

I am trying to plot a HEALPix mask using healpy, e.g.: import healpy as hp import matplotlib from pylab import * # Read in mask... # ... # Plot mask fig = figure(figsize=(12,8)) ax =…
aim
  • 585
  • 1
  • 7
  • 22
3
votes
1 answer

healpy synfast: how to define the random seed

I'm using healpy.synfast to create maps, but it seems that healpy does not have the "iseed" function (as in here: http://healpix.jpl.nasa.gov/html/facilitiesnode14.htm) which let me define the random seed to be used for the generation of alms from…
2
votes
1 answer

How to turn healpy region into 2d array?

Basically all I want is the functionally of hp.cartview, but I don't want my machine to waste memory plotting the actual map every single time I call the cartview function. How can I obtain a cartesian projection in healpy in the form of a 2d array…
Jsn
  • 107
  • 6
2
votes
1 answer

Healpy query_polygon RuntimeError: Unknown exception

I'm using healpy.query_polygon to get a list of healpix indexes inside a polygon. According to the documentation: vertices: Vertex array containing the vertices of the polygon, shape (N, 3). But when I try to get all indexes from the following…
2
votes
1 answer

How does anafast take care of masking in healpy?

I am trying to compute angular power spectrum from a masked map using anafast in healpy. How does the python version of anafast take care of the effects of masking, compared to e.g., the F90 version, which explicitly takes the mask file as an…
Erwin Lau
  • 21
  • 1
2
votes
1 answer

Cls for fields generated with synalm disagree with input Cls and Cls for fields generated using synfast

I am generating random healpix maps from an input angular power spectrum Cl. If I use healpy.synalm, then healpy.alm2map, and finally test the map by running healpy.anafast on the generated map, the output and input power spectra do not agree,…
2
votes
0 answers

How can I write a healpix map?

I am trying to write a FITS file in the HEALPix format, using healpy and the following script: import healpy as hp fname = 'COM_CMB_IQU-100-fgsub-sevem_2048_R3.00_full.fits' map1 = hp.read_map(fname, field=[0], nest=True) map2 = hp.read_map(fname,…
1
2 3
8 9