[yt-svn] commit/yt-doc: 3 new changesets
Bitbucket
commits-noreply at bitbucket.org
Thu Feb 9 08:46:16 PST 2012
3 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/changeset/5da346c007de/
changeset: 5da346c007de
user: sskory
date: 2012-02-03 23:29:48
summary: Preventing un-overridden functions from appearing twice on the
field_list page.
Also updated the field_list.rst file, accordingly.
affected #: 2 files
diff -r e19c789bf613f65d85baa748bb125009b3bfba07 -r 5da346c007de7ff48fdb5b561632e82d9d353c77 helper_scripts/show_fields.py
--- a/helper_scripts/show_fields.py
+++ b/helper_scripts/show_fields.py
@@ -1,6 +1,7 @@
import inspect
from yt.mods import *
+
def islambda(f):
return inspect.isfunction(f) and \
f.__name__ == (lambda: True).__name__
@@ -14,7 +15,7 @@
This is a list of all fields available in ``yt``. It has been organized by the
type of code that each field is supported by. "Universal" fields are available
everywhere, "Enzo" fields in Enzo datasets, "Orion" fields in Orion datasets,
-and so on.
+and so on.
.. note:: Universal fields will be overridden by a code-specific field.
@@ -28,17 +29,23 @@
print header
+seen = set([])
+
+
def print_all_fields(fl):
for fn in sorted(fl):
df = fl[fn]
f = df._function
+ if f in seen:
+ continue
+ seen.add(f)
cv = df._convert_function
print "%s" % (df.name)
print "+" * len(df.name)
print
- if len(df._units) > 0:
+ if len(df._units) > 0:
print " * Units: :math:`%s`" % (df._units)
- if len(df._projected_units) > 0:
+ if len(df._projected_units) > 0:
print " * Projected Units: :math:`%s`" % (df._projected_units)
print " * Particle Type: %s" % (df.particle_type)
print
@@ -91,4 +98,4 @@
print "Nyx-Specific Field List"
print "--------------------------"
print
-print_all_fields(NyxFieldInfo)
\ No newline at end of file
+print_all_fields(NyxFieldInfo)
diff -r e19c789bf613f65d85baa748bb125009b3bfba07 -r 5da346c007de7ff48fdb5b561632e82d9d353c77 source/reference/field_list.rst
--- a/source/reference/field_list.rst
+++ b/source/reference/field_list.rst
@@ -56,24 +56,6 @@
No source available.
-AngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
AngularMomentumX
++++++++++++++++
@@ -218,28 +200,6 @@
return 1.0/data.convert("Density")
-CellMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
CellVolume
++++++++++
@@ -268,58 +228,6 @@
return data.convert("cm")**3.0
-CellVolumeCode
-++++++++++++++
-
- * Units: :math:`\rm{BoxVolume}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellVolumeMpc
-+++++++++++++
-
- * Units: :math:`\rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeMpc(data):
- return data.convert("mpc")**3.0
-
-
CellsPerBin
+++++++++++
@@ -656,40 +564,6 @@
return data.convert("cm")
-HeightAU
-++++++++
-
- * Units: :math:`AU`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeightAU(data):
- return data.convert("au")
-
-
JeansMassMsun
+++++++++++++
@@ -787,23 +661,6 @@
No source available.
-Ones
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
OnesOverDx
++++++++++
@@ -822,28 +679,6 @@
No source available.
-Overdensity
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _Convert_Overdensity(data):
- return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
- (1+data.pf.current_redshift)**3)
-
-
ParticleAngularMomentum
+++++++++++++++++++++++
@@ -963,175 +798,6 @@
return data.convert("cm")
-ParticleRadiusAU
-++++++++++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-ParticleRadiusCode
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadiusMpc
-+++++++++++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-ParticleRadiuskpc
-+++++++++++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuskpch
-++++++++++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuspc
-++++++++++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
ParticleSpecificAngularMomentum
+++++++++++++++++++++++++++++++
@@ -1171,45 +837,6 @@
return data.convert("cm")
-ParticleSpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
ParticleSpecificAngularMomentumX
++++++++++++++++++++++++++++++++
@@ -1408,60 +1035,6 @@
No source available.
-RadialVelocityKMS
-+++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-RadialVelocityKMSABS
-++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
Radius
++++++
@@ -1491,175 +1064,6 @@
return data.convert("cm")
-RadiusAU
-++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-RadiusCode
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-RadiusMpc
-+++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-Radiuskpc
-+++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuskpch
-++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuspc
-++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
SZKinetic
+++++++++
@@ -1757,34 +1161,6 @@
return data.convert("cm")
-SpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
SpecificAngularMomentumX
++++++++++++++++++++++++
@@ -1933,28 +1309,6 @@
No source available.
-TotalMassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
VelocityMagnitude
+++++++++++++++++
@@ -2037,45 +1391,6 @@
return data.convert("cm")**-2.0
-WeakLensingConvergence
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertConvergence(data):
- if not data.pf.parameters.has_key('cosmology_calculator'):
- data.pf.parameters['cosmology_calculator'] = Cosmology(
- HubbleConstantNow=(100.*data.pf.hubble_constant),
- OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
- # observer to lens
- DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.current_redshift)
- # observer to source
- DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
- # lens to source
- DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
- return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
- (data.pf.hubble_constant / speed_of_light_cgs)**2 *
- (1 + data.pf.current_redshift)))
-
-
XRayEmissivity
++++++++++++++
@@ -2183,23 +1498,6 @@
return data.convert("Density")
-tempContours
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
x
+
@@ -2263,165 +1561,6 @@
Enzo-Specific Field List
------------------------
-AbsDivV
-+++++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AbsDivV(field, data):
- return na.abs(data['DivV'])
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentum
-+++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumX
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumX(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumY
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumY(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumZ
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumZ(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AveragedDensity
-+++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AveragedDensity(field, data):
- nx, ny, nz = data["Density"].shape
- new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- weight_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- i_i, j_i, k_i = na.mgrid[0:3,0:3,0:3]
- for i,j,k in zip(i_i.ravel(),j_i.ravel(),k_i.ravel()):
- sl = [slice(i,nx-(2-i)),slice(j,ny-(2-j)),slice(k,nz-(2-k))]
- new_field += data["Density"][sl] * data["CellMass"][sl]
- weight_field += data["CellMass"][sl]
- # Now some fancy footwork
- new_field2 = na.zeros((nx,ny,nz))
- new_field2[1:-1,1:-1,1:-1] = new_field/weight_field
- return new_field2
-
-
-**Convert Function Source**
-
-No source available.
-
-Baryon_Overdensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Baryon_Overdensity(field, data):
- if data.pf.has_key('omega_baryon_now'):
- omega_baryon_now = data.pf['omega_baryon_now']
- else:
- omega_baryon_now = 0.0441
- return data['Density'] / (omega_baryon_now * rho_crit_now *
- (data.pf['CosmologyHubbleConstantNow']**2) *
- ((1+data.pf['CosmologyCurrentRedshift'])**3))
-
-
-**Convert Function Source**
-
-No source available.
-
Bmag
++++
@@ -2442,183 +1581,6 @@
No source available.
-CellMass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMassCode
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMassCode(field, data):
- return data["Density"] * data["CellVolumeCode"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassCode(data):
- return 1.0/data.convert("Density")
-
-
-CellMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-CellVolume
-++++++++++
-
- * Units: :math:`\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeCGS(data):
- return data.convert("cm")**3.0
-
-
-CellVolumeCode
-++++++++++++++
-
- * Units: :math:`\rm{BoxVolume}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellVolumeMpc
-+++++++++++++
-
- * Units: :math:`\rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeMpc(data):
- return data.convert("mpc")**3.0
-
-
-CellsPerBin
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-ComovingDensity
-+++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ComovingDensity(field, data):
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data["Density"]/ef
-
-
-**Convert Function Source**
-
-No source available.
-
Comoving_DII_Density
++++++++++++++++++++
@@ -2638,352 +1600,6 @@
No source available.
-Comoving_DI_Density
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_Electron_Density
-+++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_H2II_Density
-+++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_H2I_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HDI_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HII_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HI_Density
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HM_Density
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HeIII_Density
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HeII_Density
-+++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HeI_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_Metal_Density
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_PreShock_Density
-+++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Contours
-++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-CourantTimeStep
-+++++++++++++++
-
- * Units: :math:`$\rm{s}$`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CourantTimeStep(field, data):
- t1 = data['dx'] / (
- data["SoundSpeed"] + \
- abs(data["x-velocity"]))
- t2 = data['dy'] / (
- data["SoundSpeed"] + \
- abs(data["y-velocity"]))
- t3 = data['dz'] / (
- data["SoundSpeed"] + \
- abs(data["z-velocity"]))
- return na.minimum(na.minimum(t1,t2),t3)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCourantTimeStep(data):
- # SoundSpeed and z-velocity are in cm/s, dx is in code
- return data.convert("cm")
-
-
-CuttingPlaneVelocityX
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityX(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(x_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
-CuttingPlaneVelocityY
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityY(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(y_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
DII_Fraction
++++++++++++
@@ -3021,29 +1637,6 @@
No source available.
-DII_MassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
DII_NumberDensity
+++++++++++++++++
@@ -3067,89 +1660,6 @@
return 1.0/mh
-DI_Fraction
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-DI_Mass
-+++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-DI_MassMsun
-+++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-DI_NumberDensity
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
Dark_Matter_Mass
++++++++++++++++
@@ -3168,244 +1678,6 @@
No source available.
-Dark_Matter_MassMsun
-++++++++++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Dark_Matter_Mass(field, data):
- return data['Dark_Matter_Density'] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-DensityPerturbation
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-No source available.
-
-DiskAngle
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DiskAngle(field, data):
- # We make both r_vec and h_vec into unit vectors
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- r_vec = r_vec/na.sqrt((r_vec**2.0).sum(axis=0))
- h_vec = na.array(data.get_field_parameter("height_vector"))
- dp = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.arccos(dp)
-
-
-**Convert Function Source**
-
-No source available.
-
-DivV
-++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DivV(field, data):
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- ds = div_fac * data['dx'].flat[0]
- f = data["x-velocity"][sl_right,1:-1,1:-1]/ds
- f -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
- if data.pf.dimensionality > 1:
- ds = div_fac * data['dy'].flat[0]
- f += data["y-velocity"][1:-1,sl_right,1:-1]/ds
- f -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
- if data.pf.dimensionality > 2:
- ds = div_fac * data['dz'].flat[0]
- f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
- f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
- new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
- new_field[1:-1,1:-1,1:-1] = f
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDivV(data):
- return data.convert("cm")**-1.0
-
-
-DynamicalTime
-+++++++++++++
-
- * Units: :math:`\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DynamicalTime(field, data):
- """
- The formulation for the dynamical time is:
- M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
- Note that we return in our natural units already
- """
- return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
-
-
-**Convert Function Source**
-
-No source available.
-
-Electron_Fraction
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Electron_Mass
-+++++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Electron_MassMsun
-+++++++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-Electron_NumberDensity
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-Entropy
-+++++++
-
- * Units: :math:`\rm{ergs}\ \rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Entropy(field, data):
- return kboltz * data["Temperature"] / \
- (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-
-
-**Convert Function Source**
-
-No source available.
-
Gas_Energy
++++++++++
@@ -3428,855 +1700,6 @@
return data.convert("x-velocity")**2.0
-GridIndices
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridIndices(field, data):
- return na.ones(data["Ones"].shape)*(data.id-data._id_offset)
-
-
-**Convert Function Source**
-
-No source available.
-
-GridLevel
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridLevel(field, data):
- return na.ones(data.ActiveDimensions)*(data.Level)
-
-
-**Convert Function Source**
-
-No source available.
-
-H2II_Fraction
-+++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2II_Mass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2II_MassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-H2II_NumberDensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-H2I_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2I_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2I_MassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-H2I_NumberDensity
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HDI_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HDI_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HDI_MassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HDI_NumberDensity
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HII_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HII_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HII_MassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HII_NumberDensity
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HI_Fraction
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HI_Mass
-+++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HI_MassMsun
-+++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HI_NumberDensity
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HM_Fraction
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HM_Mass
-+++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HM_MassMsun
-+++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HM_NumberDensity
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HeIII_Fraction
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeIII_Mass
-++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeIII_MassMsun
-++++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HeIII_NumberDensity
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HeII_Fraction
-+++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeII_Mass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeII_MassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HeII_NumberDensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-HeI_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeI_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeI_MassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-HeI_NumberDensity
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-Height
-++++++
-
- * Units: :math:`cm`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeight(data):
- return data.convert("cm")
-
-
-HeightAU
-++++++++
-
- * Units: :math:`AU`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeightAU(data):
- return data.convert("au")
-
-
IsStarParticle
++++++++++++++
@@ -4295,29 +1718,6 @@
No source available.
-JeansMassMsun
-+++++++++++++
-
- * Units: :math:`\rm{M_{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _JeansMassMsun(field,data):
- MJ_constant = (((5*kboltz)/(G*mh))**(1.5)) * \
- (3/(4*3.1415926535897931))**(0.5) / 1.989e33
-
- return (MJ_constant *
- ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
- (data["Density"]**(-0.5)))
-
-
-**Convert Function Source**
-
-No source available.
-
KineticEnergy
+++++++++++++
@@ -4338,140 +1738,6 @@
No source available.
-MachNumber
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MachNumber(field, data):
- """M{|v|/t_sound}"""
- return data["VelocityMagnitude"] / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-MagneticEnergy
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MagneticEnergy(field,data):
- """This assumes that your front end has provided Bx, By, Bz in
- units of Gauss. If you use MKS, make sure to write your own
- MagneticEnergy field to deal with non-unitary \mu_0.
- """
- return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/2.
-
-
-**Convert Function Source**
-
-No source available.
-
-Matter_Density
-++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-No source available.
-
-MeanMolecularWeight
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MeanMolecularWeight(field,data):
- return (data["Density"] / (mh *data["NumberDensity"]))
-
-
-**Convert Function Source**
-
-No source available.
-
-Metal_Fraction
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Metal_Mass
-++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Metal_MassMsun
-++++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
Metallicity
+++++++++++
@@ -4564,63 +1830,6 @@
return 1.0/mh
-Ones
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-OnesOverDx
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _OnesOverDx(field, data):
- return na.ones(data["Ones"].shape,
- dtype=data["Density"].dtype)/data['dx']
-
-
-**Convert Function Source**
-
-No source available.
-
-Overdensity
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _Convert_Overdensity(data):
- return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
- (1+data.pf.current_redshift)**3)
-
-
ParticleAge
+++++++++++
@@ -4643,96 +1852,6 @@
return data.convert("years")
-ParticleAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentum(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumMSUNKMSMPC(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentumKMSMPC"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumX(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumY(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumZ(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
ParticleMass
++++++++++++
@@ -4757,1013 +1876,6 @@
return data.convert("Density")*(data.convert("cm")**3.0)
-ParticleMassMsun
-++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleMass(field, data):
- particles = data["particle_mass"].astype('float64') * \
- just_one(data["CellVolumeCode"].ravel())
- # Note that we mandate grid-type here, so this is okay
- return particles
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertParticleMassMsun(data):
- return data.convert("Density")*((data.convert("cm")**3.0)/1.989e33)
-
-
-ParticleRadius
-++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-ParticleRadiusAU
-++++++++++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-ParticleRadiusCode
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadiusMpc
-+++++++++++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-ParticleRadiuskpc
-+++++++++++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuskpch
-++++++++++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuspc
-++++++++++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-ParticleSpecificAngularMomentum
-+++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-ParticleSpecificAngularMomentumX
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumX(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- y = data["particle_position_y"] - center[1]
- z = data["particle_position_z"] - center[2]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- return yv*z - zv*y
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumY
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumY(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- z = data["particle_position_z"] - center[2]
- xv = data["particle_velocity_x"] - bv[0]
- zv = data["particle_velocity_z"] - bv[2]
- return -(xv*z - zv*x)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumZ
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumZ(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- y = data["particle_position_y"] - center[1]
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- return xv*y - yv*x
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleVelocityMagnitude
-+++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleVelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["particle_velocity_x"]-bulk_velocity[0])**2.0 + \
- (data["particle_velocity_y"]-bulk_velocity[1])**2.0 + \
- (data["particle_velocity_z"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-PreShock_Fraction
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-PreShock_Mass
-+++++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-PreShock_MassMsun
-+++++++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-Pressure
-++++++++
-
- * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Pressure(field, data):
- """M{(Gamma-1.0)*rho*E}"""
- return (data.pf["Gamma"] - 1.0) * \
- data["Density"] * data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialMachNumber
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialMachNumber(field, data):
- """M{|v|/t_sound}"""
- return na.abs(data["RadialVelocity"]) / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocity
-++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityABS
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityKMS
-+++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-RadialVelocityKMSABS
-++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-Radius
-++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-RadiusAU
-++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-RadiusCode
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-RadiusMpc
-+++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-Radiuskpc
-+++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuskpch
-++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuspc
-++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-SZKinetic
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZKinetic(field, data):
- vel_axis = data.get_field_parameter('axis')
- if vel_axis > 2:
- raise NeedsParameter(['axis'])
- vel = data["%s-velocity" % ({0:'x',1:'y',2:'z'}[vel_axis])]
- return (vel*data["Density"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZKinetic(data):
- return 0.88*((sigma_thompson/mh)/clight)
-
-
-SZY
-+++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZY(field, data):
- return (data["Density"]*data["Temperature"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZY(data):
- conv = (0.88/mh) * (kboltz)/(me * clight*clight) * sigma_thompson
- return conv
-
-
-SoundSpeed
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SoundSpeed(field, data):
- if data.pf["EOSType"] == 1:
- return na.ones(data["Density"].shape, dtype='float64') * \
- data.pf["EOSSoundSpeed"]
- return ( data.pf["Gamma"]*data["Pressure"] / \
- data["Density"] )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-SpecificAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-SpecificAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumX(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return yv*rv[2,:] - zv*rv[1,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumY(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return -(xv*rv[2,:] - zv*rv[0,:])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumZ(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return xv*rv[1,:] - yv*rv[0,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
StarAgeYears
++++++++++++
@@ -5831,28 +1943,6 @@
return data.pf.time_units['years']
-StarMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarMass(field,data):
- return data["star_density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
StarMetallicity
+++++++++++++++
@@ -5875,42 +1965,6 @@
return 49.0196 # 1 / 0.0204
-TangentialOverVelocityMagnitude
-+++++++++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialOverVelocityMagnitude(field, data):
- return na.abs(data["TangentialVelocity"])/na.abs(data["VelocityMagnitude"])
-
-
-**Convert Function Source**
-
-No source available.
-
-TangentialVelocity
-++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialVelocity(field, data):
- return na.sqrt(data["VelocityMagnitude"]**2.0
- - data["RadialVelocity"]**2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
ThermalEnergy
+++++++++++++
@@ -5938,46 +1992,6 @@
No source available.
-TotalMass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalMassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
Total_Energy
++++++++++++
@@ -6000,149 +2014,6 @@
return data.convert("x-velocity")**2.0
-VelocityMagnitude
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["x-velocity"]-bulk_velocity[0])**2.0 + \
- (data["y-velocity"]-bulk_velocity[1])**2.0 + \
- (data["z-velocity"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-VorticitySquared
-++++++++++++++++
-
- * Units: :math:`\rm{s}^{-2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VorticitySquared(field, data):
- mylog.debug("Generating vorticity on %s", data)
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- new_field = na.zeros(data["x-velocity"].shape)
- dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
- data["z-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
- data["y-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvzdy - dvydz)**2.0
- del dvzdy, dvydz
- dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
- data["x-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
- data["z-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvxdz - dvzdx)**2.0
- del dvxdz, dvzdx
- dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
- data["y-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
- data["x-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvydx - dvxdy)**2.0
- del dvydx, dvxdy
- new_field = na.abs(new_field)
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertVorticitySquared(data):
- return data.convert("cm")**-2.0
-
-
-WeakLensingConvergence
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertConvergence(data):
- if not data.pf.parameters.has_key('cosmology_calculator'):
- data.pf.parameters['cosmology_calculator'] = Cosmology(
- HubbleConstantNow=(100.*data.pf.hubble_constant),
- OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
- # observer to lens
- DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.current_redshift)
- # observer to source
- DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
- # lens to source
- DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
- return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
- (data.pf.hubble_constant / speed_of_light_cgs)**2 *
- (1 + data.pf.current_redshift)))
-
-
-XRayEmissivity
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _XRayEmissivity(field, data):
- return ((data["Density"].astype('float64')**2.0) \
- *data["Temperature"]**0.5)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertXRayEmissivity(data):
- return 2.168e60
-
-
cic_particle_velocity_x
+++++++++++++++++++++++
@@ -6190,100 +2061,6 @@
No source available.
-cic_particle_velocity_y
-+++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _cic_particle_field(field, data):
- """
- Create a grid field for particle quantities weighted by particle mass,
- using cloud-in-cell deposit.
- """
- particle_field = field.name[4:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- particle_field_data = data[particle_field] * data['particle_mass']
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(data.NumberOfParticles),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-cic_particle_velocity_z
-+++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _cic_particle_field(field, data):
- """
- Create a grid field for particle quantities weighted by particle mass,
- using cloud-in-cell deposit.
- """
- particle_field = field.name[4:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- particle_field_data = data[particle_field] * data['particle_mass']
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(data.NumberOfParticles),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
dm_density
++++++++++
@@ -6321,91 +2098,6 @@
return data.convert("Density")
-dx
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dx(field, data):
- return data.dds[0]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-dy
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dy(field, data):
- return data.dds[1]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-dz
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dz(field, data):
- return data.dds[2]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[2]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_density
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
particle_mass
+++++++++++++
@@ -6512,617 +2204,9 @@
return data.convert("Density")
-star_dynamical_time
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _star_field(field, data):
- """
- Create a grid field for star quantities, weighted by star mass.
- """
- particle_field = field.name[5:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- filter = data['creation_time'] > 0.0
- if not filter.any(): return top
- particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(na.where(filter)[0].size),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-star_metallicity_fraction
-+++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _star_field(field, data):
- """
- Create a grid field for star quantities, weighted by star mass.
- """
- particle_field = field.name[5:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- filter = data['creation_time'] > 0.0
- if not filter.any(): return top
- particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(na.where(filter)[0].size),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-tempContours
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-x
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordX(field, data):
- dim = data.ActiveDimensions[0]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[0])[:,None,None]
- +0.5) * data['dx'] + data.LeftEdge[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-y
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordY(field, data):
- dim = data.ActiveDimensions[1]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[1])[None,:,None]
- +0.5) * data['dy'] + data.LeftEdge[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-z
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordZ(field, data):
- dim = data.ActiveDimensions[2]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[2])[None,None,:]
- +0.5) * data['dz'] + data.LeftEdge[2]
-
-
-**Convert Function Source**
-
-No source available.
-
Orion-Specific Field List
-------------------------
-AbsDivV
-+++++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AbsDivV(field, data):
- return na.abs(data['DivV'])
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentum
-+++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumX
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumX(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumY
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumY(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumZ
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumZ(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AveragedDensity
-+++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AveragedDensity(field, data):
- nx, ny, nz = data["Density"].shape
- new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- weight_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- i_i, j_i, k_i = na.mgrid[0:3,0:3,0:3]
- for i,j,k in zip(i_i.ravel(),j_i.ravel(),k_i.ravel()):
- sl = [slice(i,nx-(2-i)),slice(j,ny-(2-j)),slice(k,nz-(2-k))]
- new_field += data["Density"][sl] * data["CellMass"][sl]
- weight_field += data["CellMass"][sl]
- # Now some fancy footwork
- new_field2 = na.zeros((nx,ny,nz))
- new_field2[1:-1,1:-1,1:-1] = new_field/weight_field
- return new_field2
-
-
-**Convert Function Source**
-
-No source available.
-
-Baryon_Overdensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Baryon_Overdensity(field, data):
- if data.pf.has_key('omega_baryon_now'):
- omega_baryon_now = data.pf['omega_baryon_now']
- else:
- omega_baryon_now = 0.0441
- return data['Density'] / (omega_baryon_now * rho_crit_now *
- (data.pf['CosmologyHubbleConstantNow']**2) *
- ((1+data.pf['CosmologyCurrentRedshift'])**3))
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMassCode
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMassCode(field, data):
- return data["Density"] * data["CellVolumeCode"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassCode(data):
- return 1.0/data.convert("Density")
-
-
-CellMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-CellVolume
-++++++++++
-
- * Units: :math:`\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeCGS(data):
- return data.convert("cm")**3.0
-
-
-CellVolumeCode
-++++++++++++++
-
- * Units: :math:`\rm{BoxVolume}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellVolumeMpc
-+++++++++++++
-
- * Units: :math:`\rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeMpc(data):
- return data.convert("mpc")**3.0
-
-
-CellsPerBin
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-ComovingDensity
-+++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ComovingDensity(field, data):
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data["Density"]/ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Contours
-++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-CourantTimeStep
-+++++++++++++++
-
- * Units: :math:`$\rm{s}$`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CourantTimeStep(field, data):
- t1 = data['dx'] / (
- data["SoundSpeed"] + \
- abs(data["x-velocity"]))
- t2 = data['dy'] / (
- data["SoundSpeed"] + \
- abs(data["y-velocity"]))
- t3 = data['dz'] / (
- data["SoundSpeed"] + \
- abs(data["z-velocity"]))
- return na.minimum(na.minimum(t1,t2),t3)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCourantTimeStep(data):
- # SoundSpeed and z-velocity are in cm/s, dx is in code
- return data.convert("cm")
-
-
-CuttingPlaneVelocityX
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityX(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(x_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
-CuttingPlaneVelocityY
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityY(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(y_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
Density
+++++++
@@ -7132,875 +2216,6 @@
No source available.
-DensityPerturbation
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-No source available.
-
-DiskAngle
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DiskAngle(field, data):
- # We make both r_vec and h_vec into unit vectors
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- r_vec = r_vec/na.sqrt((r_vec**2.0).sum(axis=0))
- h_vec = na.array(data.get_field_parameter("height_vector"))
- dp = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.arccos(dp)
-
-
-**Convert Function Source**
-
-No source available.
-
-DivV
-++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DivV(field, data):
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- ds = div_fac * data['dx'].flat[0]
- f = data["x-velocity"][sl_right,1:-1,1:-1]/ds
- f -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
- if data.pf.dimensionality > 1:
- ds = div_fac * data['dy'].flat[0]
- f += data["y-velocity"][1:-1,sl_right,1:-1]/ds
- f -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
- if data.pf.dimensionality > 2:
- ds = div_fac * data['dz'].flat[0]
- f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
- f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
- new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
- new_field[1:-1,1:-1,1:-1] = f
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDivV(data):
- return data.convert("cm")**-1.0
-
-
-DynamicalTime
-+++++++++++++
-
- * Units: :math:`\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DynamicalTime(field, data):
- """
- The formulation for the dynamical time is:
- M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
- Note that we return in our natural units already
- """
- return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
-
-
-**Convert Function Source**
-
-No source available.
-
-Entropy
-+++++++
-
- * Units: :math:`\rm{ergs}\ \rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Entropy(field, data):
- return kboltz * data["Temperature"] / \
- (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-
-
-**Convert Function Source**
-
-No source available.
-
-GridIndices
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridIndices(field, data):
- return na.ones(data["Ones"].shape)*(data.id-data._id_offset)
-
-
-**Convert Function Source**
-
-No source available.
-
-GridLevel
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridLevel(field, data):
- return na.ones(data.ActiveDimensions)*(data.Level)
-
-
-**Convert Function Source**
-
-No source available.
-
-Height
-++++++
-
- * Units: :math:`cm`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeight(data):
- return data.convert("cm")
-
-
-HeightAU
-++++++++
-
- * Units: :math:`AU`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeightAU(data):
- return data.convert("au")
-
-
-JeansMassMsun
-+++++++++++++
-
- * Units: :math:`\rm{M_{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _JeansMassMsun(field,data):
- MJ_constant = (((5*kboltz)/(G*mh))**(1.5)) * \
- (3/(4*3.1415926535897931))**(0.5) / 1.989e33
-
- return (MJ_constant *
- ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
- (data["Density"]**(-0.5)))
-
-
-**Convert Function Source**
-
-No source available.
-
-MachNumber
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MachNumber(field, data):
- """M{|v|/t_sound}"""
- return data["VelocityMagnitude"] / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-MagneticEnergy
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MagneticEnergy(field,data):
- """This assumes that your front end has provided Bx, By, Bz in
- units of Gauss. If you use MKS, make sure to write your own
- MagneticEnergy field to deal with non-unitary \mu_0.
- """
- return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/2.
-
-
-**Convert Function Source**
-
-No source available.
-
-Matter_Density
-++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-No source available.
-
-MeanMolecularWeight
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MeanMolecularWeight(field,data):
- return (data["Density"] / (mh *data["NumberDensity"]))
-
-
-**Convert Function Source**
-
-No source available.
-
-Ones
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-OnesOverDx
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _OnesOverDx(field, data):
- return na.ones(data["Ones"].shape,
- dtype=data["Density"].dtype)/data['dx']
-
-
-**Convert Function Source**
-
-No source available.
-
-Overdensity
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _Convert_Overdensity(data):
- return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
- (1+data.pf.current_redshift)**3)
-
-
-ParticleAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentum(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumMSUNKMSMPC(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentumKMSMPC"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumX(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumY(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumZ(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadius
-++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-ParticleRadiusAU
-++++++++++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-ParticleRadiusCode
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadiusMpc
-+++++++++++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-ParticleRadiuskpc
-+++++++++++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuskpch
-++++++++++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuspc
-++++++++++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-ParticleSpecificAngularMomentum
-+++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-ParticleSpecificAngularMomentumX
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumX(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- y = data["particle_position_y"] - center[1]
- z = data["particle_position_z"] - center[2]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- return yv*z - zv*y
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumY
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumY(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- z = data["particle_position_z"] - center[2]
- xv = data["particle_velocity_x"] - bv[0]
- zv = data["particle_velocity_z"] - bv[2]
- return -(xv*z - zv*x)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumZ
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumZ(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- y = data["particle_position_y"] - center[1]
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- return xv*y - yv*x
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleVelocityMagnitude
-+++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleVelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["particle_velocity_x"]-bulk_velocity[0])**2.0 + \
- (data["particle_velocity_y"]-bulk_velocity[1])**2.0 + \
- (data["particle_velocity_z"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
Pressure
++++++++
@@ -8022,598 +2237,6 @@
No source available.
-Pressure
-++++++++
-
- * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Pressure(field,data):
- """M{(Gamma-1.0)*e, where e is thermal energy density
- NB: this will need to be modified for radiation
- """
- return (data.pf["Gamma"] - 1.0)*data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialMachNumber
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialMachNumber(field, data):
- """M{|v|/t_sound}"""
- return na.abs(data["RadialVelocity"]) / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocity
-++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityABS
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityKMS
-+++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-RadialVelocityKMSABS
-++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-Radius
-++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-RadiusAU
-++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-RadiusCode
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-RadiusMpc
-+++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-Radiuskpc
-+++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuskpch
-++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuspc
-++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-SZKinetic
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZKinetic(field, data):
- vel_axis = data.get_field_parameter('axis')
- if vel_axis > 2:
- raise NeedsParameter(['axis'])
- vel = data["%s-velocity" % ({0:'x',1:'y',2:'z'}[vel_axis])]
- return (vel*data["Density"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZKinetic(data):
- return 0.88*((sigma_thompson/mh)/clight)
-
-
-SZY
-+++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZY(field, data):
- return (data["Density"]*data["Temperature"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZY(data):
- conv = (0.88/mh) * (kboltz)/(me * clight*clight) * sigma_thompson
- return conv
-
-
-SoundSpeed
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SoundSpeed(field, data):
- if data.pf["EOSType"] == 1:
- return na.ones(data["Density"].shape, dtype='float64') * \
- data.pf["EOSSoundSpeed"]
- return ( data.pf["Gamma"]*data["Pressure"] / \
- data["Density"] )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-SpecificAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-SpecificAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumX(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return yv*rv[2,:] - zv*rv[1,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumY(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return -(xv*rv[2,:] - zv*rv[0,:])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumZ(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return xv*rv[1,:] - yv*rv[0,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-StarMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarMass(field,data):
- return data["star_density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-TangentialOverVelocityMagnitude
-+++++++++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialOverVelocityMagnitude(field, data):
- return na.abs(data["TangentialVelocity"])/na.abs(data["VelocityMagnitude"])
-
-
-**Convert Function Source**
-
-No source available.
-
-TangentialVelocity
-++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialVelocity(field, data):
- return na.sqrt(data["VelocityMagnitude"]**2.0
- - data["RadialVelocity"]**2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
Temperature
+++++++++++
@@ -8669,189 +2292,6 @@
No source available.
-TotalMass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalMassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-VelocityMagnitude
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["x-velocity"]-bulk_velocity[0])**2.0 + \
- (data["y-velocity"]-bulk_velocity[1])**2.0 + \
- (data["z-velocity"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-VorticitySquared
-++++++++++++++++
-
- * Units: :math:`\rm{s}^{-2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VorticitySquared(field, data):
- mylog.debug("Generating vorticity on %s", data)
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- new_field = na.zeros(data["x-velocity"].shape)
- dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
- data["z-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
- data["y-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvzdy - dvydz)**2.0
- del dvzdy, dvydz
- dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
- data["x-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
- data["z-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvxdz - dvzdx)**2.0
- del dvxdz, dvzdx
- dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
- data["y-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
- data["x-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvydx - dvxdy)**2.0
- del dvydx, dvxdy
- new_field = na.abs(new_field)
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertVorticitySquared(data):
- return data.convert("cm")**-2.0
-
-
-WeakLensingConvergence
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertConvergence(data):
- if not data.pf.parameters.has_key('cosmology_calculator'):
- data.pf.parameters['cosmology_calculator'] = Cosmology(
- HubbleConstantNow=(100.*data.pf.hubble_constant),
- OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
- # observer to lens
- DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.current_redshift)
- # observer to source
- DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
- # lens to source
- DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
- return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
- (data.pf.hubble_constant / speed_of_light_cgs)**2 *
- (1 + data.pf.current_redshift)))
-
-
-XRayEmissivity
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _XRayEmissivity(field, data):
- return ((data["Density"].astype('float64')**2.0) \
- *data["Temperature"]**0.5)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertXRayEmissivity(data):
- return 2.168e60
-
-
density
+++++++
@@ -8863,60 +2303,6 @@
No source available.
-dx
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dx(field, data):
- return data.dds[0]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-dy
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dy(field, data):
- return data.dds[1]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-dz
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dz(field, data):
- return data.dds[2]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[2]
-
-
-**Convert Function Source**
-
-No source available.
-
eden
++++
@@ -9011,37 +2397,6 @@
No source available.
-particle_density
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
particle_id
+++++++++++
@@ -9294,23 +2649,6 @@
No source available.
-tempContours
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
temperature
+++++++++++
@@ -9320,26 +2658,6 @@
No source available.
-x
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordX(field, data):
- dim = data.ActiveDimensions[0]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[0])[:,None,None]
- +0.5) * data['dx'] + data.LeftEdge[0]
-
-
-**Convert Function Source**
-
-No source available.
-
x-momentum
++++++++++
@@ -9389,26 +2707,6 @@
No source available.
-y
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordY(field, data):
- dim = data.ActiveDimensions[1]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[1])[None,:,None]
- +0.5) * data['dy'] + data.LeftEdge[1]
-
-
-**Convert Function Source**
-
-No source available.
-
y-momentum
++++++++++
@@ -9461,26 +2759,6 @@
No source available.
-z
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordZ(field, data):
- dim = data.ActiveDimensions[2]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[2])[None,None,:]
- +0.5) * data['dz'] + data.LeftEdge[2]
-
-
-**Convert Function Source**
-
-No source available.
-
z-momentum
++++++++++
@@ -9533,441 +2811,6 @@
FLASH-Specific Field List
-------------------------
-AbsDivV
-+++++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AbsDivV(field, data):
- return na.abs(data['DivV'])
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentum
-+++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumX
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumX(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumY
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumY(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumZ
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumZ(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AveragedDensity
-+++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AveragedDensity(field, data):
- nx, ny, nz = data["Density"].shape
- new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- weight_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- i_i, j_i, k_i = na.mgrid[0:3,0:3,0:3]
- for i,j,k in zip(i_i.ravel(),j_i.ravel(),k_i.ravel()):
- sl = [slice(i,nx-(2-i)),slice(j,ny-(2-j)),slice(k,nz-(2-k))]
- new_field += data["Density"][sl] * data["CellMass"][sl]
- weight_field += data["CellMass"][sl]
- # Now some fancy footwork
- new_field2 = na.zeros((nx,ny,nz))
- new_field2[1:-1,1:-1,1:-1] = new_field/weight_field
- return new_field2
-
-
-**Convert Function Source**
-
-No source available.
-
-Baryon_Overdensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Baryon_Overdensity(field, data):
- if data.pf.has_key('omega_baryon_now'):
- omega_baryon_now = data.pf['omega_baryon_now']
- else:
- omega_baryon_now = 0.0441
- return data['Density'] / (omega_baryon_now * rho_crit_now *
- (data.pf['CosmologyHubbleConstantNow']**2) *
- ((1+data.pf['CosmologyCurrentRedshift'])**3))
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMassCode
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMassCode(field, data):
- return data["Density"] * data["CellVolumeCode"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassCode(data):
- return 1.0/data.convert("Density")
-
-
-CellMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-CellVolume
-++++++++++
-
- * Units: :math:`\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeCGS(data):
- return data.convert("cm")**3.0
-
-
-CellVolumeCode
-++++++++++++++
-
- * Units: :math:`\rm{BoxVolume}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellVolumeMpc
-+++++++++++++
-
- * Units: :math:`\rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeMpc(data):
- return data.convert("mpc")**3.0
-
-
-CellsPerBin
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-ComovingDensity
-+++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ComovingDensity(field, data):
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data["Density"]/ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Contours
-++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-CourantTimeStep
-+++++++++++++++
-
- * Units: :math:`$\rm{s}$`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CourantTimeStep(field, data):
- t1 = data['dx'] / (
- data["SoundSpeed"] + \
- abs(data["x-velocity"]))
- t2 = data['dy'] / (
- data["SoundSpeed"] + \
- abs(data["y-velocity"]))
- t3 = data['dz'] / (
- data["SoundSpeed"] + \
- abs(data["z-velocity"]))
- return na.minimum(na.minimum(t1,t2),t3)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCourantTimeStep(data):
- # SoundSpeed and z-velocity are in cm/s, dx is in code
- return data.convert("cm")
-
-
-CuttingPlaneVelocityX
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityX(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(x_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
-CuttingPlaneVelocityY
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityY(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(y_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
DII_Density
+++++++++++
@@ -10020,120 +2863,6 @@
No source available.
-DensityPerturbation
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-No source available.
-
-DiskAngle
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DiskAngle(field, data):
- # We make both r_vec and h_vec into unit vectors
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- r_vec = r_vec/na.sqrt((r_vec**2.0).sum(axis=0))
- h_vec = na.array(data.get_field_parameter("height_vector"))
- dp = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.arccos(dp)
-
-
-**Convert Function Source**
-
-No source available.
-
-DivV
-++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DivV(field, data):
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- ds = div_fac * data['dx'].flat[0]
- f = data["x-velocity"][sl_right,1:-1,1:-1]/ds
- f -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
- if data.pf.dimensionality > 1:
- ds = div_fac * data['dy'].flat[0]
- f += data["y-velocity"][1:-1,sl_right,1:-1]/ds
- f -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
- if data.pf.dimensionality > 2:
- ds = div_fac * data['dz'].flat[0]
- f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
- f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
- new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
- new_field[1:-1,1:-1,1:-1] = f
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDivV(data):
- return data.convert("cm")**-1.0
-
-
-DynamicalTime
-+++++++++++++
-
- * Units: :math:`\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DynamicalTime(field, data):
- """
- The formulation for the dynamical time is:
- M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
- Note that we return in our natural units already
- """
- return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
-
-
-**Convert Function Source**
-
-No source available.
-
Electron_Density
++++++++++++++++
@@ -10151,25 +2880,6 @@
No source available.
-Entropy
-+++++++
-
- * Units: :math:`\rm{ergs}\ \rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Entropy(field, data):
- return kboltz * data["Temperature"] / \
- (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-
-
-**Convert Function Source**
-
-No source available.
-
Flame_Density
+++++++++++++
@@ -10222,40 +2932,6 @@
No source available.
-GridIndices
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridIndices(field, data):
- return na.ones(data["Ones"].shape)*(data.id-data._id_offset)
-
-
-**Convert Function Source**
-
-No source available.
-
-GridLevel
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridLevel(field, data):
- return na.ones(data.ActiveDimensions)*(data.Level)
-
-
-**Convert Function Source**
-
-No source available.
-
H2II_Density
++++++++++++
@@ -10409,318 +3085,6 @@
No source available.
-Height
-++++++
-
- * Units: :math:`cm`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeight(data):
- return data.convert("cm")
-
-
-HeightAU
-++++++++
-
- * Units: :math:`AU`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeightAU(data):
- return data.convert("au")
-
-
-JeansMassMsun
-+++++++++++++
-
- * Units: :math:`\rm{M_{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _JeansMassMsun(field,data):
- MJ_constant = (((5*kboltz)/(G*mh))**(1.5)) * \
- (3/(4*3.1415926535897931))**(0.5) / 1.989e33
-
- return (MJ_constant *
- ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
- (data["Density"]**(-0.5)))
-
-
-**Convert Function Source**
-
-No source available.
-
-MachNumber
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MachNumber(field, data):
- """M{|v|/t_sound}"""
- return data["VelocityMagnitude"] / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-MagneticEnergy
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MagneticEnergy(field,data):
- """This assumes that your front end has provided Bx, By, Bz in
- units of Gauss. If you use MKS, make sure to write your own
- MagneticEnergy field to deal with non-unitary \mu_0.
- """
- return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/2.
-
-
-**Convert Function Source**
-
-No source available.
-
-Matter_Density
-++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-No source available.
-
-MeanMolecularWeight
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MeanMolecularWeight(field,data):
- return (data["Density"] / (mh *data["NumberDensity"]))
-
-
-**Convert Function Source**
-
-No source available.
-
-Ones
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-OnesOverDx
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _OnesOverDx(field, data):
- return na.ones(data["Ones"].shape,
- dtype=data["Density"].dtype)/data['dx']
-
-
-**Convert Function Source**
-
-No source available.
-
-Overdensity
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _Convert_Overdensity(data):
- return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
- (1+data.pf.current_redshift)**3)
-
-
-ParticleAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentum(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumMSUNKMSMPC(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentumKMSMPC"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumX(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumY(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumZ(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
ParticleMass
++++++++++++
@@ -10760,987 +3124,6 @@
return 1.0/1.989e33
-ParticleRadius
-++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-ParticleRadiusAU
-++++++++++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-ParticleRadiusCode
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadiusMpc
-+++++++++++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-ParticleRadiuskpc
-+++++++++++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuskpch
-++++++++++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuspc
-++++++++++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-ParticleSpecificAngularMomentum
-+++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-ParticleSpecificAngularMomentumX
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumX(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- y = data["particle_position_y"] - center[1]
- z = data["particle_position_z"] - center[2]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- return yv*z - zv*y
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumY
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumY(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- z = data["particle_position_z"] - center[2]
- xv = data["particle_velocity_x"] - bv[0]
- zv = data["particle_velocity_z"] - bv[2]
- return -(xv*z - zv*x)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumZ
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumZ(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- y = data["particle_position_y"] - center[1]
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- return xv*y - yv*x
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleVelocityMagnitude
-+++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleVelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["particle_velocity_x"]-bulk_velocity[0])**2.0 + \
- (data["particle_velocity_y"]-bulk_velocity[1])**2.0 + \
- (data["particle_velocity_z"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-Pressure
-++++++++
-
- * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Pressure(field, data):
- """M{(Gamma-1.0)*rho*E}"""
- return (data.pf["Gamma"] - 1.0) * \
- data["Density"] * data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialMachNumber
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialMachNumber(field, data):
- """M{|v|/t_sound}"""
- return na.abs(data["RadialVelocity"]) / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocity
-++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityABS
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityKMS
-+++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-RadialVelocityKMSABS
-++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-Radius
-++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-RadiusAU
-++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-RadiusCode
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-RadiusMpc
-+++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-Radiuskpc
-+++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuskpch
-++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuspc
-++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-SZKinetic
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZKinetic(field, data):
- vel_axis = data.get_field_parameter('axis')
- if vel_axis > 2:
- raise NeedsParameter(['axis'])
- vel = data["%s-velocity" % ({0:'x',1:'y',2:'z'}[vel_axis])]
- return (vel*data["Density"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZKinetic(data):
- return 0.88*((sigma_thompson/mh)/clight)
-
-
-SZY
-+++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZY(field, data):
- return (data["Density"]*data["Temperature"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZY(data):
- conv = (0.88/mh) * (kboltz)/(me * clight*clight) * sigma_thompson
- return conv
-
-
-SoundSpeed
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SoundSpeed(field, data):
- if data.pf["EOSType"] == 1:
- return na.ones(data["Density"].shape, dtype='float64') * \
- data.pf["EOSSoundSpeed"]
- return ( data.pf["Gamma"]*data["Pressure"] / \
- data["Density"] )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-SpecificAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-SpecificAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumX(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return yv*rv[2,:] - zv*rv[1,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumY(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return -(xv*rv[2,:] - zv*rv[0,:])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumZ(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return xv*rv[1,:] - yv*rv[0,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-StarMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarMass(field,data):
- return data["star_density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-TangentialOverVelocityMagnitude
-+++++++++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialOverVelocityMagnitude(field, data):
- return na.abs(data["TangentialVelocity"])/na.abs(data["VelocityMagnitude"])
-
-
-**Convert Function Source**
-
-No source available.
-
-TangentialVelocity
-++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialVelocity(field, data):
- return na.sqrt(data["VelocityMagnitude"]**2.0
- - data["RadialVelocity"]**2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
Temperature
+++++++++++
@@ -11777,274 +3160,6 @@
No source available.
-TotalMass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalMassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-VelocityMagnitude
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["x-velocity"]-bulk_velocity[0])**2.0 + \
- (data["y-velocity"]-bulk_velocity[1])**2.0 + \
- (data["z-velocity"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-VorticitySquared
-++++++++++++++++
-
- * Units: :math:`\rm{s}^{-2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VorticitySquared(field, data):
- mylog.debug("Generating vorticity on %s", data)
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- new_field = na.zeros(data["x-velocity"].shape)
- dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
- data["z-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
- data["y-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvzdy - dvydz)**2.0
- del dvzdy, dvydz
- dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
- data["x-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
- data["z-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvxdz - dvzdx)**2.0
- del dvxdz, dvzdx
- dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
- data["y-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
- data["x-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvydx - dvxdy)**2.0
- del dvydx, dvxdy
- new_field = na.abs(new_field)
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertVorticitySquared(data):
- return data.convert("cm")**-2.0
-
-
-WeakLensingConvergence
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertConvergence(data):
- if not data.pf.parameters.has_key('cosmology_calculator'):
- data.pf.parameters['cosmology_calculator'] = Cosmology(
- HubbleConstantNow=(100.*data.pf.hubble_constant),
- OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
- # observer to lens
- DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.current_redshift)
- # observer to source
- DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
- # lens to source
- DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
- return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
- (data.pf.hubble_constant / speed_of_light_cgs)**2 *
- (1 + data.pf.current_redshift)))
-
-
-XRayEmissivity
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _XRayEmissivity(field, data):
- return ((data["Density"].astype('float64')**2.0) \
- *data["Temperature"]**0.5)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertXRayEmissivity(data):
- return 2.168e60
-
-
-dx
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dx(field, data):
- return data.dds[0]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-dy
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dy(field, data):
- return data.dds[1]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-dz
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dz(field, data):
- return data.dds[2]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[2]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_density
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
particle_index
++++++++++++++
@@ -12170,43 +3285,6 @@
No source available.
-tempContours
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-x
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordX(field, data):
- dim = data.ActiveDimensions[0]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[0])[:,None,None]
- +0.5) * data['dx'] + data.LeftEdge[0]
-
-
-**Convert Function Source**
-
-No source available.
-
x-velocity
++++++++++
@@ -12225,26 +3303,6 @@
No source available.
-y
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordY(field, data):
- dim = data.ActiveDimensions[1]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[1])[None,:,None]
- +0.5) * data['dy'] + data.LeftEdge[1]
-
-
-**Convert Function Source**
-
-No source available.
-
y-velocity
++++++++++
@@ -12263,26 +3321,6 @@
No source available.
-z
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordZ(field, data):
- dim = data.ActiveDimensions[2]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[2])[None,None,:]
- +0.5) * data['dz'] + data.LeftEdge[2]
-
-
-**Convert Function Source**
-
-No source available.
-
z-velocity
++++++++++
@@ -12304,441 +3342,6 @@
Nyx-Specific Field List
--------------------------
-AbsDivV
-+++++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AbsDivV(field, data):
- return na.abs(data['DivV'])
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentum
-+++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumX
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumX(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumY
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumY(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumZ
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumZ(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AveragedDensity
-+++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AveragedDensity(field, data):
- nx, ny, nz = data["Density"].shape
- new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- weight_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- i_i, j_i, k_i = na.mgrid[0:3,0:3,0:3]
- for i,j,k in zip(i_i.ravel(),j_i.ravel(),k_i.ravel()):
- sl = [slice(i,nx-(2-i)),slice(j,ny-(2-j)),slice(k,nz-(2-k))]
- new_field += data["Density"][sl] * data["CellMass"][sl]
- weight_field += data["CellMass"][sl]
- # Now some fancy footwork
- new_field2 = na.zeros((nx,ny,nz))
- new_field2[1:-1,1:-1,1:-1] = new_field/weight_field
- return new_field2
-
-
-**Convert Function Source**
-
-No source available.
-
-Baryon_Overdensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Baryon_Overdensity(field, data):
- if data.pf.has_key('omega_baryon_now'):
- omega_baryon_now = data.pf['omega_baryon_now']
- else:
- omega_baryon_now = 0.0441
- return data['Density'] / (omega_baryon_now * rho_crit_now *
- (data.pf['CosmologyHubbleConstantNow']**2) *
- ((1+data.pf['CosmologyCurrentRedshift'])**3))
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMassCode
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMassCode(field, data):
- return data["Density"] * data["CellVolumeCode"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassCode(data):
- return 1.0/data.convert("Density")
-
-
-CellMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-CellVolume
-++++++++++
-
- * Units: :math:`\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeCGS(data):
- return data.convert("cm")**3.0
-
-
-CellVolumeCode
-++++++++++++++
-
- * Units: :math:`\rm{BoxVolume}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellVolumeMpc
-+++++++++++++
-
- * Units: :math:`\rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeMpc(data):
- return data.convert("mpc")**3.0
-
-
-CellsPerBin
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-ComovingDensity
-+++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ComovingDensity(field, data):
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data["Density"]/ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Contours
-++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-CourantTimeStep
-+++++++++++++++
-
- * Units: :math:`$\rm{s}$`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CourantTimeStep(field, data):
- t1 = data['dx'] / (
- data["SoundSpeed"] + \
- abs(data["x-velocity"]))
- t2 = data['dy'] / (
- data["SoundSpeed"] + \
- abs(data["y-velocity"]))
- t3 = data['dz'] / (
- data["SoundSpeed"] + \
- abs(data["z-velocity"]))
- return na.minimum(na.minimum(t1,t2),t3)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCourantTimeStep(data):
- # SoundSpeed and z-velocity are in cm/s, dx is in code
- return data.convert("cm")
-
-
-CuttingPlaneVelocityX
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityX(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(x_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
-CuttingPlaneVelocityY
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityY(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(y_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
Density
+++++++
@@ -12758,485 +3361,6 @@
No source available.
-DensityPerturbation
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-No source available.
-
-DiskAngle
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DiskAngle(field, data):
- # We make both r_vec and h_vec into unit vectors
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- r_vec = r_vec/na.sqrt((r_vec**2.0).sum(axis=0))
- h_vec = na.array(data.get_field_parameter("height_vector"))
- dp = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.arccos(dp)
-
-
-**Convert Function Source**
-
-No source available.
-
-DivV
-++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DivV(field, data):
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- ds = div_fac * data['dx'].flat[0]
- f = data["x-velocity"][sl_right,1:-1,1:-1]/ds
- f -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
- if data.pf.dimensionality > 1:
- ds = div_fac * data['dy'].flat[0]
- f += data["y-velocity"][1:-1,sl_right,1:-1]/ds
- f -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
- if data.pf.dimensionality > 2:
- ds = div_fac * data['dz'].flat[0]
- f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
- f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
- new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
- new_field[1:-1,1:-1,1:-1] = f
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDivV(data):
- return data.convert("cm")**-1.0
-
-
-DynamicalTime
-+++++++++++++
-
- * Units: :math:`\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DynamicalTime(field, data):
- """
- The formulation for the dynamical time is:
- M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
- Note that we return in our natural units already
- """
- return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
-
-
-**Convert Function Source**
-
-No source available.
-
-Entropy
-+++++++
-
- * Units: :math:`\rm{ergs}\ \rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Entropy(field, data):
- return kboltz * data["Temperature"] / \
- (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-
-
-**Convert Function Source**
-
-No source available.
-
-GridIndices
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridIndices(field, data):
- return na.ones(data["Ones"].shape)*(data.id-data._id_offset)
-
-
-**Convert Function Source**
-
-No source available.
-
-GridLevel
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridLevel(field, data):
- return na.ones(data.ActiveDimensions)*(data.Level)
-
-
-**Convert Function Source**
-
-No source available.
-
-Height
-++++++
-
- * Units: :math:`cm`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeight(data):
- return data.convert("cm")
-
-
-HeightAU
-++++++++
-
- * Units: :math:`AU`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeightAU(data):
- return data.convert("au")
-
-
-JeansMassMsun
-+++++++++++++
-
- * Units: :math:`\rm{M_{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _JeansMassMsun(field,data):
- MJ_constant = (((5*kboltz)/(G*mh))**(1.5)) * \
- (3/(4*3.1415926535897931))**(0.5) / 1.989e33
-
- return (MJ_constant *
- ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
- (data["Density"]**(-0.5)))
-
-
-**Convert Function Source**
-
-No source available.
-
-MachNumber
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MachNumber(field, data):
- """M{|v|/t_sound}"""
- return data["VelocityMagnitude"] / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-MagneticEnergy
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MagneticEnergy(field,data):
- """This assumes that your front end has provided Bx, By, Bz in
- units of Gauss. If you use MKS, make sure to write your own
- MagneticEnergy field to deal with non-unitary \mu_0.
- """
- return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/2.
-
-
-**Convert Function Source**
-
-No source available.
-
-Matter_Density
-++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-No source available.
-
-MeanMolecularWeight
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MeanMolecularWeight(field,data):
- return (data["Density"] / (mh *data["NumberDensity"]))
-
-
-**Convert Function Source**
-
-No source available.
-
-Ones
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-OnesOverDx
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _OnesOverDx(field, data):
- return na.ones(data["Ones"].shape,
- dtype=data["Density"].dtype)/data['dx']
-
-
-**Convert Function Source**
-
-No source available.
-
-Overdensity
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _Convert_Overdensity(data):
- return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
- (1+data.pf.current_redshift)**3)
-
-
-ParticleAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentum(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumMSUNKMSMPC(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentumKMSMPC"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumX(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumY(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumZ(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
ParticleMassMsun
++++++++++++++++
@@ -13259,396 +3383,6 @@
return (1/1.989e33)
-ParticleRadius
-++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-ParticleRadiusAU
-++++++++++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-ParticleRadiusCode
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadiusMpc
-+++++++++++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-ParticleRadiuskpc
-+++++++++++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuskpch
-++++++++++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuspc
-++++++++++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-ParticleSpecificAngularMomentum
-+++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-ParticleSpecificAngularMomentumX
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumX(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- y = data["particle_position_y"] - center[1]
- z = data["particle_position_z"] - center[2]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- return yv*z - zv*y
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumY
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumY(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- z = data["particle_position_z"] - center[2]
- xv = data["particle_velocity_x"] - bv[0]
- zv = data["particle_velocity_z"] - bv[2]
- return -(xv*z - zv*x)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumZ
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumZ(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- y = data["particle_position_y"] - center[1]
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- return xv*y - yv*x
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleVelocityMagnitude
-+++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleVelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["particle_velocity_x"]-bulk_velocity[0])**2.0 + \
- (data["particle_velocity_y"]-bulk_velocity[1])**2.0 + \
- (data["particle_velocity_z"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
Pressure
++++++++
@@ -13676,604 +3410,6 @@
No source available.
-Pressure
-++++++++
-
- * Units: :math:`\rm{M_{\odot}} (\rm{km} / \rm{s})^2 / \rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pressure(field, data):
- """
- Computed using
-
- $$ pressure = (\gamma - 1.0) * e$$
-
- where e is thermal energy density. Note that this will need to be modified
- when radiation is accounted for.
-
- """
- return (data.pf["Gamma"] - 1.0) * data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialMachNumber
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialMachNumber(field, data):
- """M{|v|/t_sound}"""
- return na.abs(data["RadialVelocity"]) / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocity
-++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityABS
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityKMS
-+++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-RadialVelocityKMSABS
-++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-Radius
-++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-RadiusAU
-++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-RadiusCode
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-RadiusMpc
-+++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-Radiuskpc
-+++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuskpch
-++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuspc
-++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-SZKinetic
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZKinetic(field, data):
- vel_axis = data.get_field_parameter('axis')
- if vel_axis > 2:
- raise NeedsParameter(['axis'])
- vel = data["%s-velocity" % ({0:'x',1:'y',2:'z'}[vel_axis])]
- return (vel*data["Density"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZKinetic(data):
- return 0.88*((sigma_thompson/mh)/clight)
-
-
-SZY
-+++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZY(field, data):
- return (data["Density"]*data["Temperature"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZY(data):
- conv = (0.88/mh) * (kboltz)/(me * clight*clight) * sigma_thompson
- return conv
-
-
-SoundSpeed
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SoundSpeed(field, data):
- if data.pf["EOSType"] == 1:
- return na.ones(data["Density"].shape, dtype='float64') * \
- data.pf["EOSSoundSpeed"]
- return ( data.pf["Gamma"]*data["Pressure"] / \
- data["Density"] )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-SpecificAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-SpecificAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumX(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return yv*rv[2,:] - zv*rv[1,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumY(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return -(xv*rv[2,:] - zv*rv[0,:])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumZ(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return xv*rv[1,:] - yv*rv[0,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-StarMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarMass(field,data):
- return data["star_density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-TangentialOverVelocityMagnitude
-+++++++++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialOverVelocityMagnitude(field, data):
- return na.abs(data["TangentialVelocity"])/na.abs(data["VelocityMagnitude"])
-
-
-**Convert Function Source**
-
-No source available.
-
-TangentialVelocity
-++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialVelocity(field, data):
- return na.sqrt(data["VelocityMagnitude"]**2.0
- - data["RadialVelocity"]**2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
Temperature
+++++++++++
@@ -14323,311 +3459,6 @@
No source available.
-TotalMass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalMassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-VelocityMagnitude
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["x-velocity"]-bulk_velocity[0])**2.0 + \
- (data["y-velocity"]-bulk_velocity[1])**2.0 + \
- (data["z-velocity"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-VorticitySquared
-++++++++++++++++
-
- * Units: :math:`\rm{s}^{-2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VorticitySquared(field, data):
- mylog.debug("Generating vorticity on %s", data)
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- new_field = na.zeros(data["x-velocity"].shape)
- dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
- data["z-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
- data["y-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvzdy - dvydz)**2.0
- del dvzdy, dvydz
- dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
- data["x-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
- data["z-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvxdz - dvzdx)**2.0
- del dvxdz, dvzdx
- dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
- data["y-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
- data["x-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvydx - dvxdy)**2.0
- del dvydx, dvxdy
- new_field = na.abs(new_field)
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertVorticitySquared(data):
- return data.convert("cm")**-2.0
-
-
-WeakLensingConvergence
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertConvergence(data):
- if not data.pf.parameters.has_key('cosmology_calculator'):
- data.pf.parameters['cosmology_calculator'] = Cosmology(
- HubbleConstantNow=(100.*data.pf.hubble_constant),
- OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
- # observer to lens
- DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.current_redshift)
- # observer to source
- DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
- # lens to source
- DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
- return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
- (data.pf.hubble_constant / speed_of_light_cgs)**2 *
- (1 + data.pf.current_redshift)))
-
-
-XRayEmissivity
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _XRayEmissivity(field, data):
- return ((data["Density"].astype('float64')**2.0) \
- *data["Temperature"]**0.5)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertXRayEmissivity(data):
- return 2.168e60
-
-
-dx
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dx(field, data):
- return data.dds[0]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-dy
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dy(field, data):
- return data.dds[1]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-dz
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dz(field, data):
- return data.dds[2]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[2]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_density
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
-tempContours
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-x
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordX(field, data):
- dim = data.ActiveDimensions[0]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[0])[:,None,None]
- +0.5) * data['dx'] + data.LeftEdge[0]
-
-
-**Convert Function Source**
-
-No source available.
-
x-velocity
++++++++++
@@ -14647,26 +3478,6 @@
No source available.
-y
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordY(field, data):
- dim = data.ActiveDimensions[1]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[1])[None,:,None]
- +0.5) * data['dy'] + data.LeftEdge[1]
-
-
-**Convert Function Source**
-
-No source available.
-
y-velocity
++++++++++
@@ -14686,26 +3497,6 @@
No source available.
-z
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordZ(field, data):
- dim = data.ActiveDimensions[2]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[2])[None,None,:]
- +0.5) * data['dz'] + data.LeftEdge[2]
-
-
-**Convert Function Source**
-
-No source available.
-
z-velocity
++++++++++
https://bitbucket.org/yt_analysis/yt-doc/changeset/f9a20382b3f3/
changeset: f9a20382b3f3
user: sskory
date: 2012-02-03 23:52:34
summary: Both the function and the convert_function need to be checked
for previous appearances. This fixes that oversight.
affected #: 2 files
diff -r 5da346c007de7ff48fdb5b561632e82d9d353c77 -r f9a20382b3f343e3970746010fd2da03e163a5f9 helper_scripts/show_fields.py
--- a/helper_scripts/show_fields.py
+++ b/helper_scripts/show_fields.py
@@ -29,17 +29,17 @@
print header
-seen = set([])
+seen = []
def print_all_fields(fl):
for fn in sorted(fl):
df = fl[fn]
f = df._function
- if f in seen:
+ cv = df._convert_function
+ if [f, cv] in seen:
continue
- seen.add(f)
- cv = df._convert_function
+ seen.append([f, cv])
print "%s" % (df.name)
print "+" * len(df.name)
print
diff -r 5da346c007de7ff48fdb5b561632e82d9d353c77 -r f9a20382b3f343e3970746010fd2da03e163a5f9 source/reference/field_list.rst
--- a/source/reference/field_list.rst
+++ b/source/reference/field_list.rst
@@ -1,3 +1,4 @@
+[?1034h
.. _field-list:
Field List
@@ -6,7 +7,7 @@
This is a list of all fields available in ``yt``. It has been organized by the
type of code that each field is supported by. "Universal" fields are available
everywhere, "Enzo" fields in Enzo datasets, "Orion" fields in Orion datasets,
-and so on.
+and so on.
.. note:: Universal fields will be overridden by a code-specific field.
@@ -56,6 +57,24 @@
No source available.
+AngularMomentumMSUNKMSMPC
++++++++++++++++++++++++++
+
+ * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AngularMomentum(field, data):
+ return data["CellMass"] * data["SpecificAngularMomentum"]
+
+
+**Convert Function Source**
+
+No source available.
+
AngularMomentumX
++++++++++++++++
@@ -200,6 +219,28 @@
return 1.0/data.convert("Density")
+CellMassMsun
+++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellMass(field, data):
+ return data["Density"] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
CellVolume
++++++++++
@@ -228,6 +269,58 @@
return data.convert("cm")**3.0
+CellVolumeCode
+++++++++++++++
+
+ * Units: :math:`\rm{BoxVolume}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellVolume(field, data):
+ if data['dx'].size == 1:
+ try:
+ return data['dx']*data['dy']*data['dx']*\
+ na.ones(data.ActiveDimensions, dtype='float64')
+ except AttributeError:
+ return data['dx']*data['dy']*data['dx']
+ return data["dx"]*data["dy"]*data["dz"]
+
+
+**Convert Function Source**
+
+No source available.
+
+CellVolumeMpc
++++++++++++++
+
+ * Units: :math:`\rm{Mpc}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellVolume(field, data):
+ if data['dx'].size == 1:
+ try:
+ return data['dx']*data['dy']*data['dx']*\
+ na.ones(data.ActiveDimensions, dtype='float64')
+ except AttributeError:
+ return data['dx']*data['dy']*data['dx']
+ return data["dx"]*data["dy"]*data["dz"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertCellVolumeMpc(data):
+ return data.convert("mpc")**3.0
+
+
CellsPerBin
+++++++++++
@@ -564,6 +657,40 @@
return data.convert("cm")
+HeightAU
+++++++++
+
+ * Units: :math:`AU`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Height(field, data):
+ # We take the dot product of the radius vector with the height-vector
+ center = data.get_field_parameter("center")
+ r_vec = na.array([data["x"] - center[0],
+ data["y"] - center[1],
+ data["z"] - center[2]])
+ h_vec = na.array(data.get_field_parameter("height_vector"))
+ h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
+ h_vec[1]**2.0+
+ h_vec[2]**2.0)
+ height = r_vec[0,:] * h_vec[0] \
+ + r_vec[1,:] * h_vec[1] \
+ + r_vec[2,:] * h_vec[2]
+ return na.abs(height)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertHeightAU(data):
+ return data.convert("au")
+
+
JeansMassMsun
+++++++++++++
@@ -661,6 +788,23 @@
No source available.
+Ones
+++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Ones(field, data):
+ return na.ones(data.ActiveDimensions, dtype='float64')
+
+
+**Convert Function Source**
+
+No source available.
+
OnesOverDx
++++++++++
@@ -679,6 +823,28 @@
No source available.
+Overdensity
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Matter_Density(field,data):
+ return (data['Density'] + data['Dark_Matter_Density'])
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _Convert_Overdensity(data):
+ return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
+ (1+data.pf.current_redshift)**3)
+
+
ParticleAngularMomentum
+++++++++++++++++++++++
@@ -798,6 +964,146 @@
return data.convert("cm")
+ParticleRadiusAU
+++++++++++++++++
+
+ * Units: :math:`\rm{AU}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusAU(data):
+ return data.convert("au")
+
+
+ParticleRadiusCode
+++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleRadiusMpc
++++++++++++++++++
+
+ * Units: :math:`\rm{Mpc}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusMpc(data):
+ return data.convert("mpc")
+
+
+ParticleRadiuskpc
++++++++++++++++++
+
+ * Units: :math:`\rm{kpc}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuskpc(data):
+ return data.convert("kpc")
+
+
+ParticleRadiuspc
+++++++++++++++++
+
+ * Units: :math:`\rm{pc}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuspc(data):
+ return data.convert("pc")
+
+
ParticleSpecificAngularMomentum
+++++++++++++++++++++++++++++++
@@ -837,6 +1143,45 @@
return data.convert("cm")
+ParticleSpecificAngularMomentumKMSMPC
++++++++++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleSpecificAngularMomentum(field, data):
+ """
+ Calculate the angular of a particle velocity. Returns a vector for each
+ particle.
+ """
+ if data.has_field_parameter("bulk_velocity"):
+ bv = data.get_field_parameter("bulk_velocity")
+ else: bv = na.zeros(3, dtype='float64')
+ xv = data["particle_velocity_x"] - bv[0]
+ yv = data["particle_velocity_y"] - bv[1]
+ zv = data["particle_velocity_z"] - bv[2]
+ center = data.get_field_parameter('center')
+ coords = na.array([data['particle_position_x'],
+ data['particle_position_y'],
+ data['particle_position_z']], dtype='float64')
+ new_shape = tuple([3] + [1]*(len(coords.shape)-1))
+ r_vec = coords - na.reshape(center,new_shape)
+ v_vec = na.array([xv,yv,zv], dtype='float64')
+ return na.cross(r_vec, v_vec, axis=0)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentumKMSMPC(data):
+ return data.convert("mpc")/1e5
+
+
ParticleSpecificAngularMomentumX
++++++++++++++++++++++++++++++++
@@ -1035,6 +1380,60 @@
No source available.
+RadialVelocityKMS
++++++++++++++++++
+
+ * Units: :math:`\rm{km}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialVelocity(field, data):
+ center = data.get_field_parameter("center")
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
+ + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
+ + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
+ )/data["RadiusCode"]
+ if na.any(na.isnan(new_field)): # to fix center = point
+ new_field[na.isnan(new_field)] = 0.0
+ return new_field
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadialVelocityKMS(data):
+ return 1e-5
+
+
+RadialVelocityKMSABS
+++++++++++++++++++++
+
+ * Units: :math:`\rm{km}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialVelocityABS(field, data):
+ return na.abs(_RadialVelocity(field, data))
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadialVelocityKMS(data):
+ return 1e-5
+
+
Radius
++++++
@@ -1064,6 +1463,146 @@
return data.convert("cm")
+RadiusAU
+++++++++
+
+ * Units: :math:`\rm{AU}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusAU(data):
+ return data.convert("au")
+
+
+RadiusCode
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+No source available.
+
+RadiusMpc
++++++++++
+
+ * Units: :math:`\rm{Mpc}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusMpc(data):
+ return data.convert("mpc")
+
+
+Radiuskpc
++++++++++
+
+ * Units: :math:`\rm{kpc}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuskpc(data):
+ return data.convert("kpc")
+
+
+Radiuspc
+++++++++
+
+ * Units: :math:`\rm{pc}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuspc(data):
+ return data.convert("pc")
+
+
SZKinetic
+++++++++
@@ -1161,6 +1700,34 @@
return data.convert("cm")
+SpecificAngularMomentumKMSMPC
++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpecificAngularMomentum(field, data):
+ """
+ Calculate the angular velocity. Returns a vector for each cell.
+ """
+ r_vec = obtain_rvec(data)
+ xv, yv, zv = obtain_velocities(data)
+ v_vec = na.array([xv,yv,zv], dtype='float64')
+ return na.cross(r_vec, v_vec, axis=0)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentumKMSMPC(data):
+ return data.convert("mpc")/1e5
+
+
SpecificAngularMomentumX
++++++++++++++++++++++++
@@ -1309,6 +1876,28 @@
No source available.
+TotalMassMsun
++++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TotalMass(field,data):
+ return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
VelocityMagnitude
+++++++++++++++++
@@ -1391,6 +1980,45 @@
return data.convert("cm")**-2.0
+WeakLensingConvergence
+++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _DensityPerturbation(field, data):
+ rho_bar = rho_crit_now * data.pf.omega_matter * \
+ data.pf.hubble_constant**2 * \
+ (1.0 + data.pf.current_redshift)**3
+ return ((data['Matter_Density'] - rho_bar) / rho_bar)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertConvergence(data):
+ if not data.pf.parameters.has_key('cosmology_calculator'):
+ data.pf.parameters['cosmology_calculator'] = Cosmology(
+ HubbleConstantNow=(100.*data.pf.hubble_constant),
+ OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
+ # observer to lens
+ DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
+ data.pf.parameters['observer_redshift'], data.pf.current_redshift)
+ # observer to source
+ DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
+ data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
+ # lens to source
+ DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
+ data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
+ return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
+ (data.pf.hubble_constant / speed_of_light_cgs)**2 *
+ (1 + data.pf.current_redshift)))
+
+
XRayEmissivity
++++++++++++++
@@ -1498,6 +2126,23 @@
return data.convert("Density")
+tempContours
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Contours(field, data):
+ return na.ones(data["Density"].shape)*-1
+
+
+**Convert Function Source**
+
+No source available.
+
x
+
@@ -1600,6 +2245,253 @@
No source available.
+Comoving_DI_Density
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_Electron_Density
++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_H2II_Density
++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_H2I_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HDI_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HII_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HI_Density
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HM_Density
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HeIII_Density
+++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HeII_Density
++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HeI_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_Metal_Density
+++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_PreShock_Density
++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
DII_Fraction
++++++++++++
@@ -1637,6 +2529,29 @@
No source available.
+DII_MassMsun
+++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
DII_NumberDensity
+++++++++++++++++
@@ -1660,6 +2575,43 @@
return 1.0/mh
+DI_Fraction
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+DI_Mass
++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
Dark_Matter_Mass
++++++++++++++++
@@ -1678,6 +2630,65 @@
No source available.
+Dark_Matter_MassMsun
+++++++++++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Dark_Matter_Mass(field, data):
+ return data['Dark_Matter_Density'] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
+Electron_Fraction
++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Electron_Mass
++++++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
Gas_Energy
++++++++++
@@ -1700,6 +2711,339 @@
return data.convert("x-velocity")**2.0
+H2II_Fraction
++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2II_Mass
++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2I_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2I_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HDI_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HDI_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HII_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HII_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HI_Fraction
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HI_Mass
++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HM_Fraction
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HM_Mass
++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeIII_Fraction
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeIII_Mass
+++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeII_Fraction
++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeII_Mass
++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeI_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeI_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
IsStarParticle
++++++++++++++
@@ -1738,6 +3082,43 @@
No source available.
+Metal_Fraction
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Metal_Mass
+++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
Metallicity
+++++++++++
@@ -1876,6 +3257,67 @@
return data.convert("Density")*(data.convert("cm")**3.0)
+ParticleMassMsun
+++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleMass(field, data):
+ particles = data["particle_mass"].astype('float64') * \
+ just_one(data["CellVolumeCode"].ravel())
+ # Note that we mandate grid-type here, so this is okay
+ return particles
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertParticleMassMsun(data):
+ return data.convert("Density")*((data.convert("cm")**3.0)/1.989e33)
+
+
+PreShock_Fraction
++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+PreShock_Mass
++++++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
StarAgeYears
++++++++++++
@@ -2061,6 +3503,100 @@
No source available.
+cic_particle_velocity_y
++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _cic_particle_field(field, data):
+ """
+ Create a grid field for particle quantities weighted by particle mass,
+ using cloud-in-cell deposit.
+ """
+ particle_field = field.name[4:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ particle_field_data = data[particle_field] * data['particle_mass']
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ data["particle_mass"].astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+cic_particle_velocity_z
++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _cic_particle_field(field, data):
+ """
+ Create a grid field for particle quantities weighted by particle mass,
+ using cloud-in-cell deposit.
+ """
+ particle_field = field.name[4:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ particle_field_data = data[particle_field] * data['particle_mass']
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ data["particle_mass"].astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
dm_density
++++++++++
@@ -2204,6 +3740,102 @@
return data.convert("Density")
+star_dynamical_time
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _star_field(field, data):
+ """
+ Create a grid field for star quantities, weighted by star mass.
+ """
+ particle_field = field.name[5:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ filter = data['creation_time'] > 0.0
+ if not filter.any(): return top
+ particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+star_metallicity_fraction
++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _star_field(field, data):
+ """
+ Create a grid field for star quantities, weighted by star mass.
+ """
+ particle_field = field.name[5:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ filter = data['creation_time'] > 0.0
+ if not filter.any(): return top
+ particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
Orion-Specific Field List
-------------------------
https://bitbucket.org/yt_analysis/yt-doc/changeset/c4f4cbbb167d/
changeset: c4f4cbbb167d
user: sskory
date: 2012-02-04 00:01:00
summary: Updating field_list.rst after noticing a bug in universial_fields.py
affected #: 1 file
diff -r f9a20382b3f343e3970746010fd2da03e163a5f9 -r c4f4cbbb167da2be7779965ba0e24af774aa9d97 source/reference/field_list.rst
--- a/source/reference/field_list.rst
+++ b/source/reference/field_list.rst
@@ -1,4 +1,3 @@
-[?1034h
.. _field-list:
Field List
@@ -1075,6 +1074,35 @@
return data.convert("kpc")
+ParticleRadiuskpch
+++++++++++++++++++
+
+ * Units: :math:`\rm{kpc}/\rm{h}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuskpch(data):
+ return data.convert("kpch")
+
+
ParticleRadiuspc
++++++++++++++++
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
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