tracmass.ParticleState#
- class tracmass.ParticleState(x, y, z, ia, ja, ka, tt, ts, t0, subvol, niter, active, reason)[source]#
Bases:
NamedTupleState vector for all particles — each field is shape (n,).
- Parameters:
- __init__()#
Methods
__init__()concat(*states)Join particle states end to end.
count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
Attributes
Alias for field number 11
Alias for field number 3
Alias for field number 4
Alias for field number 5
Alias for field number 10
Alias for field number 12
Alias for field number 9
Alias for field number 8
Alias for field number 7
Alias for field number 6
Alias for field number 0
Alias for field number 1
Alias for field number 2
- classmethod concat(*states)[source]#
Join particle states end to end.
Particles keep their order, so the particles of the first state keep their indices (the
idwritten byParticleRecorder) and those of later states get new ones after them.- Parameters:
*states (
ParticleState) – States to join, in order.- Returns:
ParticleState– NumPy arrays if every input field is a NumPy array (e.g. the host-side state of a batched run), JAX arrays otherwise.- Return type:
Examples
>>> both = ParticleState.concat(state, new_particles) >>> len(both.x) == len(state.x) + len(new_particles.x) True