def display(self, band="g_SDSS", bands=["g_SDSS", "r_SDSS", "i_SDSS"]): if self.surveyname == "Euclid": bands = ["VIS", "VIS", "VIS"] import pylab as plt plt.ion() plt.figure(1) plt.imshow(self.makeColorLens(bands=bands), interpolation="none") plt.figure(2) import colorImage self.color = colorImage.ColorImage( ) #sigma-clipped single band residual plt.imshow(self.color.createModel(self.fakeResidual[0][band], self.fakeResidual[0][band], self.fakeResidual[0][band])[:, :, 0], interpolation="none") plt.figure(3) plt.imshow(self.fakeResidual[0][band], interpolation="none") try: self.fakeResidual[1]["RF"] plt.figure(4) plt.imshow(self.fakeResidual[1]["RF"], interpolation="none") except KeyError: pass plt.draw() raw_input() plt.ioff()
def makeColorLens(self, bands=["g_SDSS", "r_SDSS", "i_SDSS"], recolourize=True): if self.surveyname == "Euclid" and bands == [ "g_SDSS", "r_SDSS", "i_SDSS" ]: bands = ["VIS", "VIS", "VIS"] import colorImage goodbands = [] for band in bands: try: self.image[band] goodbands.append(band) except KeyError: pass bands = goodbands if len(bands) == 1: bands = [bands[0], bands[0], bands[0]] if len(bands) == 2: bands = [bands[0], "dummy", bands[1]] self.ml["dummy"] = (self.ml[bands[0]] + self.ml[bands[2]]) / 2 self.image["dummy"] = (self.image[bands[0]] + self.image[bands[2]]) / 2 if recolourize: self.color = colorImage.ColorImage() self.color.bMinusr = (self.ml[bands[0]] - self.ml[bands[2]]) / 4. self.color.bMinusg = (self.ml[bands[0]] - self.ml[bands[1]]) / 4. self.color.nonlin = 4. self.colorimage = self.color.createModel(\ self.image[bands[0]],self.image[bands[1]],self.image[bands[2]]) else: self.colorimage = self.color.colorize(\ self.image[bands[0]],self.image[bands[1]],self.image[bands[2]]) return self.colorimage
sigg = pyfits.open("%s/clip_%s_weight_g.fits" % (ddir, pref))[0].data.copy() #[a:-a,a:-a]**-0.5 sigr = pyfits.open("%s/clip_%s_weight_r.fits" % (ddir, pref))[0].data.copy() #[a:-a,a:-a]**-0.5 sigi = pyfits.open("%s/clip_%s_weight_i.fits" % (ddir, pref))[0].data.copy() #[a:-a,a:-a]**-0.5 sigz = pyfits.open("%s/clip_%s_weight_z.fits" % (ddir, pref))[0].data.copy() #[a:-a,a:-a]**-0.5 psfg = pyfits.open("%s/clip_%s_psf_g.fits" % (ddir, pref))[0].data.copy() psfr = pyfits.open("%s/clip_%s_psf_r.fits" % (ddir, pref))[0].data.copy() psfi = pyfits.open("%s/clip_%s_psf_i.fits" % (ddir, pref))[0].data.copy() psfz = pyfits.open("%s/clip_%s_psf_z.fits" % (ddir, pref))[0].data.copy() import colorImage color = colorImage.ColorImage() colorimage = color.createModel(imgg, imgr, imgi) #plt.imshow(colorimage,interpolation="none") #plt.show() psfmode = "crossconvolve" RF = RingFinder(imgg, imgi, sigg, sigi, psfg, psfi, 0.265, 1e12, 1e12, visualize=False, psfmode=psfmode)
sigg=pyfits.open("../dessims/weight_fits/%s_weight_g.fits"%pref)[0].data.copy()[a:-a,a:-a]**-0.5 sigr=pyfits.open("../dessims/weight_fits/%s_weight_r.fits"%pref)[0].data.copy()[a:-a,a:-a]**-0.5 sigi=pyfits.open("../dessims/weight_fits/%s_weight_i.fits"%pref)[0].data.copy()[a:-a,a:-a]**-0.5 psfg=pyfits.open("../dessims/psf_fits/%s_psf_g.fits"%pref)[0].data.copy() psfr=pyfits.open("../dessims/psf_fits/%s_psf_r.fits"%pref)[0].data.copy() psfi=pyfits.open("../dessims/psf_fits/%s_psf_i.fits"%pref)[0].data.copy() #plt.imshow(imgg) #plt.show() #make colour image: import colorImage color = colorImage.ColorImage() colorimage = color.createModel(imgg,imgr,imgi) #plt.imshow(colorimage,interpolation="none") #plt.savefig("colour.png"%pref) #plt.show() RF=RingFinder(imgg,imgi,sigg,sigi,psfg,psfi,0.265,1e12,1e12,visualize=False,psfmode="crossconvolve") RFres=RF.ringfind(vb=True) #ax=plt.subplot(1,3,count) ax=plt.subplot(1,1,1) size=colorimage.shape[0] b=a*1