diff --git a/python/magic/bLayers.py b/python/magic/bLayers.py index c05e0ba6..65a68dc3 100644 --- a/python/magic/bLayers.py +++ b/python/magic/bLayers.py @@ -478,7 +478,7 @@ def __init__(self, iplot=False, quiet=False): y = RolC[self.radius >= self.ro-self.bcTopSlope] x = self.radius[self.radius >= self.ro-self.bcTopSlope] try: - self.rolTop = simps(3.*y*x**2, x)/(self.ro**3-(self.ro-self.bcTopSlope)**3) + self.rolTop = simps(3.*y*x**2, x=x)/(self.ro**3-(self.ro-self.bcTopSlope)**3) except IndexError: self.rolTop = 0. @@ -500,7 +500,7 @@ def __init__(self, iplot=False, quiet=False): y = RolC[self.radius <= self.ri+self.bcBotSlope] x = self.radius[self.radius <= self.ri+self.bcBotSlope] - self.rolBot = simps(3.*y*x**2, x)/((self.ri+self.bcBotSlope)**3-self.ri**3) + self.rolBot = simps(3.*y*x**2, x=x)/((self.ri+self.bcBotSlope)**3-self.ri**3) print('reynols bc, reynolds bulk', self.rebl, self.rebulk) print('reh bc, reh bulk', self.rehbl, self.rehbulk) print('rolbc, rolbulk, roltop, rolbot', self.rolbl, self.rolbulk, diff --git a/python/magic/butterfly.py b/python/magic/butterfly.py index 5931c452..972754bd 100644 --- a/python/magic/butterfly.py +++ b/python/magic/butterfly.py @@ -284,7 +284,7 @@ def fourier2D(self, renorm=False): self.omega = w[1:nt//2+1] self.amp1D = np.zeros_like(self.omega) for i in range(len(self.omega)): - self.amp1D[i] = simps(self.amp[:, i], self.theta) + self.amp1D[i] = simps(self.amp[:, i], x=self.theta) fig = plt.figure() ax = fig.add_subplot(211) diff --git a/python/magic/libmagic.py b/python/magic/libmagic.py index ac8f4222..e428c532 100644 --- a/python/magic/libmagic.py +++ b/python/magic/libmagic.py @@ -1201,12 +1201,12 @@ def horizontal_mean(field, colat, std=False): """ field_m = field.mean(axis=0) # Azimuthal average - field_mean = 0.5 * simps(field_m.T*np.sin(colat), colat, axis=-1) + field_mean = 0.5 * simps(field_m.T*np.sin(colat), x=colat, axis=-1) if std: dat = (field-field_mean)**2 dat_m = dat.mean(axis=0) - dat_mean = 0.5 * simps(dat_m.T*np.sin(colat), colat, axis=-1) + dat_mean = 0.5 * simps(dat_m.T*np.sin(colat), x=colat, axis=-1) field_std = np.sqrt(dat_mean) return field_mean, field_std else: diff --git a/python/magic/thHeat.py b/python/magic/thHeat.py index 1f84e35a..7eb6466f 100644 --- a/python/magic/thHeat.py +++ b/python/magic/thHeat.py @@ -149,8 +149,8 @@ def __init__(self, iplot=False, angle=10, pickleName='thHeat.pickle', for i in range(self.ntheta): th2D[i, :] = self.colat[i] - self.temprmmean = 0.5*simps(self.tempmean*np.sin(th2D), th2D, axis=0) - self.temprmstd = 0.5*simps(self.tempstd*np.sin(th2D), th2D, axis=0) + self.temprmmean = 0.5*simps(self.tempmean*np.sin(th2D), x=th2D, axis=0) + self.temprmstd = 0.5*simps(self.tempstd*np.sin(th2D), x=th2D, axis=0) sinTh = np.sin(self.colat) # Conducting temperature profile (Boussinesq only!) @@ -177,18 +177,18 @@ def __init__(self, iplot=False, angle=10, pickleName='thHeat.pickle', # Close to the equator mask2D = (th2D>=np.pi/2.-angle/2.)*(th2D<=np.pi/2+angle/2.) mask = (self.colat>=np.pi/2.-angle/2.)*(self.colat<=np.pi/2+angle/2.) - fac = 1./simps(sinTh[mask], self.colat[mask]) - self.nussBotEq = fac*simps(self.nussbotmean[mask]*sinTh[mask], self.colat[mask]) - self.nussTopEq = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + fac = 1./simps(sinTh[mask], x=self.colat[mask]) + self.nussBotEq = fac*simps(self.nussbotmean[mask]*sinTh[mask], x=self.colat[mask]) + self.nussTopEq = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) sinC = sinTh.copy() sinC[~mask] = 0. - fac = 1./simps(sinC, self.colat) + fac = 1./simps(sinC, x=self.colat) tempC = self.tempmean.copy() tempC[~mask2D] = 0. - self.tempEqmean = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + self.tempEqmean = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) tempC = self.tempstd.copy() tempC[~mask2D] = 0. - self.tempEqstd = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + self.tempEqstd = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) dtempEq = rderavg(self.tempEqmean, self.radius) self.betaEq = dtempEq[len(dtempEq)//2] @@ -196,27 +196,27 @@ def __init__(self, iplot=False, angle=10, pickleName='thHeat.pickle', # 45\deg inclination mask2D = (th2D>=np.pi/4.-angle/2.)*(th2D<=np.pi/4+angle/2.) mask = (self.colat>=np.pi/4.-angle/2.)*(self.colat<=np.pi/4+angle/2.) - fac = 1./simps(np.sin(self.colat[mask]), self.colat[mask]) - nussBot45NH = fac*simps(self.nussbotmean[mask]*sinTh[mask], self.colat[mask]) - nussTop45NH = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + fac = 1./simps(np.sin(self.colat[mask]), x=self.colat[mask]) + nussBot45NH = fac*simps(self.nussbotmean[mask]*sinTh[mask], x=self.colat[mask]) + nussTop45NH = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) sinC = sinTh.copy() sinC[~mask] = 0. - fac = 1./simps(sinC, self.colat) + fac = 1./simps(sinC, x=self.colat) tempC = self.tempmean.copy() tempC[~mask2D] = 0. - temp45NH = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + temp45NH = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) mask2D = (th2D>=3.*np.pi/4.-angle/2.)*(th2D<=3.*np.pi/4+angle/2.) mask = (self.colat>=3.*np.pi/4.-angle/2.)*(self.colat<=3.*np.pi/4+angle/2.) - fac = 1./simps(np.sin(self.colat[mask]), self.colat[mask]) - nussBot45SH = fac*simps(self.nussbotmean[mask]*sinTh[mask], self.colat[mask]) - nussTop45SH = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + fac = 1./simps(np.sin(self.colat[mask]), x=self.colat[mask]) + nussBot45SH = fac*simps(self.nussbotmean[mask]*sinTh[mask], x=self.colat[mask]) + nussTop45SH = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) sinC = sinTh.copy() sinC[~mask] = 0. - fac = 1./simps(sinC, self.colat) + fac = 1./simps(sinC, x=self.colat) tempC = self.tempmean.copy() tempC[~mask2D] = 0. - temp45SH = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + temp45SH = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) self.nussTop45 = 0.5*(nussTop45NH+nussTop45SH) self.nussBot45 = 0.5*(nussBot45NH+nussBot45SH) @@ -228,33 +228,33 @@ def __init__(self, iplot=False, angle=10, pickleName='thHeat.pickle', # Polar regions mask2D = (th2D<=angle/2.) mask = (self.colat<=angle/2.) - fac = 1./simps(np.sin(self.colat[mask]), self.colat[mask]) - nussBotPoNH = fac*simps(self.nussbotmean[mask]*sinTh[mask], self.colat[mask]) - nussTopPoNH = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + fac = 1./simps(np.sin(self.colat[mask]), x=self.colat[mask]) + nussBotPoNH = fac*simps(self.nussbotmean[mask]*sinTh[mask], x=self.colat[mask]) + nussTopPoNH = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) sinC = sinTh.copy() sinC[~mask] = 0. - fac = 1./simps(sinC, self.colat) + fac = 1./simps(sinC, x=self.colat) tempC = self.tempmean.copy() tempC[~mask2D] = 0. - tempPolNHmean = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + tempPolNHmean = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) tempC = self.tempstd.copy() tempC[~mask2D] = 0. - tempPolNHstd = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + tempPolNHstd = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) mask2D = (th2D>=np.pi-angle/2.) mask = (self.colat>=np.pi-angle/2.) fac = 1./simps(np.sin(self.colat[mask]), self.colat[mask]) - nussBotPoSH = fac*simps(self.nussbotmean[mask]*sinTh[mask], self.colat[mask]) - nussTopPoSH = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + nussBotPoSH = fac*simps(self.nussbotmean[mask]*sinTh[mask], x=self.colat[mask]) + nussTopPoSH = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) sinC = sinTh.copy() sinC[~mask] = 0. - fac = 1./simps(sinC, self.colat) + fac = 1./simps(sinC, x=self.colat) tempC = self.tempmean.copy() tempC[~mask2D] = 0. - tempPolSHmean = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + tempPolSHmean = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) tempC = self.tempstd.copy() tempC[~mask2D] = 0. - tempPolSHstd = fac*simps(tempC*np.sin(th2D), th2D, axis=0) + tempPolSHstd = fac*simps(tempC*np.sin(th2D), x=th2D, axis=0) self.nussBotPo = 0.5*(nussBotPoNH+nussBotPoSH) self.nussTopPo = 0.5*(nussTopPoNH+nussTopPoSH) @@ -268,20 +268,20 @@ def __init__(self, iplot=False, angle=10, pickleName='thHeat.pickle', angleTC = np.arcsin(self.ri/self.ro) mask2D = (th2D<=angleTC) mask = (self.colat<=angleTC) - fac = 1./simps(np.sin(self.colat[mask]), self.colat[mask]) - nussITC_NH = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + fac = 1./simps(np.sin(self.colat[mask]), x=self.colat[mask]) + nussITC_NH = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) mask2D = (th2D>=np.pi-angleTC) mask = (self.colat>=np.pi-angleTC) fac = 1./simps(np.sin(self.colat[mask]), self.colat[mask]) - nussITC_SH = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + nussITC_SH = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) self.nussITC = 0.5*(nussITC_NH+nussITC_SH) mask2D = (th2D>=angleTC)*(th2D<=np.pi-angleTC) mask = (self.colat>=angleTC)*(self.colat<=np.pi-angleTC) fac = 1./simps(sinTh[mask], self.colat[mask]) - self.nussOTC = fac*simps(self.nusstopmean[mask]*sinTh[mask], self.colat[mask]) + self.nussOTC = fac*simps(self.nusstopmean[mask]*sinTh[mask], x=self.colat[mask]) if iplot: self.plot()