pynbody.family.Family#
- class pynbody.family.Family(name, aliases=[])[source]#
Bases:
object
The class representing an abstract family of particles.
Once a
Family
is defined, it is automatically registered and can be used withinSimSnap
objects. For example,>>> import pynbody >>> tachs = pynbody.family.Family("tachyon", aliases=["t", "tachyons"]) >>> f = pynbody.new(dm=100, tachyon=100) >>> f.tachyon['pos'] # <-- get the tachyon positions >>> f.t['pos'] # <-- use an alias to get the tachyon positions >>> f[tachs]['pos'] # <-- another way to get the tachyon positions
- __init__(name, aliases=[])[source]#
Create a new family with the specified name and aliases.
- Parameters:
name (str) – The name of the family. Must be lower case and unique.
aliases (list of str) – A list of aliases for the family. Must be lower case. These can be used interchangeably with the family name.