Skip to content

Commit

Permalink
fixing plotting bug with gps again'
Browse files Browse the repository at this point in the history
  • Loading branch information
hposborn committed Aug 21, 2024
1 parent d637528 commit 2eea614
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MonoTools/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2831,11 +2831,11 @@ def init_gp_to_plot(self, n_samp=7, max_gp_len=12000, interp=True, newgp=False,
#assert self.bin_oot
stacktime=np.hstack((self.lc.time[0]-1,self.model_time,self.lc.time[-1]+1))
preds=[]
gp_posteriors=az.extract(self.trace.posterior,var_names=['gp_pred'])
ex_dat=az.extract(self.trace.posterior,var_names=['gp_pred','phot_mean'])

for i in np.random.choice(len(self.trace.posterior['phot_mean']),int(np.clip(10*n_samp,1,len(self.trace.posterior['phot_mean']))),replace=False):
smooth_func=interpolate.interp1d(stacktime, np.hstack((0,gp_posteriors[:,i],0)), kind='slinear')
preds+=[smooth_func(self.lc.time)+self.trace.posterior['phot_mean'].values[i]]
smooth_func=interpolate.interp1d(stacktime, np.hstack((0,ex_dat['gp_pred'][:,i],0)), kind='slinear')
preds+=[smooth_func(self.lc.time)+ex_dat['phot_mean'].values[i]]
prcnts=np.nanpercentile(np.column_stack(preds),[15.8655254, 50., 84.1344746],axis=1)
self.gp_to_plot['gp_pred']=prcnts[1]
self.gp_to_plot['gp_sd']=0.5*(prcnts[2]-prcnts[0])
Expand Down

0 comments on commit 2eea614

Please sign in to comment.