Commit 3a77a79f authored by LUSTIG Peter's avatar LUSTIG Peter

jackknife creation in loop

parent 23d7e729
......@@ -120,8 +120,10 @@ def CreateParallelJackkifes(jkiter, parity_threshold):
return jk
##############################################################
np.random.seed(0)
flux = np.array([10]) * u.mJy
nsim = 8
nsim = 1
min_detection_threshold = 3
nsources = 2
photometry = True
......@@ -178,19 +180,9 @@ jk_filenames = list(Path(DATA_DIR).glob('*/map.fits'))
for i in range(len(jk_filenames)):
jk_filenames[i] = str(jk_filenames[i])
jk_iter = Jackknife(jk_filenames, n=nsim)
print('Done in {:.2f}s'.format(clock()-t0))
print("Creating {} Jackkife Maps".format(nsim))
to = clock()
jackknifes = []
for i in range(nsim):
jackknifes.append(jk_iter(parity_threshold=parity_threshold))
jk_iter = Jackknife(jk_filenames, band='2mm', n=nsim)
print('Done in {:.2f}s'.format(clock()-t0))
# set forced minimal distance of two fake sources
min_source_dist = 2 * jackknifes[0].beam.fwhm_pix.value
print('Begin Monte Carlo')
p = Pool(ncores)
......@@ -198,6 +190,30 @@ if nsources == 0:
flux = np.array([0]) * u.mJy
for _flux in flux:
print("Creating {} Jackkife Maps".format(nsim))
to = clock()
jackknifes = []
for i in range(nsim):
jackknifes.append(jk_iter(parity_threshold=parity_threshold))
print('Done in {:.2f}s'.format(clock()-t0))
'''
# %%
# %matplotlib tk
plt.figure()
jackknifes[0].plot()
plt.figure()
jackknifes[0].match_filter(jackknifes[0].beam).plot()
plt.show(block=True)
# %%
sys.exit()
# set forced minimal distance of two fake sources
'''
min_source_dist = 2 * jackknifes[0].beam.fwhm_pix.value
helpfunc = partial(fake_worker, **{'min_threshold':
min_detection_threshold,
'nsources': nsources, 'flux': _flux,
......
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