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
0
votes
1 answer

How to draw blank map using Healpy

I am new in it, and cant fully understand the manual. I am running test code, but I want to make blank map, without this gradient colors. I think it's not hard for those who know. Help me please.Here what i got import numpy as np import healpy as…
0
votes
0 answers

Color of masked values in healpy

Is there a way to change the color of masked value when masking a healpy mask? Is there a way to make the map more aesthetic? Right now it just drops grey pixels on the map where the values are masked. The code I use is masked_map =…
Joshhh
  • 425
  • 1
  • 4
  • 18
0
votes
1 answer

Would like to make a healpix log density all-sky map with healpy

I have a set of large, >10M object, files with R.A.s and Declinations. I'd like to make log density all-sky maps of these, using, I presume healpix/healpy. My current code looks like this: m = hp.ang2pix(512, ra, dec, lonlat=True) NSIDE = 512 …
npross
  • 1,756
  • 6
  • 19
  • 38
0
votes
2 answers

How to draw border on healpy mollview plot?

I'm using hp.mollview() to draw a map where the entire projection is not fully populated. This makes it unclear where the boundaries of the map are because the white background just blends into the white of the figure area. Is it possible to draw…
astrokeat
  • 78
  • 1
  • 7
0
votes
1 answer

How Healpix deal with NaN to interpolate data on the sky map?

I have my data in this format datapoint[37][19] in the phi-theta space. But because my data can not cover the whole sky, so there is some NaN in the datapoint array. There is about half NaN in the whole datapoint. About 9/10 non-NaN values in…
Huanian Zhang
  • 830
  • 3
  • 16
  • 37
0
votes
1 answer

Proper way to degrade a healpix map

I'm trying to degrade a CMB map in healpix format from Nside=4096 to Nside=2048. To my knowledge, there are two ways to achieve this: (a) convert to alm using map2alm and then convert back to a Nside=2048 map using alm2map. (b) use ud_grade in…
lllynx
  • 3
  • 3
0
votes
1 answer

How to find all pixel indices within specified coordinates?

There are a number of Healpix IDL routines designed to find the pixel indices belonging to some geometrical area (e.g. spherical triangle, spherical polygon) defined by its vertices. There are the query_* routines (e.g. query_triangle). See the…
EB2127
  • 1,788
  • 3
  • 22
  • 43
0
votes
1 answer

mollview command not returning plot image

I'm new to healpy and I'm trying to plot the following in iPython27: import numpy as np import healpy as hp NSIDE = 32 m=np.arange(hp.nside2npix(NSIDE)) hp.mollview(m, title="Mollview image RING") This does not return an image as I was expecting.…
berkelem
  • 2,005
  • 3
  • 18
  • 36
0
votes
1 answer

How does Healpy pix2ang read pixel indices?

This is a continuation of this Question: How do HEALPix FITS files of CMB maps translate into ndarrays? What are the coordinates? CMB maps come as FITS files. The map is a 1-dimensional vector of temperature values of the pixels. I would like to…
JianguoHisiang
  • 609
  • 2
  • 7
  • 17
0
votes
0 answers

Understanding Healpy's getformat function

I have a FITS file of a CMB full-sky map, with T, Q, U values. Using the function healpy.fitsfunc.getformat(t), the output is the "FITS convention format string of data type t". For my FITS file, I get "A29". Is this a standardized FITS…
JianguoHisiang
  • 609
  • 2
  • 7
  • 17
0
votes
0 answers

healpy equivalent of alm2fits

I am wondering what is the equivalent of alm2fits in healpy. Let's say I have 3 alms for T,E, and B in healpy, how do I export them so that they can be read by a fortran code trough fits2alm? hp.fitsfunc.write_alm('alms.fits',[alm_T,alm_E,alm_B])…
0
votes
1 answer

applying healpy mask to array of maps

I have a series of maps with two different indices, i and j. Let this be indexed like map_series[i][j]. EDIT 1/21: A minimal working example would be something like map_series=np.array([np.array([np.arange(12) + 0.1*(i+1) + 0.01*(j+1) for j in…
user1451632
  • 301
  • 1
  • 2
  • 10
0
votes
1 answer

Healpy: Rotator function gives different results

I'm using the following script in order to calculate the Galactical Center (GC) position in galactical coordinates (in degrees) to celestial coordinates: import healpy as hp r = hp.Rotator(coord = ['G', 'C'], deg=True) ri = hp.Rotator(coord = ['C',…
user4050567
  • 87
  • 10
0
votes
1 answer

Calling arrays within a list in python

I have healpy maps of the Cosmic Microwave Background. Each map has three fields. I have written the following function within a code to calculate the power spectrum of the first field of a general number of maps: def ps_TT(files): c=[] for i in…
Cosmi
  • 31
  • 1
  • 3
0
votes
1 answer

Healpy Mollview half-sky

This question has two parts: Part 1: the main issue I'm having is in trying to do a half-sky plot using healpy mollview. The current workaround I'm using is this: import numpy as np import healpy as hp import matplotlib.pyplot as plt w, h = 6,…
1 2 3
9
10