yt.fields.derived_field.DerivedField

class yt.fields.derived_field.DerivedField(name, function, units=None, take_log=True, validators=None, particle_type=False, vector_field=False, display_field=True, not_in_all=False, display_name=None, output_units=None)[source]

This is the base class used to describe a cell-by-cell derived field.

Parameters:

name : str

is the name of the field.

function : callable

A function handle that defines the field. Should accept arguments (field, data)

units : str

A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the units of the return value of the field function.

take_log : bool

Describes whether the field should be logged

validators : list

A list of FieldValidator objects

particle_type : bool

Is this a particle (1D) field?

vector_field : bool

Describes the dimensionality of the field. Currently unused.

display_field : bool

Governs its appearance in the dropdowns in Reason

not_in_all : bool

Used for baryon fields from the data that are not in all the grids

display_name : str

A name used in the plots

output_units : str

For fields that exist on disk, which we may want to convert to other fields or that get aliased to themselves, we can specify a different desired output unit than the unit found on disk.

Methods