Skip to content

Commit a1a5642

Browse files
committed
lowering snr threshold and min dm
1 parent 2317a5b commit a1a5642

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

T2/cluster_heimdall.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ def parse_candsfile(candsfile):
134134
# how to use ibeam?
135135

136136
# return tab, data, snrs
137-
138-
#return tab[(tab["ibeam"] == 32) | (tab["ibeam"] == 288)]
139-
140137
return tab
141138

142139
def flag_beams(tab,stat=5e5):
@@ -303,7 +300,7 @@ def filter_clustered(
303300
min_dm=50,
304301
min_snr=7.5,
305302
min_snr_wide=9,
306-
min_snr_1arm=9.0,
303+
min_snr_1arm=10,
307304
wide_ibox=17,
308305
max_ibox=33,
309306
min_cntb=None,

T2/socket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def parse_socket(
232232

233233

234234
tab = cluster_heimdall.parse_candsfile(candsfile)
235-
235+
print(f"Tab is {tab}")
236236
# to handle too many futures
237237
if len(futures)>1:
238238
print(f"Waiting for >=2 futures to finish -- skipping {gulps}")
@@ -337,7 +337,7 @@ def cluster_and_plot(tab, gulp=None, selectcols=["itime", "idm", "ibox"],
337337
use_gal_dm = 1
338338

339339
if use_gal_dm == 0:
340-
min_dm = 50.
340+
min_dm = 20.
341341
else:
342342
# Take min DM to be either 0.75 times MW DM or 50., whatever
343343
# is higher.
@@ -475,11 +475,11 @@ def cluster_and_plot(tab, gulp=None, selectcols=["itime", "idm", "ibox"],
475475
df0 = pandas.read_csv(output_file, delimiter=' ', names=columns, on_bad_lines='warn')
476476

477477
dfs = [df0]
478-
if os.path.exists(fl1) and os.path.getsize(fl1): # accumulate to yesterday's for rolling 2-day file
478+
if os.path.exists(fl1): # accumulate to yesterday's for rolling 2-day file
479479
df1 = pandas.read_csv(fl1, on_bad_lines='warn')
480480
dfs.append(df1)
481481

482-
if os.path.exists(fl2) and os.path.getsize(fl2): # accumulate to today's for 1-day file
482+
if os.path.exists(fl2): # accumulate to today's for 1-day file
483483
df2 = pandas.read_csv(fl2, on_bad_lines='warn')
484484
dfs.append(df2)
485485
dfc2 = pandas.concat( (df0, df2) )

scripts/dsa_injection.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
nfrb = len(flist)
3737

3838
for kk in [17,18]:
39-
for ii in np.arange(128):
39+
for ii in np.arange(128)+20:
4040

4141
f = open(fnout,'a')
4242
subbeam = ii
@@ -47,16 +47,17 @@
4747
ind = 0#int(ii%2)#np.where(params[:,-1]==float(frbno))[0]
4848

4949
#mysnr = 0.08#0.2-np.random.uniform()*0.14
50-
mysnr = 0.3
50+
#mysnr = 0.125
51+
mysnr=0.06
5152

5253
DM, SNR, Width_fwhm, spec_ind = params[ind][0],params[ind][1],params[ind][2],params[ind][3]
5354
print("pushing injection to command to etcd")
5455
try:
55-
slack_client.chat_postMessage(channel='candidates', text=f'Sending injection to beam {subbeam} with DM={DM} and SNR={21.*mysnr/0.2}')
56+
slack_client.chat_postMessage(channel='candidates', text=f'Sending injection to beam {subbeam} with DM={DM} and SNR={27.2*mysnr/0.2}')
5657
except:
5758
print("Could not send to slack")
5859
d.put_dict('/cmd/corr/%d'%kk,{'cmd':'inject','val':'%d-%s-%f-'%(subbeam,fn,mysnr)})
59-
d.put_dict('/cmd/corr/%d'%(kk+2),{'cmd':'inject','val':'%d-%s-%f-'%(subbeam,fn,mysnr*35./47./1.4)})
60+
#d.put_dict('/cmd/corr/%d'%(kk+2),{'cmd':'inject','val':'%d-%s-%f-'%(subbeam,fn,mysnr*35./47./1.4)})
6061
imjd = Time.now().mjd
6162
print("writing parameters to disk")
6263
f.write(fmt_out % (imjd, beam, DM, SNR, Width_fwhm, spec_ind, frbno))

0 commit comments

Comments
 (0)