2

I am trying to plot 3 numpy arrays with healpy. Two of them correspond to angular positions theta and phi, and the other one is a temperature. I have used the information from this previous answer: Plotting a numpy array in healpy to do it, and I have done it as follows:

    NSIDE = 512
    m_sm = numpy.arange(healpy.nside2npix(NSIDE) ) 
    m_sm = m_sm*0.                                               
    indx = healpy.pixelfunc.ang2pix(NSIDE, theta, phi, lonlat=False) 
    m_sm[indx] = Temp

Where theta, phi and Temp are my arrays (each one has near to 1 million elements, but it looks like there is no incompatibility with this line m_sm[indx] = Temp). Then, I performed the projection with mollview as:

    gmap=healpy.smoothing(m_sm, sigma=numpy.radians(0.3),verbose=False) 
    cmap = cm.get_cmap('RdBu_r')
    cmap.set_under('w')
    healpy.mollview(gmap, title=ur"$T(\mathbf{x})$ for Reconstruction 1", 
            unit=ur"$T(\mathbf{x})$", nest=False, min=gmap.min(), 
            max=gmap.max(), remove_dip=False, cmap = cmap, 
            coord=['C','G'])

But I obtained the following map with a strange pattern of white lines passing through all the map.

Temperature map in galactic coordinates with an strange patter of white lines

Even with NSIDE = 256 I obtained the same pattern. I don't know if it may be because I'm working with a cubical grid, and for each cell of the grid I compute the angular position from cartesian positions respect to the center of the box. What can I do? Or what's wrong with my code? Thanks in advance.

Community
  • 1
  • 1
Darivadi
  • 23
  • 6

0 Answers0