MockStreamGenerator#
- class gala.dynamics.mockstream.MockStreamGenerator(df, hamiltonian, progenitor_potential=None)[source]#
Bases:
objectGenerate 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 aHamiltonianobject passed in through thehamiltonianargument).Also by default, the stream generation does not include the self-gravity of the progenitor system: star particles are generated using the
dfobject, 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_potentialargument. This can be any valid gala potential instance.- Parameters:
- df
BaseStreamDFsubclass 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, Integrator=None, Integrator_kwargs=None, **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_w0and by specifying time-stepping information via the**time_speckeyword arguments. If the time-stepping specification proceeds forward in time,prog_w0is 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_w0becomes 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
DirectNBodyinstance through thenbodyargument. 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.
- Integrator
Integrator,str(optional) Integrator class to use, or a string name like ‘leapfrog’, ‘dopri853’. Currently, only the
DOPRI853IntegratorandLeapfrogIntegratorare supported.- Integrator_kwargs
dict(optional) Any extra keyword arguments to pass to the integrator class when initializing. For example, you can pass in the
atolandrtolkeyword arguments to set the absolute and relative tolerances for the DOPRI853 integrator.- **time_spec
Specification of how long to integrate. Most commonly, this is a timestep
dtand 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_specificationfor more information.
- prog_w0
- Returns:
- stream_w
PhaseSpacePosition - nbody_w
PhaseSpacePosition
- stream_w