pynbody.halo.DummyHalo#
- class pynbody.halo.DummyHalo[source]#
Bases:
ContainerWithPhysicalUnitsOptionMethods
physical_units(*args, **kwargs)Converts all arrays' units to be consistent with the distance, velocity, mass basis units specified.
- physical_units(*args, **kwargs)[source]#
Converts all arrays’ units to be consistent with the distance, velocity, mass basis units specified.
- Parameters:
distance (string (default = 'kpc')) – The distance unit to convert to.
velocity (string (default = 'km s^-1')) – The velocity unit to convert to.
mass (string (default = 'Msol')) – The mass unit to convert to.
persistent (boolean (default = True)) – Apply units change to future lazy-loaded arrays if True.
convert_parent (boolean (default = True)) – Propagate units change from a halo catalogue to a parent snapshot. See note below.
Note
The option convert_parent is only applicable to
Haloobjects. It is ignored by all other objects, includingpynbody.snapshot.simsnap.SimSnap,pynbody.snapshot.subsnap.SubSnap, andpynbody.halo.HaloCatalogueobjects.When
physical_unitsis called on apynbody.halo.Haloand convert_parent is True, no immediate action is taken on thepynbody.halo.Haloitself; rather the request is passed upwards to thepynbody.halo.HaloCatalogue.The catalogue object then calls
physical_unitson the parent snapshot and on all cached halos, settingconvert_parent=Falseso that the units change is then applied to thepynbody.halo.Haloobject itself.This ensures that unit changes propagate through to properties of all halos. Most users will not need to worry about this subtlety; things should ‘just work’ if you ignore the convert_parent option.