Skip to content

Commit

Permalink
added the ability to cut 0 baselines for bispectra and have the right…
Browse files Browse the repository at this point in the history
… minimal set
  • Loading branch information
klbouman committed Dec 26, 2018
1 parent c6f342a commit 773412c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ehtim/obsdata.py
Expand Up @@ -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
Expand All @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions ehtim/statistics/dataframes.py
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 773412c

Please sign in to comment.