Commit 387db6ca authored by LUSTIG Peter's avatar LUSTIG Peter

added plotfunction for percentiles

parent 2be1717e
......@@ -495,6 +495,22 @@ class PCAreaEvaluation:
return np.nanpercentile(flux[~totmask], percentiles)
def PlotPercentiles(self, percentiles=None, influx=None):
if percentiles is None:
percentiles = self.fluxpercentiles
if influx is None:
influx = self.flux
percentiles = np.copy(percentiles).T
medidx = int(percentiles.shape[0] / 2)
plt.plot(influx, percentiles[medidx]/influx)
colorarr = ['red', 'yellow']
for iperc in range(1, medidx+1):
plt.fill_between(influx,
percentiles[medidx-iperc]/influx,
percentiles[medidx+iperc]/influx,
alpha=.5, facecolor=colorarr[iperc-1])
def GetNormedDetections(self, absolute_detections=None, norm=None):
if absolute_detections is None:
absolute_detections = self.absolute_detections
......@@ -555,7 +571,8 @@ class PCAreaEvaluation:
ax.set_yscale("log", nonposy='clip')
def FitFluxResolution(self, flux, bins=25, clipmin=20, clipmax=80, **kwargs):
def FitFluxResolution(self, flux, bins=25, clipmin=0, clipmax=100,
**kwargs):
realfluxidx = find_nearest(self.flux.to_value(u.mJy),
flux.to_value(u.mJy))[0]
realflux = self.flux[realfluxidx]
......@@ -726,7 +743,7 @@ if __name__ == '__main__':
rsfname = ('/home/peter/Dokumente/Uni/Paris/Stage/FirstSteps/Completness/'
'sourcemap/180419_183430_sourcemap_thresh2.fits')
addmaskname = ('/home/peter/Dokumente/Uni/Paris/Stage/FirstSteps/'
'Completness/hlsmask.fits')
'Completness/hlsmask3.fits')
hdul = fits.open(fname)
sources = Table.read(hdul['DETECTED_SOURCES'])
......
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