Field List

This is a list of many of the fields available in yt. We have attempted to include most of the fields that are accessible through the plugin system, as well as the fields that are known by the frontends, however it is possible to generate many more permutations, particularly through vector operations. For more information about the fields framework, see Fields in yt.

Some fields are recognized by specific frontends only. These are typically fields like density and temperature that have their own names and units in the different frontend datasets. Often, these fields are aliased to their yt-named counterpart fields (typically ‘gas’ fieldtypes). For example, in the FLASH frontend, the dens field (i.e. (flash, dens)) is aliased to the gas field density (i.e. (gas, density)), similarly (flash, velx) is aliased to (gas, velocity_x), and so on. In what follows, if a field is aliased it will be noted.

Try using the ds.field_list and ds.derived_field_list to view the native and derived fields available for your dataset respectively. For example to display the native fields in alphabetical order:

Notebook
In [1]:
import yt
ds = yt.load("Enzo_64/DD0043/data0043")
for i in sorted(ds.field_list):
  print(i)
('all', 'creation_time')
('all', 'dynamical_time')
('all', 'metallicity_fraction')
('all', 'particle_index')
('all', 'particle_mass')
('all', 'particle_position_x')
('all', 'particle_position_y')
('all', 'particle_position_z')
('all', 'particle_type')
('all', 'particle_velocity_x')
('all', 'particle_velocity_y')
('all', 'particle_velocity_z')
('enzo', 'Dark_Matter_Density')
('enzo', 'Density')
('enzo', 'GasEnergy')
('enzo', 'Temperature')
('enzo', 'TotalEnergy')
('enzo', 'x-velocity')
('enzo', 'y-velocity')
('enzo', 'z-velocity')
('io', 'creation_time')
('io', 'dynamical_time')
('io', 'metallicity_fraction')
('io', 'particle_index')
('io', 'particle_mass')
('io', 'particle_position_x')
('io', 'particle_position_y')
('io', 'particle_position_z')
('io', 'particle_type')
('io', 'particle_velocity_x')
('io', 'particle_velocity_y')
('io', 'particle_velocity_z')
('nbody', 'creation_time')
('nbody', 'dynamical_time')
('nbody', 'metallicity_fraction')
('nbody', 'particle_index')
('nbody', 'particle_mass')
('nbody', 'particle_position_x')
('nbody', 'particle_position_y')
('nbody', 'particle_position_z')
('nbody', 'particle_type')
('nbody', 'particle_velocity_x')
('nbody', 'particle_velocity_y')
('nbody', 'particle_velocity_z')

To figure out out what all of the field types here mean, see Field types known to yt.

Universal Fields

(‘all’, ‘mesh_id’)

  • Sampling Method: particle

Field Source

def particle_mesh_ids(field, data):
    pos = data[ptype, coord_name]
    ids = np.zeros(pos.shape[0], dtype="float64") - 1
    # This is float64 in name only.  It will be properly cast inside the
    # deposit operation.
    # _ids = ids.view("float64")
    data.deposit(pos, [ids], method="mesh_id")
    return data.apply_units(ids, "")

(‘all’, ‘particle_angular_momentum’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum(field, data):
    am = (
        data[ptype, "particle_mass"]
        * data[ptype, "particle_specific_angular_momentum"].T
    )
    return am.T

(‘all’, ‘particle_angular_momentum_magnitude’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘all’, ‘particle_angular_momentum_x’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum_component(field, data):
    return (
        data[_ptype, "particle_mass"]
        * data[ptype, f"particle_specific_angular_momentum_{ax}"]
    )

(‘all’, ‘particle_angular_momentum_y’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum_component(field, data):
    return (
        data[_ptype, "particle_mass"]
        * data[ptype, f"particle_specific_angular_momentum_{ax}"]
    )

(‘all’, ‘particle_angular_momentum_z’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum_component(field, data):
    return (
        data[_ptype, "particle_mass"]
        * data[ptype, f"particle_specific_angular_momentum_{ax}"]
    )

(‘all’, ‘particle_cylindrical_velocity_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_cylindrical_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘particle_ones’)

  • Sampling Method: particle

Field Source

def particle_ones(field, data):
    v = np.ones(data[ptype, coord_name].shape[0], dtype="float64")
    return data.apply_units(v, field.units)

(‘all’, ‘particle_position’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

def particle_vectors(field, data):
    v = [data[_ptype, name].in_units(field.units) for name in names]
    return data.ds.arr(np.column_stack(v), v[0].units)

(‘all’, ‘particle_position_cylindrical_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_position_cylindrical_radius(field, data):
    """The cylindrical radius component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    pos.convert_to_units("code_length")
    return data.ds.arr(get_cyl_r(pos, normal), "code_length")

(‘all’, ‘particle_position_cylindrical_theta’)

  • Sampling Method: particle

Field Source

def _particle_position_cylindrical_theta(field, data):
    """The cylindrical theta component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    return data.ds.arr(get_cyl_theta(pos, normal), "")

(‘all’, ‘particle_position_cylindrical_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_position_cylindrical_z(field, data):
    """The cylindrical z component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    pos.convert_to_units("code_length")
    return data.ds.arr(get_cyl_z(pos, normal), "code_length")

(‘all’, ‘particle_position_relative_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘all’, ‘particle_position_relative_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘all’, ‘particle_position_relative_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘all’, ‘particle_position_spherical_phi’)

  • Sampling Method: particle

Field Source

def _particle_position_spherical_phi(field, data):
    """The spherical phi component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    return data.ds.arr(get_sph_phi(pos, normal), "")

(‘all’, ‘particle_position_spherical_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_radius(field, data):
    """The spherical radius component of the particle positions

    Relative to the coordinate system defined by the *normal* vector,
    and *center* field parameters.
    """
    return get_radius(data, "particle_position_", field.name[0])

(‘all’, ‘particle_position_spherical_theta’)

  • Sampling Method: particle

Field Source

def _particle_position_spherical_theta(field, data):
    """The spherical theta coordinate of the particle positions.

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    return data.ds.arr(get_sph_theta(pos, normal), "")

(‘all’, ‘particle_position_x’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘particle_position_y’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘particle_position_z’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘particle_radial_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘all’, ‘particle_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_radius(field, data):
    """The spherical radius component of the particle positions

    Relative to the coordinate system defined by the *normal* vector,
    and *center* field parameters.
    """
    return get_radius(data, "particle_position_", field.name[0])

(‘all’, ‘particle_specific_angular_momentum’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_specific_angular_momentum(field, data):
    """Calculate the angular of a particle velocity.

    Returns a vector for each particle.
    """
    center = data.get_field_parameter("center")
    pos, vel, normal = get_angular_momentum_components(ptype, data, spos, svel)
    L, r_vec, v_vec = modify_reference_frame(center, normal, P=pos, V=vel)
    # adding in the unit registry allows us to have a reference to the
    # dataset and thus we will always get the correct units after applying
    # the cross product.
    return ucross(r_vec, v_vec, registry=data.ds.unit_registry)

(‘all’, ‘particle_specific_angular_momentum_x’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_specific_angular_momentum_component(field, data):
    return data[_ptype, "particle_specific_angular_momentum"][:, axi]

(‘all’, ‘particle_specific_angular_momentum_y’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_specific_angular_momentum_component(field, data):
    return data[_ptype, "particle_specific_angular_momentum"][:, axi]

(‘all’, ‘particle_specific_angular_momentum_z’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_specific_angular_momentum_component(field, data):
    return data[_ptype, "particle_specific_angular_momentum"][:, axi]

(‘all’, ‘particle_spherical_position_phi’)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_spherical_position_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_spherical_position_theta’)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_spherical_velocity_phi’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_spherical_velocity_radius’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_spherical_velocity_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘all’, ‘particle_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def particle_vectors(field, data):
    v = [data[_ptype, name].in_units(field.units) for name in names]
    return data.ds.arr(np.column_stack(v), v[0].units)

(‘all’, ‘particle_velocity_cylindrical_radius’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_cylindrical_radius(field, data):
    """The cylindrical radius component of the particle velocities

    Relative to the coordinate system defined by the *normal* vector,
    *bulk_velocity* vector and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    vel = data[(ptype, "relative_particle_velocity")].T
    theta = get_cyl_theta(pos, normal)
    cylr = get_cyl_r_component(vel, theta, normal)
    return cylr

(‘all’, ‘particle_velocity_cylindrical_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_cylindrical_theta(field, data):
    """The cylindrical theta component of the particle velocities

    Relative to the coordinate system defined by the *normal* vector,
    *bulk_velocity* vector and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    vel = data[(ptype, "relative_particle_velocity")].T
    theta = get_cyl_theta(pos, normal)
    cylt = get_cyl_theta_component(vel, theta, normal)
    return cylt

(‘all’, ‘particle_velocity_cylindrical_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_cylindrical_z(field, data):
    """The cylindrical z component of the particle velocities

    Relative to the coordinate system defined by the *normal* vector,
    *bulk_velocity* vector and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vel = data[(ptype, "relative_particle_velocity")].T
    cylz = get_cyl_z_component(vel, normal)
    return cylz

(‘all’, ‘particle_velocity_magnitude’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_magnitude(field, data):
    """M{|v|}"""
    return np.sqrt(
        data[ptype, f"relative_{svel % 'x'}"] ** 2
        + data[ptype, f"relative_{svel % 'y'}"] ** 2
        + data[ptype, f"relative_{svel % 'z'}"] ** 2
    )

(‘all’, ‘particle_velocity_relative_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_vel_rel(field, data):
    return data[_ptype, "relative_particle_velocity"][:, axi]

(‘all’, ‘particle_velocity_relative_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_vel_rel(field, data):
    return data[_ptype, "relative_particle_velocity"][:, axi]

(‘all’, ‘particle_velocity_relative_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_vel_rel(field, data):
    return data[_ptype, "relative_particle_velocity"][:, axi]

(‘all’, ‘particle_velocity_spherical_phi’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_spherical_phi(field, data):
    """The spherical phi component of the particle velocities

    Relative to the coordinate system defined by the *normal* vector,
    *bulk_velocity* vector and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    vel = data[(ptype, "relative_particle_velocity")].T
    phi = get_sph_phi(pos, normal)
    sphp = get_sph_phi_component(vel, phi, normal)
    return sphp

(‘all’, ‘particle_velocity_spherical_radius’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_spherical_radius(field, data):
    """The spherical radius component of the particle velocities in an
     arbitrary coordinate system

    Relative to the coordinate system defined by the *normal* vector,
    *bulk_velocity* vector and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    vel = data[(ptype, "relative_particle_velocity")].T
    theta = get_sph_theta(pos, normal)
    phi = get_sph_phi(pos, normal)
    sphr = get_sph_r_component(vel, theta, phi, normal)
    return sphr

(‘all’, ‘particle_velocity_spherical_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_velocity_spherical_theta(field, data):
    """The spherical theta component of the particle velocities in an
     arbitrary coordinate system

    Relative to the coordinate system defined by the *normal* vector,
    *bulk_velocity* vector and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    vel = data[(ptype, "relative_particle_velocity")].T
    theta = get_sph_theta(pos, normal)
    phi = get_sph_phi(pos, normal)
    spht = get_sph_theta_component(vel, theta, phi, normal)
    return spht

(‘all’, ‘particle_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘particle_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘particle_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

No source available.

(‘all’, ‘relative_particle_position’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _relative_particle_position(field, data):
    """The cartesian particle positions in a rotated reference frame

    Relative to the coordinate system defined by *center* field parameter.

    Note that the orientation of the x and y axes are arbitrary.
    """
    field_names = [(ptype, f"particle_position_{ax}") for ax in "xyz"]
    return obtain_position_vector(data, field_names=field_names).T

(‘all’, ‘relative_particle_position_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘all’, ‘relative_particle_position_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘all’, ‘relative_particle_position_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘all’, ‘relative_particle_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _relative_particle_velocity(field, data):
    """The vector particle velocities in an arbitrary coordinate system

    Relative to the coordinate system defined by the *bulk_velocity*
    vector field parameter.

    Note that the orientation of the x and y axes are arbitrary.
    """
    field_names = [(ptype, f"particle_velocity_{ax}") for ax in "xyz"]
    return obtain_relative_velocity_vector(data, field_names=field_names).T

(‘all’, ‘relative_particle_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_vel_rel(field, data):
    return data[_ptype, "relative_particle_velocity"][:, axi]

(‘all’, ‘relative_particle_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_vel_rel(field, data):
    return data[_ptype, "relative_particle_velocity"][:, axi]

(‘all’, ‘relative_particle_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_vel_rel(field, data):
    return data[_ptype, "relative_particle_velocity"][:, axi]

(‘deposit’, ‘all_cic’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def particle_cic(field, data):
    pos = data[ptype, coord_name]
    d = data.deposit(pos, [data[ptype, mass_name]], method="cic")
    d = data.apply_units(d, data[ptype, mass_name].units)
    d /= data["index", "cell_volume"]
    return d

(‘deposit’, ‘all_cic_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘all_cic_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘all_cic_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘all_count’)

  • Sampling Method: cell

Field Source

def particle_count(field, data):
    pos = data[ptype, coord_name]
    d = data.deposit(pos, method="count")
    return data.apply_units(d, field.units)

(‘deposit’, ‘all_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def particle_density(field, data):
    pos = data[ptype, coord_name]
    pos.convert_to_units("code_length")
    mass = data[ptype, mass_name]
    mass.convert_to_units("code_mass")
    d = data.deposit(pos, [mass], method="sum")
    d = data.ds.arr(d, "code_mass")
    d /= data["index", "cell_volume"]
    return d

(‘deposit’, ‘all_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: cell

Field Source

def particle_mass(field, data):
    pos = data[ptype, coord_name]
    pmass = data[ptype, mass_name]
    pmass.convert_to_units(field.units)
    d = data.deposit(pos, [pmass], method="sum")
    return data.apply_units(d, field.units)

(‘deposit’, ‘all_nn_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘all_nn_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘all_nn_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘io_cic’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def particle_cic(field, data):
    pos = data[ptype, coord_name]
    d = data.deposit(pos, [data[ptype, mass_name]], method="cic")
    d = data.apply_units(d, data[ptype, mass_name].units)
    d /= data["index", "cell_volume"]
    return d

(‘deposit’, ‘io_cic_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘io_cic_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘io_cic_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘io_count’)

  • Sampling Method: cell

Field Source

def particle_count(field, data):
    pos = data[ptype, coord_name]
    d = data.deposit(pos, method="count")
    return data.apply_units(d, field.units)

(‘deposit’, ‘io_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def particle_density(field, data):
    pos = data[ptype, coord_name]
    pos.convert_to_units("code_length")
    mass = data[ptype, mass_name]
    mass.convert_to_units("code_mass")
    d = data.deposit(pos, [mass], method="sum")
    d = data.ds.arr(d, "code_mass")
    d /= data["index", "cell_volume"]
    return d

(‘deposit’, ‘io_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: cell

Field Source

def particle_mass(field, data):
    pos = data[ptype, coord_name]
    pmass = data[ptype, mass_name]
    pmass.convert_to_units(field.units)
    d = data.deposit(pos, [pmass], method="sum")
    return data.apply_units(d, field.units)

(‘deposit’, ‘io_nn_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘io_nn_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘io_nn_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘nbody_cic’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def particle_cic(field, data):
    pos = data[ptype, coord_name]
    d = data.deposit(pos, [data[ptype, mass_name]], method="cic")
    d = data.apply_units(d, data[ptype, mass_name].units)
    d /= data["index", "cell_volume"]
    return d

(‘deposit’, ‘nbody_cic_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘nbody_cic_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘nbody_cic_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘nbody_count’)

  • Sampling Method: cell

Field Source

def particle_count(field, data):
    pos = data[ptype, coord_name]
    d = data.deposit(pos, method="count")
    return data.apply_units(d, field.units)

(‘deposit’, ‘nbody_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def particle_density(field, data):
    pos = data[ptype, coord_name]
    pos.convert_to_units("code_length")
    mass = data[ptype, mass_name]
    mass.convert_to_units("code_mass")
    d = data.deposit(pos, [mass], method="sum")
    d = data.ds.arr(d, "code_mass")
    d /= data["index", "cell_volume"]
    return d

(‘deposit’, ‘nbody_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: cell

Field Source

def particle_mass(field, data):
    pos = data[ptype, coord_name]
    pmass = data[ptype, mass_name]
    pmass.convert_to_units(field.units)
    d = data.deposit(pos, [pmass], method="sum")
    return data.apply_units(d, field.units)

(‘deposit’, ‘nbody_nn_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘nbody_nn_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘deposit’, ‘nbody_nn_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _deposit_field(field, data):
    """
    Create a grid field for particle quantities weighted by particle
    mass, using cloud-in-cell deposit.
    """
    pos = data[ptype, "particle_position"]
    # Get back into density
    pden = data[ptype, "particle_mass"]
    top = data.deposit(pos, [pden * data[(ptype, fname)]], method=method)
    bottom = data.deposit(pos, [pden], method=method)
    top[bottom == 0] = 0.0
    bnz = bottom.nonzero()
    top[bnz] /= bottom[bnz]
    d = data.ds.arr(top, units=units)
    return d

(‘gas’, ‘alfven_speed’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _alfven_speed(field, data):
    B = data[ftype, "magnetic_field_strength"]
    return B / np.sqrt(mag_factors(B.units.dimensions) * data[ftype, "density"])

(‘gas’, ‘angular_momentum_magnitude’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘angular_momentum_x’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _angular_momentum_x(field, data):
    return data[ftype, "mass"] * data[ftype, "specific_angular_momentum_x"]

(‘gas’, ‘angular_momentum_y’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _angular_momentum_y(field, data):
    return data[ftype, "mass"] * data[ftype, "specific_angular_momentum_y"]

(‘gas’, ‘angular_momentum_z’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _angular_momentum_z(field, data):
    return data[ftype, "mass"] * data[ftype, "specific_angular_momentum_z"]

(‘gas’, ‘averaged_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _averaged_field(field, data):
    def atleast_4d(array):
        if array.ndim == 3:
            return array[..., None]
        else:
            return array

    nx, ny, nz, ngrids = atleast_4d(data[(ftype, basename)]).shape
    new_field = data.ds.arr(
        np.zeros((nx - 2, ny - 2, nz - 2, ngrids), dtype=np.float64),
        (just_one(data[(ftype, basename)]) * just_one(data[(ftype, weight)])).units,
    )
    weight_field = data.ds.arr(
        np.zeros((nx - 2, ny - 2, nz - 2, ngrids), dtype=np.float64),
        data[(ftype, weight)].units,
    )
    i_i, j_i, k_i = np.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 += (
            atleast_4d(data[(ftype, basename)])[sl]
            * atleast_4d(data[(ftype, weight)])[sl]
        )
        weight_field += atleast_4d(data[(ftype, weight)])[sl]

    # Now some fancy footwork
    new_field2 = data.ds.arr(
        np.zeros((nx, ny, nz, ngrids)), data[(ftype, basename)].units
    )
    new_field2[1:-1, 1:-1, 1:-1] = new_field / weight_field

    if data[(ftype, basename)].ndim == 3:
        return new_field2[..., 0]
    else:
        return new_field2

(‘gas’, ‘baroclinic_vorticity_magnitude’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘baroclinic_vorticity_x’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _baroclinic_vorticity_x(field, data):
    rho2 = data[ftype, "density"].astype(np.float64) ** 2
    return (
        data[ftype, "pressure_gradient_y"] * data[ftype, "density_gradient_z"]
        - data[ftype, "pressure_gradient_z"] * data[ftype, "density_gradient_z"]
    ) / rho2

(‘gas’, ‘baroclinic_vorticity_y’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _baroclinic_vorticity_y(field, data):
    rho2 = data[ftype, "density"].astype(np.float64) ** 2
    return (
        data[ftype, "pressure_gradient_z"] * data[ftype, "density_gradient_x"]
        - data[ftype, "pressure_gradient_x"] * data[ftype, "density_gradient_z"]
    ) / rho2

(‘gas’, ‘baroclinic_vorticity_z’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _baroclinic_vorticity_z(field, data):
    rho2 = data[ftype, "density"].astype(np.float64) ** 2
    return (
        data[ftype, "pressure_gradient_x"] * data[ftype, "density_gradient_y"]
        - data[ftype, "pressure_gradient_y"] * data[ftype, "density_gradient_x"]
    ) / rho2

(‘gas’, ‘baryon_overdensity’)

  • Sampling Method: local

Field Source

def _baryon_overdensity(field, data):
    if (
        not hasattr(data.ds, "cosmological_simulation")
        or not data.ds.cosmological_simulation
    ):
        raise NeedsConfiguration("cosmological_simulation", 1)
    omega_baryon = data.get_field_parameter("omega_baryon")
    if omega_baryon is None:
        raise NeedsParameter("omega_baryon")
    co = data.ds.cosmology
    # critical_density(z) ~ omega_lambda + omega_matter * (1 + z)^3
    # mean matter density(z) ~ omega_matter * (1 + z)^3
    return (
        data[ftype, "density"]
        / omega_baryon
        / co.critical_density(0.0)
        / (1.0 + data.ds.current_redshift) ** 3
    )

(‘gas’, ‘cell_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: cell

Field Source

def _cell_mass(field, data):
    return data[ftype, "density"] * data[ftype, "cell_volume"]

(‘gas’, ‘cell_volume’)

  • Units: \(\rm{cm}^{3}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘courant_time_step’)

  • Units: \(\rm{s}\)

  • Sampling Method: cell

Field Source

def _courant_time_step(field, data):
    t1 = data[ftype, "dx"] / (
        data[ftype, "sound_speed"] + np.abs(data[ftype, "velocity_x"])
    )
    t2 = data[ftype, "dy"] / (
        data[ftype, "sound_speed"] + np.abs(data[ftype, "velocity_y"])
    )
    t3 = data[ftype, "dz"] / (
        data[ftype, "sound_speed"] + np.abs(data[ftype, "velocity_z"])
    )
    tr = np.minimum(np.minimum(t1, t2), t3)
    return tr

(‘gas’, ‘cutting_plane_magnetic_field_x’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _cp_val(field, data):
    vec = data.get_field_parameter(f"cp_{ax}_vec")
    tr = data[xn[0], f"relative_{xn[1]}"] * vec.d[0]
    tr += data[yn[0], f"relative_{yn[1]}"] * vec.d[1]
    tr += data[zn[0], f"relative_{zn[1]}"] * vec.d[2]
    return tr

(‘gas’, ‘cutting_plane_magnetic_field_y’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _cp_val(field, data):
    vec = data.get_field_parameter(f"cp_{ax}_vec")
    tr = data[xn[0], f"relative_{xn[1]}"] * vec.d[0]
    tr += data[yn[0], f"relative_{yn[1]}"] * vec.d[1]
    tr += data[zn[0], f"relative_{zn[1]}"] * vec.d[2]
    return tr

(‘gas’, ‘cutting_plane_magnetic_field_z’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _cp_val(field, data):
    vec = data.get_field_parameter(f"cp_{ax}_vec")
    tr = data[xn[0], f"relative_{xn[1]}"] * vec.d[0]
    tr += data[yn[0], f"relative_{yn[1]}"] * vec.d[1]
    tr += data[zn[0], f"relative_{zn[1]}"] * vec.d[2]
    return tr

(‘gas’, ‘cutting_plane_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _cp_val(field, data):
    vec = data.get_field_parameter(f"cp_{ax}_vec")
    tr = data[xn[0], f"relative_{xn[1]}"] * vec.d[0]
    tr += data[yn[0], f"relative_{yn[1]}"] * vec.d[1]
    tr += data[zn[0], f"relative_{zn[1]}"] * vec.d[2]
    return tr

(‘gas’, ‘cutting_plane_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _cp_val(field, data):
    vec = data.get_field_parameter(f"cp_{ax}_vec")
    tr = data[xn[0], f"relative_{xn[1]}"] * vec.d[0]
    tr += data[yn[0], f"relative_{yn[1]}"] * vec.d[1]
    tr += data[zn[0], f"relative_{zn[1]}"] * vec.d[2]
    return tr

(‘gas’, ‘cutting_plane_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _cp_val(field, data):
    vec = data.get_field_parameter(f"cp_{ax}_vec")
    tr = data[xn[0], f"relative_{xn[1]}"] * vec.d[0]
    tr += data[yn[0], f"relative_{yn[1]}"] * vec.d[1]
    tr += data[zn[0], f"relative_{zn[1]}"] * vec.d[2]
    return tr

(‘gas’, ‘cylindrical_radial_magnetic_field’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_radial_magnetic_field_absolute’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_radial_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_radial_velocity_absolute’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_tangential_magnetic_field’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_tangential_magnetic_field_absolute’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_tangential_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘cylindrical_tangential_velocity_absolute’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘dark_matter_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘density_gradient_magnitude’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{4}}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘density_gradient_x’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{4}}\)

  • Sampling Method: local

Field Source

def func(field, data):
    block_order = getattr(data, "_block_order", "C")
    if block_order == "F":
        # Fortran-ordering: we need to swap axes here and
        # reswap below
        field_data = data[grad_field].swapaxes(0, 2)
    else:
        field_data = data[grad_field]
    dx = div_fac * data[ftype, f"d{ax}"]
    if ax == "theta":
        dx *= data[ftype, "r"]
    if ax == "phi":
        dx *= data[ftype, "r"] * np.sin(data[ftype, "theta"])
    f = field_data[slice_3dr] / dx[slice_3d]
    f -= field_data[slice_3dl] / dx[slice_3d]
    new_field = np.zeros_like(data[grad_field], dtype=np.float64)
    new_field = data.ds.arr(new_field, field_data.units / dx.units)
    new_field[slice_3d] = f

    if block_order == "F":
        new_field = new_field.swapaxes(0, 2)

    return new_field

(‘gas’, ‘density_gradient_y’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{4}}\)

  • Sampling Method: local

Field Source

def func(field, data):
    block_order = getattr(data, "_block_order", "C")
    if block_order == "F":
        # Fortran-ordering: we need to swap axes here and
        # reswap below
        field_data = data[grad_field].swapaxes(0, 2)
    else:
        field_data = data[grad_field]
    dx = div_fac * data[ftype, f"d{ax}"]
    if ax == "theta":
        dx *= data[ftype, "r"]
    if ax == "phi":
        dx *= data[ftype, "r"] * np.sin(data[ftype, "theta"])
    f = field_data[slice_3dr] / dx[slice_3d]
    f -= field_data[slice_3dl] / dx[slice_3d]
    new_field = np.zeros_like(data[grad_field], dtype=np.float64)
    new_field = data.ds.arr(new_field, field_data.units / dx.units)
    new_field[slice_3d] = f

    if block_order == "F":
        new_field = new_field.swapaxes(0, 2)

    return new_field

(‘gas’, ‘density_gradient_z’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{4}}\)

  • Sampling Method: local

Field Source

def func(field, data):
    block_order = getattr(data, "_block_order", "C")
    if block_order == "F":
        # Fortran-ordering: we need to swap axes here and
        # reswap below
        field_data = data[grad_field].swapaxes(0, 2)
    else:
        field_data = data[grad_field]
    dx = div_fac * data[ftype, f"d{ax}"]
    if ax == "theta":
        dx *= data[ftype, "r"]
    if ax == "phi":
        dx *= data[ftype, "r"] * np.sin(data[ftype, "theta"])
    f = field_data[slice_3dr] / dx[slice_3d]
    f -= field_data[slice_3dl] / dx[slice_3d]
    new_field = np.zeros_like(data[grad_field], dtype=np.float64)
    new_field = data.ds.arr(new_field, field_data.units / dx.units)
    new_field[slice_3d] = f

    if block_order == "F":
        new_field = new_field.swapaxes(0, 2)

    return new_field

(‘gas’, ‘di_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘dii_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘dx’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘dy’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘dynamical_time’)

  • Units: \(\rm{s}\)

  • Sampling Method: local

Field Source

def _dynamical_time(field, data):
    """
    sqrt(3 pi / (16 G rho))
    """
    return np.sqrt(3.0 * np.pi / (16.0 * pc.G * data[ftype, "density"]))

(‘gas’, ‘dz’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘four_velocity_magnitude’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘four_velocity_t’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _four_velocity_t(field, data):
    return data["gas", "lorentz_factor"] * pc.clight

(‘gas’, ‘four_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _four_velocity(field, data):
    return data["gas", f"velocity_{u}"] * data["gas", "lorentz_factor"]

(‘gas’, ‘four_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _four_velocity(field, data):
    return data["gas", f"velocity_{u}"] * data["gas", "lorentz_factor"]

(‘gas’, ‘four_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _four_velocity(field, data):
    return data["gas", f"velocity_{u}"] * data["gas", "lorentz_factor"]

(‘gas’, ‘h2i_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘h2ii_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘h2m_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘hdi_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘hei_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘heii_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘heiii_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘hi_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘hii_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘jeans_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: local

Field Source

def _jeans_mass(field, data):
    MJ_constant = (((5.0 * pc.kboltz) / (pc.G * pc.mh)) ** 1.5) * (
        3.0 / (4.0 * np.pi)
    ) ** 0.5
    u = (
        MJ_constant
        * (
            (data[ftype, "temperature"] / data[ftype, "mean_molecular_weight"])
            ** 1.5
        )
        * (data[ftype, "density"] ** (-0.5))
    )
    return u

(‘gas’, ‘kT’)

  • Units: \(\rm{keV}\)

  • Sampling Method: local

Field Source

def _kT(field, data):
    return (pc.kboltz * data[ftype, "temperature"]).in_units("keV")

(‘gas’, ‘kinetic_energy’)

  • Units: \(\frac{\rm{dyn}}{\rm{cm}^{2}}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘kinetic_energy_density’)

  • Units: \(\frac{\rm{dyn}}{\rm{cm}^{2}}\)

  • Sampling Method: local

Field Source

def _kinetic_energy_density(field, data):
    v = obtain_relative_velocity_vector(data)
    return 0.5 * data[ftype, "density"] * (v ** 2).sum(axis=0)

(‘gas’, ‘lorentz_factor’)

  • Sampling Method: local

Field Source

def _lorentz_factor(field, data):
    b2 = data[ftype, "velocity_magnitude"].to_value("c")
    b2 *= b2
    return 1.0 / np.sqrt(1.0 - b2)

(‘gas’, ‘mach_alfven’)

  • Units: :math:``

  • Sampling Method: local

Field Source

def _mach_alfven(field, data):
    return data[ftype, "velocity_magnitude"] / data[ftype, "alfven_speed"]

(‘gas’, ‘mach_number’)

  • Sampling Method: local

Field Source

def _mach_number(field, data):
    """M{|v|/c_sound}"""
    return data[ftype, "velocity_magnitude"] / data[ftype, "sound_speed"]

(‘gas’, ‘magnetic_energy’)

  • Units: \(\frac{\rm{dyn}}{\rm{cm}^{2}}\)

  • Sampling Method: local

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘magnetic_energy_density’)

  • Units: \(\frac{\rm{dyn}}{\rm{cm}^{2}}\)

  • Sampling Method: local

Field Source

def _magnetic_energy_density(field, data):
    B = data[ftype, "magnetic_field_strength"]
    return 0.5 * B * B / mag_factors(B.units.dimensions)

(‘gas’, ‘magnetic_field_cylindrical_radius’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _cylindrical_radius_component(field, data):
    """The cylindrical radius component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "cylindrical_theta"]
    return get_cyl_r_component(vectors, theta, normal)

(‘gas’, ‘magnetic_field_cylindrical_theta’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _cylindrical_theta_component(field, data):
    """The cylindrical theta component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "cylindrical_theta"].copy()
    theta = np.tile(theta, (3,) + (1,) * len(theta.shape))
    return get_cyl_theta_component(vectors, theta, normal)

(‘gas’, ‘magnetic_field_cylindrical_z’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _cylindrical_z_component(field, data):
    """The cylindrical z component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    return get_cyl_z_component(vectors, normal)

(‘gas’, ‘magnetic_field_divergence’)

  • Units: \(\frac{\sqrt{\rm{g}}}{\rm{cm}^{3/2} \cdot \rm{s}}\)

  • Sampling Method: local

Field Source

def _divergence(field, data):
    ds = div_fac * just_one(data["index", "dx"])
    f = data[xn[0], f"relative_{xn[1]}"][sl_right, 1:-1, 1:-1] / ds
    f -= data[xn[0], f"relative_{xn[1]}"][sl_left, 1:-1, 1:-1] / ds
    ds = div_fac * just_one(data["index", "dy"])
    f += data[yn[0], f"relative_{yn[1]}"][1:-1, sl_right, 1:-1] / ds
    f -= data[yn[0], f"relative_{yn[1]}"][1:-1, sl_left, 1:-1] / ds
    ds = div_fac * just_one(data["index", "dz"])
    f += data[zn[0], f"relative_{zn[1]}"][1:-1, 1:-1, sl_right] / ds
    f -= data[zn[0], f"relative_{zn[1]}"][1:-1, 1:-1, sl_left] / ds
    new_field = data.ds.arr(np.zeros(data[xn].shape, dtype=np.float64), f.units)
    new_field[1:-1, 1:-1, 1:-1] = f
    return new_field

(‘gas’, ‘magnetic_field_divergence_absolute’)

  • Units: \(\frac{\sqrt{\rm{g}}}{\rm{cm}^{3/2} \cdot \rm{s}}\)

  • Sampling Method: local

Field Source

def _divergence_abs(field, data):
    return np.abs(data[ftype, f"{basename}_divergence"])

(‘gas’, ‘magnetic_field_los’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _los_field(field, data):
    if data.has_field_parameter(f"bulk_{basename}"):
        fns = [(fc[0], f"relative_{fc[1]}") for fc in field_comps]
    else:
        fns = field_comps
    ax = data.get_field_parameter("axis")
    if is_sequence(ax):
        # Make sure this is a unit vector
        ax /= np.sqrt(np.dot(ax, ax))
        ret = data[fns[0]] * ax[0] + data[fns[1]] * ax[1] + data[fns[2]] * ax[2]
    elif ax in [0, 1, 2]:
        ret = data[fns[ax]]
    else:
        raise NeedsParameter(["axis"])
    return ret

(‘gas’, ‘magnetic_field_magnitude’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘magnetic_field_poloidal’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _magnetic_field_poloidal(field, data):
    normal = data.get_field_parameter("normal")

    Bfields = ustack(
        [
            data[ftype, "relative_magnetic_field_x"],
            data[ftype, "relative_magnetic_field_y"],
            data[ftype, "relative_magnetic_field_z"],
        ]
    )

    theta = data["index", "spherical_theta"]
    phi = data["index", "spherical_phi"]

    return get_sph_theta_component(Bfields, theta, phi, normal)

(‘gas’, ‘magnetic_field_spherical_phi’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _spherical_phi_component(field, data):
    """The spherical phi component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    phi = data["index", "spherical_phi"]
    return get_sph_phi_component(vectors, phi, normal)

(‘gas’, ‘magnetic_field_spherical_radius’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _spherical_radius_component(field, data):
    """The spherical radius component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "spherical_theta"]
    phi = data["index", "spherical_phi"]
    rv = get_sph_r_component(vectors, theta, phi, normal)
    # Now, anywhere that radius is in fact zero, we want to zero out our
    # return values.
    rv[np.isnan(theta)] = 0.0
    return rv

(‘gas’, ‘magnetic_field_spherical_theta’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _spherical_theta_component(field, data):
    """The spherical theta component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "spherical_theta"]
    phi = data["index", "spherical_phi"]
    return get_sph_theta_component(vectors, theta, phi, normal)

(‘gas’, ‘magnetic_field_strength’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _magnetic_field_strength(field, data):
    xm = f"relative_magnetic_field_{axis_names[0]}"
    ym = f"relative_magnetic_field_{axis_names[1]}"
    zm = f"relative_magnetic_field_{axis_names[2]}"

    B2 = (data[ftype, xm]) ** 2 + (data[ftype, ym]) ** 2 + (data[ftype, zm]) ** 2

    return np.sqrt(B2)

(‘gas’, ‘magnetic_field_toroidal’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _magnetic_field_toroidal(field, data):
    normal = data.get_field_parameter("normal")

    Bfields = ustack(
        [
            data[ftype, "relative_magnetic_field_x"],
            data[ftype, "relative_magnetic_field_y"],
            data[ftype, "relative_magnetic_field_z"],
        ]
    )

    phi = data["index", "spherical_phi"]
    return get_sph_phi_component(Bfields, phi, normal)

(‘gas’, ‘magnetic_field_x’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _mag_field(field, data):
    return data[fd].to(field.units)

(‘gas’, ‘magnetic_field_y’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _mag_field(field, data):
    return data[fd].to(field.units)

(‘gas’, ‘magnetic_field_z’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _mag_field(field, data):
    return data[fd].to(field.units)

(‘gas’, ‘magnetic_pressure’)

  • Units: \(\frac{\rm{dyn}}{\rm{cm}^{2}}\)

  • Sampling Method: local

Field Source

def _magnetic_pressure(field, data):
    return data[ftype, "magnetic_energy_density"]

(‘gas’, ‘mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘matter_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: local

Field Source

def _matter_density(field, data):
    return data[ftype, "density"] + data[ftype, "dark_matter_density"]

(‘gas’, ‘matter_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: local

Field Source

def _matter_mass(field, data):
    return data[ftype, "matter_density"] * data["index", "cell_volume"]

(‘gas’, ‘matter_overdensity’)

  • Sampling Method: local

Field Source

def _matter_overdensity(field, data):
    if (
        not hasattr(data.ds, "cosmological_simulation")
        or not data.ds.cosmological_simulation
    ):
        raise NeedsConfiguration("cosmological_simulation", 1)
    co = data.ds.cosmology
    # critical_density(z) ~ omega_lambda + omega_matter * (1 + z)^3
    # mean density(z) ~ omega_matter * (1 + z)^3
    return (
        data[ftype, "matter_density"]
        / data.ds.omega_matter
        / co.critical_density(0.0)
        / (1.0 + data.ds.current_redshift) ** 3
    )

(‘gas’, ‘mean_molecular_weight’)

  • Sampling Method: local

Field Source

def _mean_molecular_weight(field, data):
    return data[ftype, "density"] / (pc.mh * data[ftype, "number_density"])

(‘gas’, ‘metal_density’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘metal_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: local

Field Source

def _metal_mass(field, data):
    Z = data[ftype, "metallicity"].to("dimensionless")
    return Z * data[ftype, "mass"]

(‘gas’, ‘metallicity’)

  • Units: \(\rm{Z}_\odot\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘momentum_density_x’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}}\)

  • Sampling Method: local

Field Source

def _momd(field, data):
    return data["gas", "density"] * data["gas", f"velocity_{v}"]

(‘gas’, ‘momentum_density_y’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}}\)

  • Sampling Method: local

Field Source

def _momd(field, data):
    return data["gas", "density"] * data["gas", f"velocity_{v}"]

(‘gas’, ‘momentum_density_z’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}}\)

  • Sampling Method: local

Field Source

def _momd(field, data):
    return data["gas", "density"] * data["gas", f"velocity_{v}"]

(‘gas’, ‘momentum_x’)

  • Units: \(\rm{cm} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _momm(field, data):
    return data["gas", "mass"] * data["gas", f"velocity_{v}"]

(‘gas’, ‘momentum_y’)

  • Units: \(\rm{cm} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _momm(field, data):
    return data["gas", "mass"] * data["gas", f"velocity_{v}"]

(‘gas’, ‘momentum_z’)

  • Units: \(\rm{cm} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: local

Field Source

def _momm(field, data):
    return data["gas", "mass"] * data["gas", f"velocity_{v}"]

(‘gas’, ‘number_density’)

  • Units: \(\frac{1}{\rm{cm}^{3}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘overdensity’)

  • Sampling Method: local

Field Source

def _overdensity(field, data):
    if (
        not hasattr(data.ds, "cosmological_simulation")
        or not data.ds.cosmological_simulation
    ):
        raise NeedsConfiguration("cosmological_simulation", 1)
    co = data.ds.cosmology
    return data[ftype, "matter_density"] / co.critical_density(
        data.ds.current_redshift
    )

(‘gas’, ‘path_element_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘path_element_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘path_element_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘plasma_beta’)

  • Sampling Method: local

Field Source

def _plasma_beta(field, data):
    return data[ftype, "pressure"] / data[ftype, "magnetic_energy_density"]

(‘gas’, ‘pressure’)

  • Units: \(\frac{\rm{dyn}}{\rm{cm}^{2}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘pressure_gradient_magnitude’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘pressure_gradient_x’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def func(field, data):
    block_order = getattr(data, "_block_order", "C")
    if block_order == "F":
        # Fortran-ordering: we need to swap axes here and
        # reswap below
        field_data = data[grad_field].swapaxes(0, 2)
    else:
        field_data = data[grad_field]
    dx = div_fac * data[ftype, f"d{ax}"]
    if ax == "theta":
        dx *= data[ftype, "r"]
    if ax == "phi":
        dx *= data[ftype, "r"] * np.sin(data[ftype, "theta"])
    f = field_data[slice_3dr] / dx[slice_3d]
    f -= field_data[slice_3dl] / dx[slice_3d]
    new_field = np.zeros_like(data[grad_field], dtype=np.float64)
    new_field = data.ds.arr(new_field, field_data.units / dx.units)
    new_field[slice_3d] = f

    if block_order == "F":
        new_field = new_field.swapaxes(0, 2)

    return new_field

(‘gas’, ‘pressure_gradient_y’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def func(field, data):
    block_order = getattr(data, "_block_order", "C")
    if block_order == "F":
        # Fortran-ordering: we need to swap axes here and
        # reswap below
        field_data = data[grad_field].swapaxes(0, 2)
    else:
        field_data = data[grad_field]
    dx = div_fac * data[ftype, f"d{ax}"]
    if ax == "theta":
        dx *= data[ftype, "r"]
    if ax == "phi":
        dx *= data[ftype, "r"] * np.sin(data[ftype, "theta"])
    f = field_data[slice_3dr] / dx[slice_3d]
    f -= field_data[slice_3dl] / dx[slice_3d]
    new_field = np.zeros_like(data[grad_field], dtype=np.float64)
    new_field = data.ds.arr(new_field, field_data.units / dx.units)
    new_field[slice_3d] = f

    if block_order == "F":
        new_field = new_field.swapaxes(0, 2)

    return new_field

(‘gas’, ‘pressure_gradient_z’)

  • Units: \(\frac{\rm{g}}{\rm{cm}^{2} \cdot \rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def func(field, data):
    block_order = getattr(data, "_block_order", "C")
    if block_order == "F":
        # Fortran-ordering: we need to swap axes here and
        # reswap below
        field_data = data[grad_field].swapaxes(0, 2)
    else:
        field_data = data[grad_field]
    dx = div_fac * data[ftype, f"d{ax}"]
    if ax == "theta":
        dx *= data[ftype, "r"]
    if ax == "phi":
        dx *= data[ftype, "r"] * np.sin(data[ftype, "theta"])
    f = field_data[slice_3dr] / dx[slice_3d]
    f -= field_data[slice_3dl] / dx[slice_3d]
    new_field = np.zeros_like(data[grad_field], dtype=np.float64)
    new_field = data.ds.arr(new_field, field_data.units / dx.units)
    new_field[slice_3d] = f

    if block_order == "F":
        new_field = new_field.swapaxes(0, 2)

    return new_field

(‘gas’, ‘radial_mach_number’)

  • Sampling Method: local

Field Source

def _radial_mach_number(field, data):
    """Radial component of M{|v|/c_sound}"""
    tr = data[ftype, "radial_velocity"] / data[ftype, "sound_speed"]
    return np.abs(tr)

(‘gas’, ‘radial_magnetic_field’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _radial(field, data):
    return data[ftype, f"{basename}_spherical_radius"]

(‘gas’, ‘radial_magnetic_field_absolute’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _radial_absolute(field, data):
    return np.abs(data[ftype, f"{basename}_spherical_radius"])

(‘gas’, ‘radial_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _radial(field, data):
    return data[ftype, f"{basename}_spherical_radius"]

(‘gas’, ‘radial_velocity_absolute’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _radial_absolute(field, data):
    return np.abs(data[ftype, f"{basename}_spherical_radius"])

(‘gas’, ‘radiation_acceleration_x’)

  • Units: \(\frac{\rm{cm}}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘radiation_acceleration_y’)

  • Units: \(\frac{\rm{cm}}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘radiation_acceleration_z’)

  • Units: \(\frac{\rm{cm}}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘relative_magnetic_field_x’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _relative_vector(field, data):
    iax = axis_order.index(ax)
    d = data[field_components[iax]]
    bulk = get_bulk(data, basename, d.unit_quantity)
    return d - bulk[iax]

(‘gas’, ‘relative_magnetic_field_y’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _relative_vector(field, data):
    iax = axis_order.index(ax)
    d = data[field_components[iax]]
    bulk = get_bulk(data, basename, d.unit_quantity)
    return d - bulk[iax]

(‘gas’, ‘relative_magnetic_field_z’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _relative_vector(field, data):
    iax = axis_order.index(ax)
    d = data[field_components[iax]]
    bulk = get_bulk(data, basename, d.unit_quantity)
    return d - bulk[iax]

(‘gas’, ‘relative_velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _relative_vector(field, data):
    iax = axis_order.index(ax)
    d = data[field_components[iax]]
    bulk = get_bulk(data, basename, d.unit_quantity)
    return d - bulk[iax]

(‘gas’, ‘relative_velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _relative_vector(field, data):
    iax = axis_order.index(ax)
    d = data[field_components[iax]]
    bulk = get_bulk(data, basename, d.unit_quantity)
    return d - bulk[iax]

(‘gas’, ‘relative_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _relative_vector(field, data):
    iax = axis_order.index(ax)
    d = data[field_components[iax]]
    bulk = get_bulk(data, basename, d.unit_quantity)
    return d - bulk[iax]

(‘gas’, ‘shear’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: cell

Field Source

def _shear(field, data):
    """
    Shear is defined as [(dvx/dy + dvy/dx)^2 + (dvz/dy + dvy/dz)^2 +
                         (dvx/dz + dvz/dx)^2 ]^(0.5)
    where dvx/dy = [vx(j-1) - vx(j+1)]/[2dy]
    and is in units of s^(-1)
    (it's just like vorticity except add the derivative pairs instead
     of subtracting them)
    """

    if data.ds.geometry != "cartesian":
        raise NotImplementedError("shear is only supported in cartesian geometries")

    try:
        vx = data[ftype, "relative_velocity_x"]
        vy = data[ftype, "relative_velocity_y"]
    except YTFieldNotFound as e:
        raise YTDimensionalityError(
            "shear computation requires 2 velocity components"
        ) from e

    dvydx = (
        vy[sl_right, sl_center, sl_center] - vy[sl_left, sl_center, sl_center]
    ) / (div_fac * just_one(data["index", "dx"]))
    dvxdy = (
        vx[sl_center, sl_right, sl_center] - vx[sl_center, sl_left, sl_center]
    ) / (div_fac * just_one(data["index", "dy"]))
    f = (dvydx + dvxdy) ** 2.0
    del dvydx, dvxdy

    try:
        vz = data[ftype, "relative_velocity_z"]
        dvzdy = (
            vz[sl_center, sl_right, sl_center] - vz[sl_center, sl_left, sl_center]
        ) / (div_fac * just_one(data["index", "dy"]))
        dvydz = (
            vy[sl_center, sl_center, sl_right] - vy[sl_center, sl_center, sl_left]
        ) / (div_fac * just_one(data["index", "dz"]))
        f += (dvzdy + dvydz) ** 2.0
        del dvzdy, dvydz
        dvxdz = (
            vx[sl_center, sl_center, sl_right] - vx[sl_center, sl_center, sl_left]
        ) / (div_fac * just_one(data["index", "dz"]))
        dvzdx = (
            vz[sl_right, sl_center, sl_center] - vz[sl_left, sl_center, sl_center]
        ) / (div_fac * just_one(data["index", "dx"]))
        f += (dvxdz + dvzdx) ** 2.0
        del dvxdz, dvzdx
    except YTFieldNotFound:
        # the absence of a z velocity component is not blocking
        pass

    np.sqrt(f, out=f)
    new_field = data.ds.arr(np.zeros_like(data[ftype, "velocity_x"]), f.units)
    new_field[sl_center, sl_center, sl_center] = f
    return new_field

(‘gas’, ‘shear_criterion’)

  • Units: \(1 / \rm{cm}\)

  • Sampling Method: cell

Field Source

def _shear_criterion(field, data):
    """
    Divide by c_s to leave shear in units of length**-1, which
    can be compared against the inverse of the local cell size (1/dx)
    to determine if refinement should occur.
    """
    return data[ftype, "shear"] / data[ftype, "sound_speed"]

(‘gas’, ‘shear_mach’)

  • Sampling Method: cell

Field Source

def _shear_mach(field, data):
    """
    Dimensionless shear (shear_mach) is defined nearly the same as shear,
    except that it is scaled by the local dx/dy/dz and the local sound speed.
    So it results in a unitless quantity that is effectively measuring
    shear in mach number.

    In order to avoid discontinuities created by multiplying by dx/dy/dz at
    grid refinement boundaries, we also multiply by 2**GridLevel.

    Shear (Mach) = [(dvx + dvy)^2 + (dvz + dvy)^2 +
                    (dvx + dvz)^2  ]^(0.5) / c_sound
    """

    if data.ds.geometry != "cartesian":
        raise NotImplementedError(
            "shear_mach is only supported in cartesian geometries"
        )

    try:
        vx = data[ftype, "relative_velocity_x"]
        vy = data[ftype, "relative_velocity_y"]
    except YTFieldNotFound as e:
        raise YTDimensionalityError(
            "shear_mach computation requires 2 velocity components"
        ) from e
    dvydx = (
        vy[sl_right, sl_center, sl_center] - vy[sl_left, sl_center, sl_center]
    ) / div_fac
    dvxdy = (
        vx[sl_center, sl_right, sl_center] - vx[sl_center, sl_left, sl_center]
    ) / div_fac
    f = (dvydx + dvxdy) ** 2.0
    del dvydx, dvxdy
    try:
        vz = data[ftype, "relative_velocity_z"]
        dvzdy = (
            vz[sl_center, sl_right, sl_center] - vz[sl_center, sl_left, sl_center]
        ) / div_fac
        dvydz = (
            vy[sl_center, sl_center, sl_right] - vy[sl_center, sl_center, sl_left]
        ) / div_fac
        f += (dvzdy + dvydz) ** 2.0
        del dvzdy, dvydz
        dvxdz = (
            vx[sl_center, sl_center, sl_right] - vx[sl_center, sl_center, sl_left]
        ) / div_fac
        dvzdx = (
            vz[sl_right, sl_center, sl_center] - vz[sl_left, sl_center, sl_center]
        ) / div_fac
        f += (dvxdz + dvzdx) ** 2.0
        del dvxdz, dvzdx
    except YTFieldNotFound:
        # the absence of a z velocity component is not blocking
        pass
    f *= (
        2.0 ** data["index", "grid_level"][sl_center, sl_center, sl_center]
        / data[ftype, "sound_speed"][sl_center, sl_center, sl_center]
    ) ** 2.0
    np.sqrt(f, out=f)
    new_field = data.ds.arr(np.zeros_like(vx), f.units)
    new_field[sl_center, sl_center, sl_center] = f
    return new_field

(‘gas’, ‘sound_speed’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _sound_speed(field, data):
    tr = data.ds.gamma * data[ftype, "pressure"] / data[ftype, "density"]
    return np.sqrt(tr)

(‘gas’, ‘specific_angular_momentum_magnitude’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘specific_angular_momentum_x’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: local

Field Source

def _specific_angular_momentum_x(field, data):
    xv, yv, zv = obtain_relative_velocity_vector(data)
    rv = obtain_position_vector(data)
    units = rv.units
    rv = np.rollaxis(rv, 0, len(rv.shape))
    rv = data.ds.arr(rv, units=units)
    return rv[..., 1] * zv - rv[..., 2] * yv

(‘gas’, ‘specific_angular_momentum_y’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: local

Field Source

def _specific_angular_momentum_y(field, data):
    xv, yv, zv = obtain_relative_velocity_vector(data)
    rv = obtain_position_vector(data)
    units = rv.units
    rv = np.rollaxis(rv, 0, len(rv.shape))
    rv = data.ds.arr(rv, units=units)
    return rv[..., 2] * xv - rv[..., 0] * zv

(‘gas’, ‘specific_angular_momentum_z’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: local

Field Source

def _specific_angular_momentum_z(field, data):
    xv, yv, zv = obtain_relative_velocity_vector(data)
    rv = obtain_position_vector(data)
    units = rv.units
    rv = np.rollaxis(rv, 0, len(rv.shape))
    rv = data.ds.arr(rv, units=units)
    return rv[..., 0] * yv - rv[..., 1] * xv

(‘gas’, ‘specific_thermal_energy’)

  • Units: \(\rm{erg} / \rm{g}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘tangential_magnetic_field’)

  • Units: \(\rm{G}\)

  • Sampling Method: local

Field Source

def _tangential(field, data):
    return np.sqrt(
        data[ftype, f"{basename}_spherical_theta"] ** 2.0
        + data[ftype, f"{basename}_spherical_phi"] ** 2.0
    )

(‘gas’, ‘tangential_over_magnetic_field_magnitude’)

  • Sampling Method: local

Field Source

def _tangential_over_magnitude(field, data):
    tr = (
        data[ftype, f"tangential_{basename}"]
        / data[ftype, f"{basename}_magnitude"]
    )
    return np.abs(tr)

(‘gas’, ‘tangential_over_velocity_magnitude’)

  • Sampling Method: local

Field Source

def _tangential_over_magnitude(field, data):
    tr = (
        data[ftype, f"tangential_{basename}"]
        / data[ftype, f"{basename}_magnitude"]
    )
    return np.abs(tr)

(‘gas’, ‘tangential_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _tangential(field, data):
    return np.sqrt(
        data[ftype, f"{basename}_spherical_theta"] ** 2.0
        + data[ftype, f"{basename}_spherical_phi"] ** 2.0
    )

(‘gas’, ‘temperature’)

  • Units: \(\rm{K}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘thermal_energy’)

  • Units: \(\rm{erg} / \rm{g}\)

  • Sampling Method: cell

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘gas’, ‘velocity_cylindrical_radius’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _cylindrical_radius_component(field, data):
    """The cylindrical radius component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "cylindrical_theta"]
    return get_cyl_r_component(vectors, theta, normal)

(‘gas’, ‘velocity_cylindrical_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _cylindrical_theta_component(field, data):
    """The cylindrical theta component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "cylindrical_theta"].copy()
    theta = np.tile(theta, (3,) + (1,) * len(theta.shape))
    return get_cyl_theta_component(vectors, theta, normal)

(‘gas’, ‘velocity_cylindrical_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _cylindrical_z_component(field, data):
    """The cylindrical z component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    return get_cyl_z_component(vectors, normal)

(‘gas’, ‘velocity_divergence’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: local

Field Source

def _divergence(field, data):
    ds = div_fac * just_one(data["index", "dx"])
    f = data[xn[0], f"relative_{xn[1]}"][sl_right, 1:-1, 1:-1] / ds
    f -= data[xn[0], f"relative_{xn[1]}"][sl_left, 1:-1, 1:-1] / ds
    ds = div_fac * just_one(data["index", "dy"])
    f += data[yn[0], f"relative_{yn[1]}"][1:-1, sl_right, 1:-1] / ds
    f -= data[yn[0], f"relative_{yn[1]}"][1:-1, sl_left, 1:-1] / ds
    ds = div_fac * just_one(data["index", "dz"])
    f += data[zn[0], f"relative_{zn[1]}"][1:-1, 1:-1, sl_right] / ds
    f -= data[zn[0], f"relative_{zn[1]}"][1:-1, 1:-1, sl_left] / ds
    new_field = data.ds.arr(np.zeros(data[xn].shape, dtype=np.float64), f.units)
    new_field[1:-1, 1:-1, 1:-1] = f
    return new_field

(‘gas’, ‘velocity_divergence_absolute’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: local

Field Source

def _divergence_abs(field, data):
    return np.abs(data[ftype, f"{basename}_divergence"])

(‘gas’, ‘velocity_los’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _los_field(field, data):
    if data.has_field_parameter(f"bulk_{basename}"):
        fns = [(fc[0], f"relative_{fc[1]}") for fc in field_comps]
    else:
        fns = field_comps
    ax = data.get_field_parameter("axis")
    if is_sequence(ax):
        # Make sure this is a unit vector
        ax /= np.sqrt(np.dot(ax, ax))
        ret = data[fns[0]] * ax[0] + data[fns[1]] * ax[1] + data[fns[2]] * ax[2]
    elif ax in [0, 1, 2]:
        ret = data[fns[ax]]
    else:
        raise NeedsParameter(["axis"])
    return ret

(‘gas’, ‘velocity_magnitude’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘velocity_spherical_phi’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _spherical_phi_component(field, data):
    """The spherical phi component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    phi = data["index", "spherical_phi"]
    return get_sph_phi_component(vectors, phi, normal)

(‘gas’, ‘velocity_spherical_radius’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _spherical_radius_component(field, data):
    """The spherical radius component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "spherical_theta"]
    phi = data["index", "spherical_phi"]
    rv = get_sph_r_component(vectors, theta, phi, normal)
    # Now, anywhere that radius is in fact zero, we want to zero out our
    # return values.
    rv[np.isnan(theta)] = 0.0
    return rv

(‘gas’, ‘velocity_spherical_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: local

Field Source

def _spherical_theta_component(field, data):
    """The spherical theta component of the vector field

    Relative to the coordinate system defined by the *normal* vector,
    *center*, and *bulk_* field parameters.
    """
    normal = data.get_field_parameter("normal")
    vectors = obtain_relative_velocity_vector(
        data, (xn, yn, zn), f"bulk_{basename}"
    )
    theta = data["index", "spherical_theta"]
    phi = data["index", "spherical_phi"]
    return get_sph_theta_component(vectors, theta, phi, normal)

(‘gas’, ‘velocity_x’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘velocity_y’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘vertex_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘vertex_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘vertex_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘volume’)

  • Units: \(\rm{cm}^{3}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘vorticity_growth_magnitude’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_growth_magnitude(field, data):
    result = np.sqrt(
        data[ftype, "vorticity_growth_x"] ** 2
        + data[ftype, "vorticity_growth_y"] ** 2
        + data[ftype, "vorticity_growth_z"] ** 2
    )
    dot = data.ds.arr(np.zeros(result.shape), "")
    for ax in "xyz":
        dot += (
            data[ftype, f"vorticity_{ax}"] * data[ftype, f"vorticity_growth_{ax}"]
        ).to_ndarray()
    result = np.sign(dot) * result
    return result

(‘gas’, ‘vorticity_growth_magnitude_absolute’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_growth_magnitude_absolute(field, data):
    return np.sqrt(
        data[ftype, "vorticity_growth_x"] ** 2
        + data[ftype, "vorticity_growth_y"] ** 2
        + data[ftype, "vorticity_growth_z"] ** 2
    )

(‘gas’, ‘vorticity_growth_timescale’)

  • Units: \(\rm{s}\)

  • Sampling Method: cell

Field Source

def _vorticity_growth_timescale(field, data):
    domegax_dt = data[ftype, "vorticity_x"] / data[ftype, "vorticity_growth_x"]
    domegay_dt = data[ftype, "vorticity_y"] / data[ftype, "vorticity_growth_y"]
    domegaz_dt = data[ftype, "vorticity_z"] / data[ftype, "vorticity_growth_z"]
    return np.sqrt(domegax_dt ** 2 + domegay_dt ** 2 + domegaz_dt ** 2)

(‘gas’, ‘vorticity_growth_x’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_growth_x(field, data):
    return (
        -data[ftype, "vorticity_stretching_x"]
        - data[ftype, "baroclinic_vorticity_x"]
    )

(‘gas’, ‘vorticity_growth_y’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_growth_y(field, data):
    return (
        -data[ftype, "vorticity_stretching_y"]
        - data[ftype, "baroclinic_vorticity_y"]
    )

(‘gas’, ‘vorticity_growth_z’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_growth_z(field, data):
    return (
        -data[ftype, "vorticity_stretching_z"]
        - data[ftype, "baroclinic_vorticity_z"]
    )

(‘gas’, ‘vorticity_magnitude’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘vorticity_radiation_pressure_growth_magnitude’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_growth_magnitude(field, data):
    result = np.sqrt(
        data[ftype, "vorticity_radiation_pressure_growth_x"] ** 2
        + data[ftype, "vorticity_radiation_pressure_growth_y"] ** 2
        + data[ftype, "vorticity_radiation_pressure_growth_z"] ** 2
    )
    dot = data.ds.arr(np.zeros(result.shape), "")
    for ax in "xyz":
        dot += (
            data[ftype, f"vorticity_{ax}"] * data[ftype, f"vorticity_growth_{ax}"]
        ).to_ndarray()
    result = np.sign(dot) * result
    return result

(‘gas’, ‘vorticity_radiation_pressure_growth_magnitude_absolute’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_growth_magnitude_absolute(field, data):
    return np.sqrt(
        data[ftype, "vorticity_radiation_pressure_growth_x"] ** 2
        + data[ftype, "vorticity_radiation_pressure_growth_y"] ** 2
        + data[ftype, "vorticity_radiation_pressure_growth_z"] ** 2
    )

(‘gas’, ‘vorticity_radiation_pressure_growth_timescale’)

  • Units: \(\rm{s}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_growth_timescale(field, data):
    domegax_dt = (
        data[ftype, "vorticity_x"]
        / data[ftype, "vorticity_radiation_pressure_growth_x"]
    )
    domegay_dt = (
        data[ftype, "vorticity_y"]
        / data[ftype, "vorticity_radiation_pressure_growth_y"]
    )
    domegaz_dt = (
        data[ftype, "vorticity_z"]
        / data[ftype, "vorticity_radiation_pressure_growth_z"]
    )
    return np.sqrt(domegax_dt ** 2 + domegay_dt ** 2 + domegaz_dt ** 2)

(‘gas’, ‘vorticity_radiation_pressure_growth_x’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_growth_x(field, data):
    return (
        -data[ftype, "vorticity_stretching_x"]
        - data[ftype, "baroclinic_vorticity_x"]
        - data[ftype, "vorticity_radiation_pressure_x"]
    )

(‘gas’, ‘vorticity_radiation_pressure_growth_y’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_growth_y(field, data):
    return (
        -data[ftype, "vorticity_stretching_y"]
        - data[ftype, "baroclinic_vorticity_y"]
        - data[ftype, "vorticity_radiation_pressure_y"]
    )

(‘gas’, ‘vorticity_radiation_pressure_growth_z’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_growth_z(field, data):
    return (
        -data[ftype, "vorticity_stretching_z"]
        - data[ftype, "baroclinic_vorticity_z"]
        - data[ftype, "vorticity_radiation_pressure_z"]
    )

(‘gas’, ‘vorticity_radiation_pressure_magnitude’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘vorticity_radiation_pressure_x’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_x(field, data):
    rho = data[ftype, "density"].astype(np.float64)
    return (
        data[ftype, "radiation_acceleration_y"] * data[ftype, "density_gradient_z"]
        - data[ftype, "radiation_acceleration_z"]
        * data[ftype, "density_gradient_y"]
    ) / rho

(‘gas’, ‘vorticity_radiation_pressure_y’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_y(field, data):
    rho = data[ftype, "density"].astype(np.float64)
    return (
        data[ftype, "radiation_acceleration_z"] * data[ftype, "density_gradient_x"]
        - data[ftype, "radiation_acceleration_x"]
        * data[ftype, "density_gradient_z"]
    ) / rho

(‘gas’, ‘vorticity_radiation_pressure_z’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_radiation_pressure_z(field, data):
    rho = data[ftype, "density"].astype(np.float64)
    return (
        data[ftype, "radiation_acceleration_x"] * data[ftype, "density_gradient_y"]
        - data[ftype, "radiation_acceleration_y"]
        * data[ftype, "density_gradient_x"]
    ) / rho

(‘gas’, ‘vorticity_squared’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def _squared(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    squared = data[fn] * data[fn]
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        squared += data[fn] * data[fn]
    return squared

(‘gas’, ‘vorticity_stretching_magnitude’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: local

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘gas’, ‘vorticity_stretching_x’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_stretching_x(field, data):
    return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_x"]

(‘gas’, ‘vorticity_stretching_y’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_stretching_y(field, data):
    return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_y"]

(‘gas’, ‘vorticity_stretching_z’)

  • Units: \(\frac{1}{\rm{s}^{2}}\)

  • Sampling Method: cell

Field Source

def _vorticity_stretching_z(field, data):
    return data[ftype, "velocity_divergence"] * data[ftype, "vorticity_z"]

(‘gas’, ‘vorticity_x’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: cell

Field Source

def _vorticity_x(field, data):
    vz = data[ftype, "relative_velocity_z"]
    vy = data[ftype, "relative_velocity_y"]
    f = (vz[sl_center, sl_right, sl_center] - vz[sl_center, sl_left, sl_center]) / (
        div_fac * just_one(data["index", "dy"])
    )
    f -= (
        vy[sl_center, sl_center, sl_right] - vy[sl_center, sl_center, sl_left]
    ) / (div_fac * just_one(data["index", "dz"]))
    new_field = data.ds.arr(np.zeros_like(vz, dtype=np.float64), f.units)
    new_field[sl_center, sl_center, sl_center] = f
    return new_field

(‘gas’, ‘vorticity_y’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: cell

Field Source

def _vorticity_y(field, data):
    vx = data[ftype, "relative_velocity_x"]
    vz = data[ftype, "relative_velocity_z"]
    f = (vx[sl_center, sl_center, sl_right] - vx[sl_center, sl_center, sl_left]) / (
        div_fac * just_one(data["index", "dz"])
    )
    f -= (
        vz[sl_right, sl_center, sl_center] - vz[sl_left, sl_center, sl_center]
    ) / (div_fac * just_one(data["index", "dx"]))
    new_field = data.ds.arr(np.zeros_like(vz, dtype=np.float64), f.units)
    new_field[sl_center, sl_center, sl_center] = f
    return new_field

(‘gas’, ‘vorticity_z’)

  • Units: \(1 / \rm{s}\)

  • Sampling Method: cell

Field Source

def _vorticity_z(field, data):
    vx = data[ftype, "relative_velocity_x"]
    vy = data[ftype, "relative_velocity_y"]
    f = (vy[sl_right, sl_center, sl_center] - vy[sl_left, sl_center, sl_center]) / (
        div_fac * just_one(data["index", "dx"])
    )
    f -= (
        vx[sl_center, sl_right, sl_center] - vx[sl_center, sl_left, sl_center]
    ) / (div_fac * just_one(data["index", "dy"]))
    new_field = data.ds.arr(np.zeros_like(vy, dtype=np.float64), f.units)
    new_field[sl_center, sl_center, sl_center] = f
    return new_field

(‘gas’, ‘weak_lensing_convergence’)

  • Units: \(1 / \rm{cm}\)

  • Sampling Method: local

Field Source

def _weak_lensing_convergence(field, data):
    if (
        not hasattr(data.ds, "cosmological_simulation")
        or not data.ds.cosmological_simulation
    ):
        raise NeedsConfiguration("cosmological_simulation", 1)
    co = data.ds.cosmology
    pc = data.ds.units.physical_constants
    observer_redshift = data.get_field_parameter("observer_redshift")
    source_redshift = data.get_field_parameter("source_redshift")

    # observer to lens
    dl = co.angular_diameter_distance(observer_redshift, data.ds.current_redshift)
    # observer to source
    ds = co.angular_diameter_distance(observer_redshift, source_redshift)
    # lens to source
    dls = co.angular_diameter_distance(data.ds.current_redshift, source_redshift)

    # removed the factor of 1 / a to account for the fact that we are projecting
    # with a proper distance.
    return (
        1.5
        * (co.hubble_constant / pc.clight) ** 2
        * (dl * dls / ds)
        * data[ftype, "matter_overdensity"]
    ).in_units("1/cm")

(‘gas’, ‘x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘gas’, ‘z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘index’, ‘cell_volume’)

  • Units: \(\rm{code~length}^{3}\)

  • Sampling Method: cell

Field Source

def _cell_volume(field, data):
    rv = data["index", "dx"].copy(order="K")
    rv *= data["index", "dy"]
    rv *= data["index", "dz"]
    return rv

(‘index’, ‘cylindrical_r’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘index’, ‘cylindrical_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _cylindrical_radius(field, data):
    """The cylindrical radius component of the positions of the mesh cells.

    Relative to the coordinate system defined by the *normal* vector and
    *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    coords = get_periodic_rvec(data)
    return data.ds.arr(get_cyl_r(coords, normal), "code_length").in_base(
        unit_system.name
    )

(‘index’, ‘cylindrical_theta’)

  • Sampling Method: cell

Field Source

def _cylindrical_theta(field, data):
    """The cylindrical z component of the positions of the mesh cells.

    theta is the azimuthal position angle in the plane perpendicular to the
    *normal* vector.

    Relative to the coordinate system defined by the *normal* vector and
    *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    coords = get_periodic_rvec(data)
    return get_cyl_theta(coords, normal)

(‘index’, ‘cylindrical_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _cylindrical_z(field, data):
    """The cylindrical z component of the positions of the mesh cells.

    Relative to the coordinate system defined by the *normal* vector and
    *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    coords = get_periodic_rvec(data)
    return data.ds.arr(get_cyl_z(coords, normal), "code_length").in_base(
        unit_system.name
    )

(‘index’, ‘disk_angle’)

  • Sampling Method: cell

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘index’, ‘dx’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: cell

Field Source

def _dds(field, data):
    rv = data.ds.arr(data.fwidth[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘dy’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: cell

Field Source

def _dds(field, data):
    rv = data.ds.arr(data.fwidth[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘dz’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: cell

Field Source

def _dds(field, data):
    rv = data.ds.arr(data.fwidth[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘grid_indices’)

  • Sampling Method: cell

Field Source

def _grid_indices(field, data):
    """The index of the leaf grid the mesh cells exist on"""
    if hasattr(data, "domain_id"):
        this_id = data.domain_id
    else:
        this_id = data.id - data._id_offset
    arr = np.ones(data["index", "ones"].shape)
    arr *= this_id
    if data._spatial:
        return data._reshape_vals(arr)
    return arr

(‘index’, ‘grid_level’)

  • Sampling Method: cell

Field Source

def _grid_level(field, data):
    """The AMR refinement level"""
    arr = np.ones(data.ires.shape, dtype="float64")
    arr *= data.ires
    if data._spatial:
        return data._reshape_vals(arr)
    return arr

(‘index’, ‘height’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘index’, ‘morton_index’)

  • Sampling Method: cell

Field Source

def _morton_index(field, data):
    """This is the morton index, which is properly a uint64 field.  Because
    we make some assumptions that the fields returned by derived fields are
    float64, this returns a "view" on the data that is float64.  To get
    back the original uint64, you need to call .view("uint64") on it;
    however, it should be true that if you sort the uint64, you will get
    the same order as if you sort the float64 view.
    """
    eps = np.finfo("f8").eps
    uq = data.ds.domain_left_edge.uq
    LE = data.ds.domain_left_edge - eps * uq
    RE = data.ds.domain_right_edge + eps * uq
    # .ravel() only copies if it needs to
    morton = compute_morton(
        data["index", "x"].ravel(),
        data["index", "y"].ravel(),
        data["index", "z"].ravel(),
        LE,
        RE,
    )
    morton.shape = data["index", "x"].shape
    return morton.view("f8")

(‘index’, ‘ones’)

  • Sampling Method: cell

Field Source

def _ones(field, data):
    """Returns one for all cells"""
    tmp = np.ones(data.ires.shape, dtype="float64")
    arr = data.apply_units(tmp, field.units)
    if data._spatial:
        return data._reshape_vals(arr)
    return arr

(‘index’, ‘ones_over_dx’)

  • Units: \(1 / \rm{cm}\)

  • Sampling Method: cell

Field Source

def _ones_over_dx(field, data):
    """The inverse of the local cell spacing"""
    return (
        np.ones(data["index", "ones"].shape, dtype="float64") / data["index", "dx"]
    )

(‘index’, ‘path_element_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _dds(field, data):
    rv = data.ds.arr(data.fwidth[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘path_element_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _dds(field, data):
    rv = data.ds.arr(data.fwidth[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘path_element_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _dds(field, data):
    rv = data.ds.arr(data.fwidth[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _radius(field, data):
    """The spherical radius component of the mesh cells.

    Relative to the coordinate system defined by the *center* field
    parameter.
    """
    return get_radius(data, "", field.name[0])

(‘index’, ‘spherical_phi’)

  • Sampling Method: cell

Field Source

def _spherical_phi(field, data):
    """The spherical phi component of the positions of the mesh cells.

    phi is the azimuthal position angle in the plane perpendicular to the
    *normal* vector

    Relative to the coordinate system defined by the *center* and *normal*
    field parameters.
    """
    normal = data.get_field_parameter("normal")
    coords = get_periodic_rvec(data)
    return get_sph_phi(coords, normal)

(‘index’, ‘spherical_r’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘index’, ‘spherical_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _spherical_radius(field, data):
    """The spherical radius component of the positions of the mesh cells.

    Relative to the coordinate system defined by the *center* field
    parameter.
    """
    coords = get_periodic_rvec(data)
    return data.ds.arr(get_sph_r(coords), "code_length").in_base(unit_system.name)

(‘index’, ‘spherical_theta’)

  • Sampling Method: cell

Field Source

def _spherical_theta(field, data):
    """The spherical theta component of the positions of the mesh cells.

    theta is the poloidal position angle in the plane parallel to the
    *normal* vector

    Relative to the coordinate system defined by the *center* and *normal*
    field parameters.
    """
    normal = data.get_field_parameter("normal")
    coords = get_periodic_rvec(data)
    return get_sph_theta(coords, normal)

(‘index’, ‘vertex_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _vert(field, data):
    rv = data.ds.arr(data.fcoords_vertex[..., axi].copy(), units)
    return rv

(‘index’, ‘vertex_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _vert(field, data):
    rv = data.ds.arr(data.fcoords_vertex[..., axi].copy(), units)
    return rv

(‘index’, ‘vertex_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: cell

Field Source

def _vert(field, data):
    rv = data.ds.arr(data.fcoords_vertex[..., axi].copy(), units)
    return rv

(‘index’, ‘virial_radius_fraction’)

  • Sampling Method: local

Field Source

def _virial_radius_fraction(field, data):
    virial_radius = data.get_field_parameter("virial_radius")
    if virial_radius == 0.0:
        ret = 0.0
    else:
        ret = data[("index", "radius")] / virial_radius
    return ret

(‘index’, ‘volume’)

  • Units: \(\rm{cm}^{3}\)

  • Sampling Method: cell

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘index’, ‘x’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: cell

Field Source

def _coords(field, data):
    rv = data.ds.arr(data.fcoords[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘y’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: cell

Field Source

def _coords(field, data):
    rv = data.ds.arr(data.fcoords[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘z’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: cell

Field Source

def _coords(field, data):
    rv = data.ds.arr(data.fcoords[..., axi].copy(), units)
    return data._reshape_vals(rv)

(‘index’, ‘zeros’)

  • Sampling Method: cell

Field Source

def _zeros(field, data):
    """Returns zero for all cells"""
    arr = np.zeros(data["index", "ones"].shape, dtype="float64")
    return data.apply_units(arr, field.units)

(‘io’, ‘mesh_id’)

  • Sampling Method: particle

Field Source

def particle_mesh_ids(field, data):
    pos = data[ptype, coord_name]
    ids = np.zeros(pos.shape[0], dtype="float64") - 1
    # This is float64 in name only.  It will be properly cast inside the
    # deposit operation.
    # _ids = ids.view("float64")
    data.deposit(pos, [ids], method="mesh_id")
    return data.apply_units(ids, "")

(‘io’, ‘particle_angular_momentum’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum(field, data):
    am = (
        data[ptype, "particle_mass"]
        * data[ptype, "particle_specific_angular_momentum"].T
    )
    return am.T

(‘io’, ‘particle_angular_momentum_magnitude’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _magnitude(field, data):
    fn = field_components[0]
    if data.has_field_parameter(f"bulk_{basename}"):
        fn = (fn[0], f"relative_{fn[1]}")
    d = data[fn]
    mag = (d) ** 2
    for idim in range(1, registry.ds.dimensionality):
        fn = field_components[idim]
        if data.has_field_parameter(f"bulk_{basename}"):
            fn = (fn[0], f"relative_{fn[1]}")
        mag += (data[fn]) ** 2
    return np.sqrt(mag)

(‘io’, ‘particle_angular_momentum_x’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum_component(field, data):
    return (
        data[_ptype, "particle_mass"]
        * data[ptype, f"particle_specific_angular_momentum_{ax}"]
    )

(‘io’, ‘particle_angular_momentum_y’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum_component(field, data):
    return (
        data[_ptype, "particle_mass"]
        * data[ptype, f"particle_specific_angular_momentum_{ax}"]
    )

(‘io’, ‘particle_angular_momentum_z’)

  • Units: \(\rm{cm}^{2} \cdot \rm{g} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_angular_momentum_component(field, data):
    return (
        data[_ptype, "particle_mass"]
        * data[ptype, f"particle_specific_angular_momentum_{ax}"]
    )

(‘io’, ‘particle_cylindrical_velocity_theta’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘io’, ‘particle_cylindrical_velocity_z’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _DeprecatedFieldFunc(field, data):
    # Only log a warning if we've already done
    # field detection
    if data.ds.fields_detected:
        args = [field.name, since, removal]
        msg = (
            "The Derived Field %s is deprecated as of yt v%s "
            "and will be removed in yt v%s. "
        )
        if ret_field != field.name:
            msg += "Use %s instead."
            args.append(ret_field)
        mylog.warning(msg, *args)
    return func(field, data)

(‘io’, ‘particle_mass’)

  • Units: \(\rm{g}\)

  • Sampling Method: particle

Field Source

No source available.

(‘io’, ‘particle_ones’)

  • Sampling Method: particle

Field Source

def particle_ones(field, data):
    v = np.ones(data[ptype, coord_name].shape[0], dtype="float64")
    return data.apply_units(v, field.units)

(‘io’, ‘particle_position’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

def particle_vectors(field, data):
    v = [data[_ptype, name].in_units(field.units) for name in names]
    return data.ds.arr(np.column_stack(v), v[0].units)

(‘io’, ‘particle_position_cylindrical_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_position_cylindrical_radius(field, data):
    """The cylindrical radius component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    pos.convert_to_units("code_length")
    return data.ds.arr(get_cyl_r(pos, normal), "code_length")

(‘io’, ‘particle_position_cylindrical_theta’)

  • Sampling Method: particle

Field Source

def _particle_position_cylindrical_theta(field, data):
    """The cylindrical theta component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    return data.ds.arr(get_cyl_theta(pos, normal), "")

(‘io’, ‘particle_position_cylindrical_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_position_cylindrical_z(field, data):
    """The cylindrical z component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    pos.convert_to_units("code_length")
    return data.ds.arr(get_cyl_z(pos, normal), "code_length")

(‘io’, ‘particle_position_relative_x’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘io’, ‘particle_position_relative_y’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘io’, ‘particle_position_relative_z’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_pos_rel(field, data):
    return data[_ptype, "relative_particle_position"][:, axi]

(‘io’, ‘particle_position_spherical_phi’)

  • Sampling Method: particle

Field Source

def _particle_position_spherical_phi(field, data):
    """The spherical phi component of the particle positions

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    return data.ds.arr(get_sph_phi(pos, normal), "")

(‘io’, ‘particle_position_spherical_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_radius(field, data):
    """The spherical radius component of the particle positions

    Relative to the coordinate system defined by the *normal* vector,
    and *center* field parameters.
    """
    return get_radius(data, "particle_position_", field.name[0])

(‘io’, ‘particle_position_spherical_theta’)

  • Sampling Method: particle

Field Source

def _particle_position_spherical_theta(field, data):
    """The spherical theta coordinate of the particle positions.

    Relative to the coordinate system defined by the *normal* vector
    and *center* field parameters.
    """
    normal = data.get_field_parameter("normal")
    pos = data[(ptype, "relative_particle_position")].T
    return data.ds.arr(get_sph_theta(pos, normal), "")

(‘io’, ‘particle_position_x’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

No source available.

(‘io’, ‘particle_position_y’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

No source available.

(‘io’, ‘particle_position_z’)

  • Units: \(\rm{code~length}\)

  • Sampling Method: particle

Field Source

No source available.

(‘io’, ‘particle_radial_velocity’)

  • Units: \(\rm{cm} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _TranslationFunc(field, data):
    # We do a bunch of in-place modifications, so we will copy this.
    return data[field_name].copy()

(‘io’, ‘particle_radius’)

  • Units: \(\rm{cm}\)

  • Sampling Method: particle

Field Source

def _particle_radius(field, data):
    """The spherical radius component of the particle positions

    Relative to the coordinate system defined by the *normal* vector,
    and *center* field parameters.
    """
    return get_radius(data, "particle_position_", field.name[0])

(‘io’, ‘particle_specific_angular_momentum’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_specific_angular_momentum(field, data):
    """Calculate the angular of a particle velocity.

    Returns a vector for each particle.
    """
    center = data.get_field_parameter("center")
    pos, vel, normal = get_angular_momentum_components(ptype, data, spos, svel)
    L, r_vec, v_vec = modify_reference_frame(center, normal, P=pos, V=vel)
    # adding in the unit registry allows us to have a reference to the
    # dataset and thus we will always get the correct units after applying
    # the cross product.
    return ucross(r_vec, v_vec, registry=data.ds.unit_registry)

(‘io’, ‘particle_specific_angular_momentum_x’)

  • Units: \(\rm{cm}^{2} / \rm{s}\)

  • Sampling Method: particle

Field Source

def _particle_specific_angular_momentum_component(field, data):
    return data[_ptype, "particle_specific_angular_momentum"][:, axi]

(‘io’, ‘particle_specific_angular_momentum_y’)