Commit edca8b56 authored by LUSTIG Peter's avatar LUSTIG Peter

changed condition to simulate without sources

parent 383067fd
......@@ -32,8 +32,6 @@ import datetime
plt.ion()
def fake_worker(jkiter, min_threshold=2, nsources=8**2, flux=1*u.Jy,
within=(0, 1), cat_gen=pos_uniform, parity_threshold=1,
**kwargs):
......@@ -57,7 +55,7 @@ def fake_worker(jkiter, min_threshold=2, nsources=8**2, flux=1*u.Jy,
# Actually rather slow... maybe check the code ?
# print(flux)
if flux is not None:
if flux is not None and (nsources != 0):
img.add_gaussian_sources(nsources=nsources, within=within,
peak_flux=flux, cat_gen=cat_gen, **kwargs)
......@@ -85,7 +83,7 @@ flux = np.geomspace(1, 10, 3) * u.mJy
flux = [0]
nsim = 2
min_detection_threshold = 3
nsources = 5
nsources = 0
outdir = Path("montecarlo_results/")
outdir = Path("testdir")
ncores = 2
......@@ -136,7 +134,7 @@ print('Begin Monte Carlo')
jk_iter_list = [jk_iter] * nsim
p = Pool(ncores)
if flux != [0]:
if nsources != 0:
for _flux in flux:
helpfunc = partial(fake_worker, **{'min_threshold':
......@@ -202,10 +200,11 @@ if flux != [0]:
hdul.writeto(outfile, overwrite=False)
print('results written to {}'.format(outfile))
if flux == [0]:
if nsources == 0:
helpfunc = partial(fake_worker, **{'min_threshold':
min_detection_threshold,
'flux': None,
'nsources': 0,
'within': (0, 1),
'parity_threshold': 0.5})
......
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