-
Notifications
You must be signed in to change notification settings - Fork 0
Particle Documentation
This is a class that keeps track of a particle's position and velocity along timesteps.
- Source Code:
/lib/Particle.py - Examples:
/lib/tests/
(aka variables that each object has stored in it)
-
id(int): the particle ID from the rockstar output -
mass(float): the mass of the particle in Solar Masses -
x,y,z(listoffloat): particle positions at each timestep in Mpc/h -
vx,vy,vz(listoffloat): particle velocities at each timestep in kpc/s -
energy(listoffloat): the energy of the particle at each timestep in units of Msun * (kpc)^2/s^2. * -
bound_rank(listofint): ranking of the boundedness of the particle wrt the other particles in the halo. * -
parent_ids(listofint): list of the halo id of the parent halo
* neither the energy nor the ranking is immediately calculated. Energy defaults to -np.inf and boundedness defaults to -1. To calculate the energy and boundedness of the particle run get_energy (documentation below) and rank_particle_boundedness (documentation in the Halo class).
Default constructor.
None
a new, empty particle object
Full Constructor for a Particle.
-
xi,yi,zi,vxi,vyi,vzi(float): positions and velocities of the particle at timethis_index -
this_index(int, optional): time index for which the position and velocities occur -
num_timesteps(int, optional): number of timesteps available for the particle -
mass(float,optional): mass of the particle. If you want to calculate the energy of the particle, this must be set -
id(int, optional): id of the particle, defaults to -1
Fully initialized particle object.
gets the energy of a particle at a certain timestep
-
timestep(int): the timestep at which to calculate the energy of the particle -
particle_field(listofParticle): list of particles which are contained in the halo -
halo_v(tuple): 3-velocity of the halo
inserts position and velocity information at a certain timestep
-
x,y,z(float): particle positions at timestep in Mpc/h -
vx,vy,vz(float): particle velocities at timestep in kpc/s -
timestep(int): timestep at which to input these positions and velocities -
parent_halo(int, optional): the parent halo that the particle belongs to at this timestep (updates themember_ofinstance variable)
No return value, will update the x, y, z, vx, vy, vz instance variables appropriately
saves the particle to a file which can be later opened
-
pdir(str, optional): desired output particle directory
saves a file of the name "p_{p.id}.npy" to the input directory
loads a saved particle
-
name(str): the path+name of the file you wish to load
Particle object with the same instance variables as the loaded object