Commit 23d7e729 authored by LUSTIG Peter's avatar LUSTIG Peter

added function to combine measurements

parent 6e2d3f24
......@@ -386,15 +386,28 @@ def PlotFixedThreshold(thresholds, bin, completness, allthresholds, flux,
framealpha=1)
plt.setp(legend.get_title(), fontsize=25)
plt.show(block=True)
# plt.close('all')
# _data = next(Jackknife(filenames, n=None))
# # TODO: Should in principle be the same, but is not... check....
# _ = plt.hist((data.data - _data.data)[~data.mask & ~_data.mask],
# bins=1000, range=[-0.1, 0.1], log=True)
def CombineMeasurements(sourceslist, fakesourceslist):
fake_sources = Table()
sources = Table()
for _fake, _detected in zip(fakesourceslist, sourceslist):
n_fake = len(fake_sources)
n_detected = len(sources)
if _detected is not None:
_detected['ID'] = _detected['ID'] + n_detected
if 'fake_sources' in _detected.keys():
_detected['fake_sources'] = _detected['fake_sources'] + n_fake
sources = vstack([sources, _detected])
if _fake is not None:
_fake['ID'] = _fake['ID'] + n_fake
if 'find_peak' in _fake.keys():
_fake['find_peak'] = _fake['find_peak'] + n_detected
fake_sources = vstack([fake_sources, _fake])
return sources, fake_sources
# Create the flux and threshold axes...
if __name__ == "__main__":
DATA_DIR = "/home/peter/Dokumente/Uni/Paris/Stage/data/v_1"
......
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