Commit 3766f21f authored by LUSTIG Peter's avatar LUSTIG Peter

end of the day status

parent 9068535f
......@@ -90,6 +90,9 @@ class PCEvaluation:
def GetHitsBin(self, xbin, ybin):
return self.purity[:, ybin, xbin]
# def GetAbsDetections(self, thresh, xbin=None, ybin=None):
# threshidx = find_nearest(self.thresholds, thresh)
def GetCP(self, sources=None, fake_sources=None, wcs=None, shape=None,
pool=None):
if sources is None:
......@@ -278,6 +281,23 @@ class PCEvaluation:
plt.imshow(self.hitmap[iidx], origin='lower', **kwargs)
plt.title('Hitmap {:.1f}'.format(flux), fontsize=30, y=1.02)
def PlotAbsoluteDetection(self, data=None, thresh=0, idx=0, normalize=1,
**kwargs):
tickfs = 20
if data is None:
data = self.detectmap[idx]
if len(data.shape) == 3:
threshidx = find_nearest(self.thresholds, thresh)[0]
data = data[:, :, threshidx]
thresh = self.thresholds[threshidx]
data /= normalize
print(data.shape)
plt.figure()
plt.title('Detected Sources (SNR {})'.format(thresh), fontsize=30)
plt.imshow(data, origin='lower', aspect='auto', **kwargs)
cbar = plt.colorbar()
cbar.ax.tick_params(labelsize=tickfs)
def UglyLoader(filename):
hdul = fits.HDUList(fits.open(filename))
......@@ -338,5 +358,7 @@ if __name__ == '__main__':
'180417_174539_nosources_thresh2.5_nsim5000.fits')
sources = Table.read(fname, 1)
PCEvaluation(sources, None, sh, wcs, None, mapbins=19,
zz = PCEvaluation(sources, None, sh, wcs, None, mapbins=19,
threshold_bins=6, threshold_range=(2.5, 5))
zz.PlotAbsoluteDetection(thresh=2.5, normalize=5000.)
plt.show(block=True)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment