[yt-svn] commit/yt-3.0: xarthisius: Remove duplicated code, fix Particle{Theta, Phi}Velocity field
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Jul 19 06:54:12 PDT 2013
1 new commit in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/commits/250ee66bf017/
Changeset: 250ee66bf017
Branch: yt-3.0
User: xarthisius
Date: 2013-07-19 14:31:37
Summary: Remove duplicated code, fix Particle{Theta,Phi}Velocity field
Affected #: 1 file
diff -r 42a76b0f696070ca0179a633127f2a3c646925d6 -r 250ee66bf0174aa0a1b807640b0e0a2109383c8b yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -376,12 +376,6 @@
add_field("DynamicalTime", function=_DynamicalTime,
units=r"\rm{s}")
-def JeansMassMsun(field,data):
- return (MJ_constant *
- ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
- (data["Density"]**(-0.5)))
-add_field("JeansMassMsun",function=JeansMassMsun,units=r"\rm{Msun}")
-
def _CellMass(field, data):
return data["Density"] * data["CellVolume"]
def _convertCellMassMsun(data):
@@ -619,7 +613,7 @@
def _convertSpecificAngularMomentum(data):
return data.convert("cm")
def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
+ return km_per_cm*data.convert("mpc")
def _SpecificAngularMomentumX(field, data):
xv, yv, zv = obtain_velocities(data)
@@ -678,8 +672,6 @@
# function=_ParticleSpecificAngularMomentum, particle_type=True,
# convert_function=_convertSpecificAngularMomentum, vector_field=True,
# units=r"\rm{cm}^2/\rm{s}", validators=[ValidateParameter('center')])
-def _convertSpecificAngularMomentumKMSMPC(data):
- return km_per_cm*data.convert("mpc")
#add_field("ParticleSpecificAngularMomentumKMSMPC",
# function=_ParticleSpecificAngularMomentum, particle_type=True,
# convert_function=_convertSpecificAngularMomentumKMSMPC, vector_field=True,
@@ -909,7 +901,7 @@
pos = pos - np.reshape(center, (3, 1))
vel = vel - np.reshape(bv, (3, 1))
spht = get_sph_theta_component(vel, theta, phi, normal)
- return sphrt
+ return spht
add_field("ParticleThetaVelocity", function=_ParticleThetaVelocity,
particle_type=True, units=r"\rm{cm}/\rm{s}",
@@ -928,8 +920,8 @@
phi = get_sph_phi(pos.copy(), center)
pos = pos - np.reshape(center, (3, 1))
vel = vel - np.reshape(bv, (3, 1))
- sphp = get_sph_phi_component(vel, theta, phi, normal)
- return sphrp
+ sphp = get_sph_phi_component(vel, phi, normal)
+ return sphp
add_field("ParticlePhiVelocity", function=_ParticleThetaVelocity,
particle_type=True, units=r"\rm{cm}/\rm{s}",
Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list