From 773412cf9f2fd5c37c7b5f6981e5752d37dd788b Mon Sep 17 00:00:00 2001 From: klbouman Date: Wed, 26 Dec 2018 16:58:25 -0500 Subject: [PATCH] added the ability to cut 0 baselines for bispectra and have the right minimal set --- ehtim/obsdata.py | 6 +++--- ehtim/statistics/dataframes.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ehtim/obsdata.py b/ehtim/obsdata.py index 6f2cdc6f..fe068621 100644 --- a/ehtim/obsdata.py +++ b/ehtim/obsdata.py @@ -1010,7 +1010,7 @@ def add_amp(self, avg_time=0, scan_avg=False, debias=True, err_type='predicted', return def add_bispec(self, avg_time=0, return_type='rec', count='max', snrcut=0., - err_type='predicted', num_samples=1000, round_s=0.1): + err_type='predicted', num_samples=1000, round_s=0.1, uv_min=False): """Adds attribute self.bispec: bispectra table with bispectra averaged for dt @@ -1033,10 +1033,10 @@ def add_bispec(self, avg_time=0, return_type='rec', count='max', snrcut=0., if avg_time>tint0: - cdf = make_bsp_df(self, mode='all', round_s=round_s, count=count, snrcut=0.) + cdf = make_bsp_df(self, mode='all', round_s=round_s, count=count, snrcut=0., uv_min=uv_min) cdf = average_bispectra(cdf,avg_time,return_type=return_type,num_samples=num_samples, snrcut=snrcut) else: - cdf = make_bsp_df(self, mode='all', round_s=round_s, count=count, snrcut=snrcut) + cdf = make_bsp_df(self, mode='all', round_s=round_s, count=count, snrcut=snrcut, uv_min=uv_min) print("Updated self.bispec: no averaging") if return_type=='rec': cdf = df_to_rec(cdf,'bispec') diff --git a/ehtim/statistics/dataframes.py b/ehtim/statistics/dataframes.py index 0ea7854e..b597e6ab 100644 --- a/ehtim/statistics/dataframes.py +++ b/ehtim/statistics/dataframes.py @@ -374,7 +374,7 @@ def make_camp_df(obs,ctype='logcamp',debias=False,band='unknown',polarization='u df['catype'] = ctype return df -def make_bsp_df(obs,band='unknown',polarization='unknown',mode='all',count='min',round_s=0.1,snrcut=0.): +def make_bsp_df(obs,band='unknown',polarization='unknown',mode='all',count='min',round_s=0.1,snrcut=0., uv_min=False): """generate DataFrame of bispectra @@ -386,7 +386,7 @@ def make_bsp_df(obs,band='unknown',polarization='unknown',mode='all',count='min' df: bispectra data in DataFrame format """ - data = obs.bispectra(mode=mode,count=count,snrcut=snrcut) + data = obs.bispectra(mode=mode,count=count,snrcut=snrcut,uv_min=uv_min) sour=obs.source df = pd.DataFrame(data=data).copy() df['fmjd'] = df['time']/24.