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,
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,
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
plt.title('Detected Sources (SNR {})'.format(thresh), fontsize=30)
plt.imshow(data, origin='lower', aspect='auto', **kwargs)
cbar = plt.colorbar()
def UglyLoader(filename):
hdul = fits.HDUList(
......@@ -338,5 +358,7 @@ if __name__ == '__main__':
sources =, 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.)
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