Vadym Voitsekhovskyi
Vadym Voitsekhovskyi

Reputation: 33

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 hp
import pylab as pl
import matplotlib as plt

NSIDE = 32
m = np.arange(hp.nside2npix(NSIDE))
hp.mollview(m)
pl.show()

Upvotes: 0

Views: 374

Answers (1)

Vlas Sokolov
Vlas Sokolov

Reputation: 3893

The numpy function np.arange gives out an array increasing from zero to 12288, which is why you have a gradient on your map.

You can replace that line of code to

m = np.zeros(hp.nside2npix(NSIDE))

if you want to treat blanks in your map as zeros, or to

m = np.full(hp.nside2npix(NSIDE), np.nan)

if you want to use NaN (not a number) value for the blank values on the map.

Upvotes: 1

Related Questions