yt.data_objects.static_output.Dataset.add_field

Dataset.add_field(name, function=None, **kwargs)

Dataset-specific call to add_field

Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for DerivedField.

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 ^).
  • 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_name (str) – A name used in the plots