VectorialModel¶
- class sbpy.activity.VectorialModel(base_q, parent, fragment, q_t=None, radial_points=50, radial_substeps=12, angular_points=30, angular_substeps=7, parent_destruction_level=0.99, fragment_destruction_level=0.95, max_fragment_lifetimes=8.0, print_progress=False)[source]¶
Bases:
GasComa
- Vectorial model for fragments in a coma produced
with a dissociative energy kick
- Parameters:
- base_q
Quantity
Base production rate, per time
- parent: `~sbpy.data.Phys`
- Object with the following physical property fields:
tau_T
: total lifetime of the parent moleculetau_d
: photodissociative lifetime of the parent moleculev_outflow
: outflow velocity of the parent moleculesigma
: cross-sectional area of the parent molecule
- fragment: `~sbpy.data.Phys`
- Object with the following physical property fields:
tau_T
: total lifetime of the fragment moleculev_photo
: velocity of fragment resulting fromphotodissociation of the parent
- q_t: callable, optional
Calculates the parent production rate as a function of time:
q_t(t)
. The argumentt
is the look-back time as a float in units of seconds. The return value is the production rate in units of inverse seconds. If provided, this value is added tobase_q
.If no time-dependence function is given, the model will run with steady production at
base_q
stretching infinitely far into the past.- radial_points: int, optional
Number of radial grid points the model will use
- radial_substeps: int, optional
Number of points along the contributing axis to integrate over
- angular_points: int, optional
Number of angular grid points the model will use
- angular_substeps: int, optional
Number of angular steps per radial substep to integrate over
- parent_destruction_level: float, optional
Model will attempt to track parents until this percentage has dissociated
- fragment_destruction_level: float, optional
Model will attempt to track fragments until this percentage has dissociated
- max_fragment_lifetimes: float, optional
Fragments traveling through the coma will be ignored if they take longer than this to arrive and contribute to the density at any considered point
- print_progress: bool, optional
Print progress percentage while calculating
- References:
The density distribution of neutral compounds in cometary atmospheres. I - Models and equations, Festou, M. C. 1981, Astronomy and Astrophysics, vol. 95, no. 1, Feb. 1981, p. 69-79.
- base_q
Methods Summary
binned_production
(qs, fragment, parent, ts, ...)Alternate constructor for vectorial model
Total number of fragments in the coma.
The total number of fragment species we expect in the coma
Get production rate at time t
Methods Documentation
- classmethod binned_production(qs, fragment, parent, ts, **kwargs)[source]¶
Alternate constructor for vectorial model
- Parameters:
- qs
Quantity
List of steady production rates, per time, with length equal to that of
ts
.- parent: `~sbpy.data.Phys`
Same as __init__
- fragment: `~sbpy.data.Phys`
Same as __init__
- ts
Quantity
List of times corresponding to when the production qs begin, with positive times indicating the past.
- kwargs: variable, optional
Any additional parameters in kwargs are passed on to __init__, which are documented above and may be passed in here.
- qs
- Returns:
- VectorialModel
Instance of the VectorialModel class
Notes
Preserves Festou’s original fortran method of describing time dependence in the model - time bins of steady production at specified intervals
The base production of the model is taken from the first element in the production array, which assumes the arrays are time-ordered from oldest to most recent. The base production extends backward in time to infinity, so take care when using this method for time dependence if that is not what is intended.
Examples
This specifies that from 30 days ago to 7 days ago, the production was 1.e27, changes to 3.e27 between 7 and 5 days ago, then falls to 2.e27 from 5 days ago until now >>> q_example = [1.e27, 3.e27, 1.e27] * (1/u.s) >>> t_example = [30, 7, 5] * u.day
- calc_num_fragments_grid()[source]¶
Total number of fragments in the coma.
Calculates the total number of fragment species by integrating the density grid over its volume
- Returns:
- float
Number of fragments in the coma based on our grid calculations
Notes
Outbursts/time dependent production in general will make this result poor due to the grid being sized to capture a certain fraction of parents/fragments at the oldest (first) production rate. The farther you get from this base production, the farther the model will deviate from capturing the requested percentage of particles.
- calc_num_fragments_theory()[source]¶
The total number of fragment species we expect in the coma
- Returns:
- float
Total number of fragment species we expect in the coma theoretically
Notes
This needs to be rewritten to better handle time dependence; the original implementation was designed for abrupt but small parent production changes.