healpy

Make a 2D histogram with HEALPix pixellization using healpy

这一生的挚爱 提交于 2020-08-01 07:00:47
问题 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 density of some point with (l, b) coordinates in the sky, using HEALPix pixellization on Mollweide projection. How can I do this using healpy ? The tutorial: http://healpy.readthedocs.io/en/v1.9.0/tutorial.html says how to plot a 1D array, or a fits

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

旧城冷巷雨未停 提交于 2020-01-04 02:34:34
问题 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 apt-get install python-vm-builder But when I install Healpy using the command: pip install healpy it gives me following error: error: command 'i686-linux-gnu-gcc' failed with exit status 1 error code 1 in /tmp/pip_build_sibte/healpy Traceback (most recent call

How do HEALPix FITS files of CMB maps translate into ndarrays? What are the coordinates?

十年热恋 提交于 2019-12-25 02:53:07
问题 I'm using Healpy (the HEALPix tools developed in Python) to read and write full-sky CMB maps. I am confused as to how the coordinates of pixels on a sky map translates into entries of a numpy ndarray. How does one HEALPix pixel in a FITS file translate into an ndarray entry? For example, let's say I have a generated CMB map, Nside=64, lmax=64, using the default RING scheme. The total number of pixels is given by Npix=12*Nside**2. So, for my example, that is 49152 total number of pixels. The

How do HEALPix FITS files of CMB maps translate into ndarrays? What are the coordinates?

青春壹個敷衍的年華 提交于 2019-12-25 02:53:03
问题 I'm using Healpy (the HEALPix tools developed in Python) to read and write full-sky CMB maps. I am confused as to how the coordinates of pixels on a sky map translates into entries of a numpy ndarray. How does one HEALPix pixel in a FITS file translate into an ndarray entry? For example, let's say I have a generated CMB map, Nside=64, lmax=64, using the default RING scheme. The total number of pixels is given by Npix=12*Nside**2. So, for my example, that is 49152 total number of pixels. The

mollview: use matplotlib colormaps and change background color

陌路散爱 提交于 2019-12-22 08:16:54
问题 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 way I can set it to white 回答1: healpy seems to make a modification to its default colormap to change what happens when the color is out of range. So, we need to do the same before we give cm.bwr to healpy . We can do this with cmap.set_under('w') to

Healpy/Healpix: What is the relationship between the total pixels and total spherical harmonic coefficients?

筅森魡賤 提交于 2019-12-11 21:02:48
问题 Based on the Healpy/Healpix documentation, I cannot understand the relationship between one pixel in a sky map (which is some measured value) and the spherical harmonic coefficients produced by Healpy's healpy.sphtfunc.map2alm function, which computes an array of the a_lm coefficients for a given map. (This question also applies to anafast.) My understanding is that a given pixel should correspond to a spherical harmonic coefficient. However, it doesn't. At all. Take a map with nside = 8 .

Plotting a numpy array in healpy

孤街醉人 提交于 2019-12-11 12:11:48
问题 I am attempting to produce a beam on a healpix map, using healpy. For starters, I would like to be able to produce a 2D gaussian in a mollweide projection, but I really don't know where to begin. I can define a 2D gaussian: import numpy as np def gaussian_2D(x,y,mu_x=0.,mu_y=0.,sig_x=1.,sig_y=1.): return np.exp(-0.5*(((x-mu_x) / sig_x)**2 + ((y-mu_y) / sig_y)**2)) such that I can build up a 3D X, Y, Z space like: delta = 0.025 x = np.arange(-4, 4, delta) y = np.arange(-4, 4, delta) X, Y = np

Apply rotation to HEALPix map in healpy

孤人 提交于 2019-12-10 17:22:59
问题 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 (l,b) to (phi,theta) and then using healpy.ang2pix to reorder the pixels, but the map still looks strange. It would be great if there was a function similar to Rotator that you could call like: map = AnotherRotator(map,coord=['G','C']) . Anybody

How to convert and save healpy map to different coordinate system?

允我心安 提交于 2019-12-08 03:58:05
问题 I have a healpix map with galactic coordinate. I would like to convert that map into equatorial coordinate system. I know that I could plot map in equatorial coordinate using mollview() function. Do you have any way to save such transformed map? Thanks Vinu 回答1: The following function changes the coordinates system of a map. def change_coord(m, coord): """ Change coordinates of a HEALPIX map Parameters ---------- m : map or array of maps map(s) to be rotated coord : sequence of two character

How to convert and save healpy map to different coordinate system?

余生长醉 提交于 2019-12-06 14:43:38
I have a healpix map with galactic coordinate. I would like to convert that map into equatorial coordinate system. I know that I could plot map in equatorial coordinate using mollview() function. Do you have any way to save such transformed map? Thanks Vinu The following function changes the coordinates system of a map. def change_coord(m, coord): """ Change coordinates of a HEALPIX map Parameters ---------- m : map or array of maps map(s) to be rotated coord : sequence of two character First character is the coordinate system of m, second character is the coordinate system of the output map.