def drawTS(self,ax=None, filename=None, zidx=0):
if not ax: ax = plt.gca()
if not filename:
#dirname = self.config.params['output2']['searchdir']
#basename = self.config.params['output2']['mergefile']
#filename = os.path.join(dirname,basename)
filename = self.config.mergefile
results=pyfits.open(filename)[1]
pixels = results.data['PIXEL']
values = 2*results.data['LOG_LIKELIHOOD']
if values.ndim == 1: values = values.reshape(-1,1)
ts_map = healpy.UNSEEN * numpy.ones(healpy.nside2npix(self.nside))
# Sum through all distance_moduli
#ts_map[pixels] = values.sum(axis=1)
# Just at maximum slice from object
ts_map[pixels] = values[:,zidx]
#im = healpy.gnomview(ts_map,**self.gnom_kwargs)
#healpy.graticule(dpar=1,dmer=1,color='0.5',verbose=False)
#pylab.close()
#im = ax.imshow(im,origin='bottom')
im = drawHealpixMap(ts_map,self.glon,self.glat,self.radius,coord=self.coord)
try: ax.cax.colorbar(im)
except: pylab.colorbar(im)
ax.annotate("TS",**self.label_kwargs)
return im
评论列表
文章目录