Напишите число в центрах каждого пикселя HealPix - PullRequest
0 голосов
/ 06 июня 2018

У меня есть график HealPix, созданный с помощью HEALPY, как в Healpy: от карты данных к карте Healpix (с меньшим количеством пикселей, например, с nside = 2, см. Код ниже).

import healpy as hp
import numpy as np
import matplotlib.pyplot as plt

# Set the number of sources and the coordinates for the input
nsources = int(1.e4)
nside = 2
npix = hp.nside2npix(nside)

# Coordinates and the density field f
thetas = np.random.random(nsources) * np.pi
phis = np.random.random(nsources) * np.pi * 2.
fs = np.random.randn(nsources)

# Go from HEALPix coordinates to indices
indices = hp.ang2pix(nside, thetas, phis)

# Initate the map and fill it with the values
hpxmap = np.zeros(npix, dtype=np.float)
hpxmap[indices] += fs[indices]

# Inspect the map
hp.mollview(hpxmap)

пример графика

Как мне написать текст со значением в центре каждого HEALPix, который я имею на графике?Например, как написать идентификатор для каждого «пикселя», используя массив типа range(len(hpxmap))?

Заранее большое спасибо за вашу помощь!

...