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 a3d1812 commit d637528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MonoTools/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2831,10 +2831,10 @@ 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=[]
ext_lightcurves=az.extract(self.trace.posterior,var_names=['gp_pred'])
gp_posteriors=az.extract(self.trace.posterior,var_names=['gp_pred'])

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,ext_lightcurves['gp_pred'][:,i],0)), kind='slinear')
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]]
prcnts=np.nanpercentile(np.column_stack(preds),[15.8655254, 50., 84.1344746],axis=1)
self.gp_to_plot['gp_pred']=prcnts[1]
Expand Down

0 comments on commit d637528

Please sign in to comment.