yt.fields.magnetic_field module

Magnetic field ... er, fields.

yt.fields.magnetic_field.setup_magnetic_field_aliases(registry, ds_ftype, ds_fields, ftype='gas')[source]

This routine sets up special aliases between dataset-specific magnetic fields and the default magnetic fields in yt so that unit conversions between different unit systems can be handled properly. This is only called from the setup_fluid_fields method of a frontend’s FieldInfoContainer instance.

  • registry (FieldInfoContainer) – The field registry that these definitions will be installed into.
  • ds_ftype (string) – The field type for the fields we’re going to alias, e.g. “flash”, “enzo”, “athena”, etc.
  • ds_fields (list of strings) – The fields that will be aliased.
  • ftype (string, optional) – The resulting field type of the fields. Default “gas”.


>>> class PlutoFieldInfo(ChomboFieldInfo):
...     def setup_fluid_fields(self):
...         from yt.fields.magnetic_field import \
...             setup_magnetic_field_aliases
...         setup_magnetic_field_aliases(self, "chombo", ["bx%s" % ax for ax in [1,2,3]])
yt.fields.magnetic_field.setup_magnetic_field_fields(registry, ftype='gas', slice_info=None)[source]