pynbody.family.Family#
- class pynbody.family.Family(name, aliases=[])[source]#
Bases:
objectThe class representing an abstract family of particles.
Once a
Familyis defined, it is automatically registered and can be used withinSimSnapobjects. For example,>>> import pynbody >>> tachs = pynbody.family.Family("tachyon", aliases=["t", "tachyons"]) >>> snap = pynbody.new(dm=100, tachyon=100) >>> snap.tachyon['pos'] # <-- get the tachyon positions >>> snap.t['pos'] # <-- use an alias to get the tachyon positions >>> snap[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.