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.

147 questions
10
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
  • 405
  • 2
  • 7
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
  • 405
  • 2
  • 7
6
votes
1 answer

Why does a python function work in parallel even if it should not?

I am running this code using the healpy package. I am not using multiprocessing and I need it to run on a single core. It worked for a certain amount of time, but, when I run it now, the function healpy.projector.GnomonicProj.projmap takes all the…
6
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
  • 423
  • 4
  • 15
5
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
5
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
  • 657
  • 2
  • 12
  • 26
4
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…
Diana Jovmir
  • 41
  • 1
  • 3
3
votes
2 answers

How to efficiently perform a top-hat (disk-like) smoothing on a healpix map?

I've got a high-resolution healpix map (nside = 4096) that I want to smooth in disks of a given radius, let's say 10 arcmin. Being very new to healpy and having read the documentation I found that one - not so good - way to do this was to perform a…
Hermanter
  • 225
  • 1
  • 9
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
  • 187
  • 1
  • 3
  • 7
3
votes
2 answers

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
  • 657
  • 2
  • 12
  • 26
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 can I generate 2D histogram with my customized bins?

I am a physicist studying about super-galactic objects and I feel like it is difficult to make 2D histogram based on what I want to make. To avoid confusion and getting answer what I already know. I will show two method which I already know and then…
Kyle
  • 80
  • 4
2
votes
1 answer

Spherical harmonic transform of complex-valued map?

Can healpy compute the spherical harmonic transform of a complex-valued map? When I try this using healpy.sphtfunc.map2alm, there is no warning, but the function gives a_{l,m} only for m>0. This makes sense for real-valued maps, for which a_{l,-m} =…
2
votes
1 answer

Rotating a healpy(or healpix) map to an arbitrary direction

I have a healpy map that contains an object centered at the location Dec=0 deg and RA=0 deg. Now I want to move the position of the object to an arbitrary point, for instance, Dec=20 deg, RA=10 deg. Is there a simple and precise way of doing the…
SD11
  • 165
  • 1
  • 7
1
2 3
9 10