SpiralDensityWave
- class dysmalpy.models.SpiralDensityWave(Vrot=None, rho0=None, f=None, k=None, dVrot_dR=None, **kwargs)[source]
Bases:
HigherOrderKinematicsPerturbation
,_DysmalFittable3DModel
Model for a spiral density wave, assumed in the galaxy midplane.
- Parameters:
m (int) – Number of photometric/density spiral arms.
cs (float) – Sound speed of medium, in km/s.
epsilon (float) – Density contrast of perturbation (unitless).
Om_p (float) – Angular speed of the driving force, \(\Omega_p\).
phi0 (float, optional) – Angle offset of the arm winding, in degreed. Default: 0.
Notes
This model is implemented following the derivation given in the Appendix of Davies et al. 2009, ApJ, 702, 114 [1].
Functions for the following must also be passed when setting up the model, which take the midplane galaxy radius R as an input:
Vrot(R) [Unperturbed rotation velocity of the galaxy]
dVrot_dR(R) [Derivative of Vrot(R) – ideally evaluated analytically, otherwise very slow]
rho0(R) [Unperturbed midplane density profile of the galaxy]
f(R, m, cs, Om_p, Vrot) [Function describing the spiral shape, \(m\phi = f(R)\), with \(k \equiv df/dR\)]
k(R, m, cs, Om_p, Vrot) [Function for the radial wavenumber]
References
Attributes Summary
Names of the parameters that describe models of this type.
Methods Summary
ep_freq_sq
(R)Return kappa^2, square of the epicyclic frequency
evaluate
(x, y, z, m, phi, cs, epsilon, Om_p, ...)Evaluate the spiral density wave at x,y,z
f
(R)Shape of spiral arms, with f=m*phi = Int_0^R(k dR)
k
(R)Calculate wavenumber
light_profile
(x, y, z)rho_perturb
(x, y, z)Return the density perturbation -- consider only the midplane Given by Eq.
vLOS_perturb
(x, y, z)Return the projected LOS velocity combining both radial and phi components.
vel_direction_emitframe
(x, y, z[, _save_memory])Method to return the velocity matrix in the output Cartesian frame.
velocity
(x, y, z, *args)Evaluate the spiral density velocity amplitude as a function of position x, y, z, for the different radial and phi components.
vphi_perturb
(x, y, z)Return the phi-direction velocity perturbation Given by Eq.
vr_perturb
(x, y, z)Return the radial velocity perturbation Given by Eq.
Attributes Documentation
- Om_p = DysmalParameter('Om_p', value=0.0, prior=<dysmalpy.parameters.UniformPrior object>)
- cs = DysmalParameter('cs', value=50.0, bounds=(0, None), prior=<dysmalpy.parameters.UniformPrior object>)
- epsilon = DysmalParameter('epsilon', value=0.1, bounds=(0, None), prior=<dysmalpy.parameters.UniformPrior object>)
- m = DysmalParameter('m', value=2.0, fixed=True, bounds=(0, None), prior=<dysmalpy.parameters.UniformPrior object>)
- outputs = ('vr', 'vphi', 'vz')
- param_names = ('m', 'phi0', 'cs', 'epsilon', 'Om_p')
Names of the parameters that describe models of this type.
The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.
When defining a custom model class the value of this attribute is automatically set by the
Parameter
attributes defined in the class body.
- phi0 = DysmalParameter('phi0', value=0.0, bounds=(0, 360), prior=<dysmalpy.parameters.UniformPrior object>)
Methods Documentation
- evaluate(x, y, z, m, phi, cs, epsilon, Om_p, Vrot, rho0)[source]
Evaluate the spiral density wave at x,y,z
- rho_perturb(x, y, z)[source]
Return the density perturbation – consider only the midplane Given by Eq. A9, Davies et al. 2009, ApJ, 702, 114
- vLOS_perturb(x, y, z)[source]
Return the projected LOS velocity combining both radial and phi components. For use in visualizing. Handled via matrix multiplication & projection for model_set.simulate_cube()
Uses NEGATIVE for inflow, POSITIVE for outflow
- vel_direction_emitframe(x, y, z, _save_memory=False)[source]
Method to return the velocity matrix in the output Cartesian frame.
As the native geometry is cylindrical (ignoring z dir), and the velocity is multicoordinate, we need a more complex output than a single vector for a dotproduct.
vel = (R, phi, z). Need matmul(vel_dir_matrix, vel) = vel in (x,y,z). So:
vel_dir_matrix = [[Rtox, phitox, ztox], [Rtoy, phitoy, ztoy], [Rtoz, phitoz, ztoz]]
- Parameters:
x (float or array) – xyz position in the output reference frame.
y (float or array) – xyz position in the output reference frame.
z (float or array) – xyz position in the output reference frame.
_save_memory (bool, optional) – Option to save memory by only calculating the relevant matrices (eg during fitting). Default: False
- Returns:
vel_dir_matrix – Transform of the velocity from the native coordinates to the output cartesian frame.
- Return type:
3x3-element matrix
- velocity(x, y, z, *args)[source]
Evaluate the spiral density velocity amplitude as a function of position x, y, z, for the different radial and phi components. Return a tuple of (vr, vphi, vz).