Commit 70724fe5 authored by LUSTIG Peter's avatar LUSTIG Peter

Added Interpolation for completness threshold evaluation

parent 3950e2b6
......@@ -181,13 +181,6 @@ class PCEvaluation:
return completness, purity, norm_comp, norm_pur
def InterpolateCompletnessThreshold(self, threshold, completness=None):
if completness is None:
completness = self.completness
nextidx = np.argsort(np.absolute(completness - threshold))[:2]
nextidx = np.sort(nextidx)
## np.interp(???) maybe even sorting not necessary
def PlotBin(self, data, title='', flux=None, thresh=None,
nfluxlabels=None, nthreshlabels=None, **kwargs):
......@@ -392,6 +385,18 @@ class PCAreaEvaluation:
return None
def InterpolateCompletnessThreshold(self, threshold, completness=None,
if completness is None:
completness = self.completness
if detection_thresholds is None:
detection_thresholds = self.thresholds
thresh = np.interp(threshold, completness[::-1],
return thresh
def PlotMask(self, mask=None, sources=False, sourcecat=None,
realsources=False, realsourcecat=None, **kwargs):
if mask is None:
......@@ -554,7 +559,6 @@ if __name__ == '__main__':
addmaskname = ('/home/peter/Dokumente/Uni/Paris/Stage/FirstSteps/'
hdul =
sources =['DETECTED_SOURCES'])
realsources =, 'DETECTED_SOURCES')
......@@ -574,7 +578,7 @@ if __name__ == '__main__':
if(1): # plot mask
fig = plt.figure()
ax, img = aa.PlotMask(sources=True, realsources=False)
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