MockStreamGenerator#
- class gala.dynamics.mockstream.MockStreamGenerator(df, hamiltonian, progenitor_potential=None)[source]#
Bases:
object
Generate a mock stellar stream in the specified external potential.
By default, you must pass in a specification of the stream distribution function (
df
), and the external gravitational potential and reference frame (via aHamiltonian
object passed in through thehamiltonian
argument).Also by default, the stream generation does not include the self-gravity of the progenitor system: star particles are generated using the
df
object, and released into the external potential specified by thehamiltonian
. If you would like the star particles to feel the gravitational field of the progenitor system, you may pass in a potential object to represent the progenitor via theprogenitor_potential
argument. This can be any valid gala potential instance.- Parameters:
- df
BaseStreamDF
subclass instance The stream distribution function (DF) object that specifies how to generate stream star particle initial conditions.
- hamiltonian
Hamiltonian
The external potential and reference frame to numerically integrate orbits in.
- progenitor_potential
PotentialBase
(optional) If specified, the self-gravity of the progenitor system is included in the force calculation and orbit integration. If not specified, self-gravity is not accounted for. Default:
None
- df
Methods Summary
run
(prog_w0, prog_mass[, nbody, ...])Run the mock stream generator with the specified progenitor initial conditions.
Methods Documentation
- run(prog_w0, prog_mass, nbody=None, release_every=1, n_particles=1, output_every=None, output_filename=None, check_filesize=True, overwrite=False, progress=False, **time_spec)[source]#
Run the mock stream generator with the specified progenitor initial conditions.
This method generates the mock stellar stream for the specified progenitor system properties. The progenitor orbit is specified by passing in the initial or final conditions
prog_w0
and by specifying time-stepping information via the**time_spec
keyword arguments. If the time-stepping specification proceeds forward in time,prog_w0
is interpreted as initial conditions and the mock stream is generated forwards from this position. If the time-stepping proceeds backwards in time, the progenitor orbit is first numerically integrated backwards given the time-stepping information, then the stream is generated forward from the past such thatprog_w0
becomes the final position of the progenitor.Note that the stream generation also supports including other massive perturbers that can gravitationally influence the stream stars. These other massive bodies must be passed in as a
DirectNBody
instance through thenbody
argument. The phase-space coordinates of the bodies,nbody.w0
, are interpreted as initial or final conditions with the same logic as above.- Parameters:
- prog_w0
PhaseSpacePosition
The initial or final phase-space position of the progenitor system (see note above).
- prog_mass
Quantity
[mass
] The mass of the progenitor system, passed in to the stream distribution function (df)
.sample()
method. This quantity sets the scale mass of the particle release df, but not the mass of the progenitor potential used to compute the self-gravity on the stream particles.- nbody
DirectNBody
(optional) This allows specifying other massive perturbers (N-bodies) that can gravitationally influence the stream star orbits.
- release_every
int
(optional) Controls how often to release stream particles from each tail. Default: 1, meaning release particles at each timestep.
- n_particles
int
, array_like (optional) If an integer, this controls the number of particles to release in each tail at each release timestep. Alternatively, you can pass in an array with the same shape as the number of timesteps to release bursts of particles at certain times (e.g., pericenter).
- output_every
int
(optional) Controls whether to output snapshots of the stream particle orbits. This is relative to the global time array.
- output_filename
str
(optional) The path to the HDF5 file to be generated by the snapshotting.
- check_filesizebool (optional)
If True (the default value), this controls whether to check the estimated size of the output file, and emits a warning if the file is >8GB in size.
- overwritebool (optional)
Overwrite the output file if it exists.
- progressbool (optional)
Print a very basic progress bar while computing the stream.
- **time_spec
Specification of how long to integrate. Most commonly, this is a timestep
dt
and number of stepsn_steps
, or a timestepdt
, initial timet1
, and final timet2
. You may also pass in a time array witht
. See documentation forparse_time_specification
for more information.
- prog_w0
- Returns:
- stream_w
PhaseSpacePosition
- nbody_w
PhaseSpacePosition
- stream_w