def DrawStat(stat, zoom_to_point = False): # if stat.ellipse_b == 0: # ds9.zoom(22, stat.centroid_x,stat.centroid_y, 0) # use to zoom to a single point argstring = "@:"+str(4*stat.ellipse_Ixx)+','+str(4*stat.ellipse_Ixy)+','+str(4*stat.ellipse_Iyy) #multiply by four just to make it more exaggerated otherwise they all look like cirlces ds9.dot(argstring,stat.centroid_x,stat.centroid_y) #ellipse around the centroid ds9.dot("x",stat.centroid_x,stat.centroid_y)# cross on the peak displayUtils.drawBBox(stat.BBox, borderWidth=0.5) # border to fully encompass the bbox and no more if zoom_to_point: ds9.zoom(22, stat.centroid_x,stat.centroid_y, 0) # use to zoom to a single point print 'length (diag,px) = %s, length (3D,true,um) = %s, flux = %s, npix = %s, dedx = %s' %(stat.diagonal_length_pixels, stat.length_true_um, stat.flux, stat.npix, stat.de_dx)
def DrawStatCustom(stat,x,y): metadata_filename = '/home/mmmerlin/useful/herring_bone.fits' image = AssembleImage(stat.filename, metadata_filename, True) print "track at %s,%s in %s"%(stat.centroid_x,stat.centroid_y,stat.filename) ds9.mtv(image) # exit() # ds9.dot(argstring,stat.centroid_x,stat.centroid_y) #ellipse around the centroid # ds9.dot("x",stat.centroid_x,stat.centroid_y)# cross on the peak # displayUtils.drawBBox(stat.BBox, borderWidth=0.5) # border to fully encompass the bbox and no more ds9.zoom(22, x,y, 0) # use to zoom to a single point
def DrawStatFromScratch(stat, bgsubtract): metadata_filename = '/home/mmmerlin/useful/herring_bone.fits' image = AssembleImage(stat.filename, metadata_filename, bgsubtract) print "track at %s,%s in %s"%(stat.centroid_x,stat.centroid_y,stat.filename) ds9.mtv(image) # exit() argstring = "@:"+str(4*stat.ellipse_Ixx)+','+str(4*stat.ellipse_Ixy)+','+str(4*stat.ellipse_Iyy) #multiply by four just to make it more exaggerated otherwise they all look like cirlces ds9.dot(argstring,stat.centroid_x,stat.centroid_y) #ellipse around the centroid ds9.dot("x",stat.centroid_x,stat.centroid_y)# cross on the peak displayUtils.drawBBox(stat.BBox, borderWidth=0.5) # border to fully encompass the bbox and no more ds9.zoom(22, stat.centroid_x,stat.centroid_y, 0) # use to zoom to a single point
def testZoomPan(self): ds9.pan(205, 180) ds9.zoom(4) ds9.zoom(4, 205, 180, frame=1)
minors.append(axesshape.getB()) thetas.append(axesshape.getTheta()) centroid_x, centroid_y = footprint.getCentroid() xcoords.append(centroid_x) ycoords.append(centroid_y) print "#px = %s" %footprint.getNpix() if DISPLAY_LEVEL >= 2: argstring = "@:"+str(4*quadshape.getIxx())+','+str(4*quadshape.getIxy())+','+str(4*quadshape.getIyy()) #multiply by four just to make it more exaggerated otherwise they all look like cirlces ds9.dot(argstring,centroid_x,centroid_y) #ellipse around the centroid ds9.dot("x",centroid_x,centroid_y)# cross on the peak displayUtils.drawBBox(footprint.getBBox(), borderWidth=0.0) ds9.zoom(10, 2000, 2035) #=============================================================================== # for t in thetas: # print "theta = %s" %(t*180./np.pi) #=============================================================================== # Now make a bunch of plots #=============================================================================== #=============================================================================== # Plot options #===============================================================================