Skip to content

Commit

Permalink
changing from pm.math.abs_ to pm.math.abs
Browse files Browse the repository at this point in the history
  • Loading branch information
hposborn committed Jul 8, 2024
1 parent cad4bf6 commit 6c7722d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MonoTools/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ def init_pymc(self,ld_mult=1.5):
upper=self.planets[pl]['tcen']+self.planets[pl]['tdur']*0.5,
lower=self.planets[pl]['tcen']-self.planets[pl]['tdur']*0.5,
initval=self.planets[pl]['tcen'])
pers[pl]=pm.Deterministic("per_"+pl, tensor.basic.tile(pm.math.abs_(t0s[pl] - t0_2s[pl]),self.n_margs[pl])/self.planets[pl]['period_int_aliases'])
pers[pl]=pm.Deterministic("per_"+pl, tensor.basic.tile(pm.math.abs(t0s[pl] - t0_2s[pl]),self.n_margs[pl])/self.planets[pl]['period_int_aliases'])
elif pl in self.trios:
t0s[pl] = pm.TruncatedNormal("t0_"+pl,mu=self.planets[pl]['tcen_3'],
sigma=self.planets[pl]['tdur']*self.timing_sigma*self.planets[pl]['tdur'],
Expand Down Expand Up @@ -1530,11 +1530,11 @@ def init_pymc(self,ld_mult=1.5):
# tile=np.tile(weighted_av,mod.n_margs[pl])
# aliases=tile/mod.planets[pl]['period_int_aliases']
#Setting the most recent transit as golden, and then using an average of the two observed transits weighted by distance to fit a period.
pers[pl]=pm.Deterministic("per_"+pl, tensor.basic.tile(pm.math.abs_((self.planets[pl]['p_ratio_32'][0]/self.planets[pl]['p_ratio_21'][1])*(t0s[pl] - t0_2s[pl])/self.planets[pl]['p_ratio_32'][0] + \
pers[pl]=pm.Deterministic("per_"+pl, tensor.basic.tile(pm.math.abs((self.planets[pl]['p_ratio_32'][0]/self.planets[pl]['p_ratio_21'][1])*(t0s[pl] - t0_2s[pl])/self.planets[pl]['p_ratio_32'][0] + \
(self.planets[pl]['p_ratio_21'][0]/self.planets[pl]['p_ratio_32'][1])*(t0_2s[pl] - t0_3s[pl])/self.planets[pl]['p_ratio_21'][0]),self.n_margs[pl])/self.planets[pl]['period_int_aliases'])
else:
t0_2s[pl] = pm.Deterministic("t0_2_"+pl,t0s[pl]-(t0s[pl] - t0_3s[pl])*self.planets[pl]['p_ratio_32'][0]/self.planets[pl]['p_ratio_32'][1])
pers[pl] = pm.Deterministic("per_"+pl, tensor.basic.tile(pm.math.abs_(t0s[pl] - t0_3s[pl])/np.min([self.planets[pl]['p_ratio_32'][0],self.planets[pl]['p_ratio_32'][0]])/self.planets[pl]['p_ratio_32'][1],self.n_margs[pl])/self.planets[pl]['period_int_aliases'])
pers[pl] = pm.Deterministic("per_"+pl, tensor.basic.tile(pm.math.abs(t0s[pl] - t0_3s[pl])/np.min([self.planets[pl]['p_ratio_32'][0],self.planets[pl]['p_ratio_32'][0]])/self.planets[pl]['p_ratio_32'][1],self.n_margs[pl])/self.planets[pl]['period_int_aliases'])

elif pl in self.multis:
self.n_margs[pl]=1
Expand Down Expand Up @@ -1633,8 +1633,8 @@ def init_pymc(self,ld_mult=1.5):
logvels[pl]= pm.Deterministic("logvel_"+pl, pm.math.log(vels[pl]))

#Minimum eccentricity (and the associated omega) are then derived from vel, but are one of a range of values
min_eccs[pl] = pm.Deterministic("min_ecc_"+pl,pm.math.clip(pm.math.abs_(2/(1 + vels[pl]**2) - 1), 1e-4, 1.0-1e-4))
omegas[pl] = pm.Deterministic("omega_"+pl,np.pi-0.5*np.pi*(logvels[pl]/pm.math.abs_(logvels[pl])) )
min_eccs[pl] = pm.Deterministic("min_ecc_"+pl,pm.math.clip(pm.math.abs(2/(1 + vels[pl]**2) - 1), 1e-4, 1.0-1e-4))
omegas[pl] = pm.Deterministic("omega_"+pl,np.pi-0.5*np.pi*(logvels[pl]/pm.math.abs(logvels[pl])) )

######################################
# Initialising RVs
Expand Down

0 comments on commit 6c7722d

Please sign in to comment.