make_ppv¶
- turbustat.simulator.make_ppv(vel_field, dens_field, los_axis=0, m=<Quantity 2.34167069e-27 kg>, T=<Quantity 100. K>, los_length=<Quantity 1. pc>, vel_disp=None, chan_width=None, v_min=None, v_max=None, threads=1, max_chan=1000, vel_struct_index=0.5, verbose=False, return_hdu=True, pixel_ang_scale=<Quantity 1. arcmin>, restfreq=<Quantity 1.42 GHz>)[source]¶
Generate a mock, optically-thin HI PPV cube from a given velocity and density field. Currently, the conversion to K assumes the 21-cm column density conversion.
- Parameters:
- vel_field
Quantity
Three-dimensional isotropic, velocity field. Must have units of velocity.
- dens_field
Quantity
Three-dimensional isotropic, velocity field. Must have units of number density.
- los_axisint, optional
The axis used to produce the PPV cube.
- m
Quantity
, optional Average particle mass. Defaults to 1.4 time the proton mass, appropriate for the neutral ISM at solar metallicity. Used to calculate the thermal line width.
- T
Quantity
, optional Temperature of the gas. Defaults to 100 K. Used to calculate the thermal line width.
- los_length
Quantity
, optional Set the total physical length of the density and velocity fields along the line-of-sight. Defaults to 1 pc.
- vel_disp
Quantity
, optional Velocity dispersion of the 3D velocity field. When none is given, the mean of the projected standard deviation of the velocity field along
los_axis
is used. Used to set the extent of the velocity channels and estimate the channel widths, when not given.- chan_width
Quantity
, optional Width of a velocity channel. When the width is not given, an estimate is made based on Eq. 12 from Esquivel+2003.
- v_min
Quantity
, optional Minimum velocity channel. Set to
vel_field - 4 * v_lim
, wherev_lim = sqrt(vel_disp**2 + v_therm**2)
, when a limit is not given.- v_max
Quantity
, optional Maximum velocity channel. Set to
vel_field + 4 * v_lim
, wherev_lim = sqrt(vel_disp**2 + v_therm**2)
, when a limit is not given.- threadsint, optional
Number of cores to run on. Defaults to 1.
- max_chanint, optional
Sets an upper limit on the number of velocity channels (default of 1000) to avoid using excessive amounts of memory. If the number of channels exceeds this limit, a
ValueError
is raised.- vel_struct_indexfloat, optional
Index of the velocity field. Used when automatically determining the channel width. Defaults to 0.5.
- verbosebool, optional
Print out the min and max velocity extents and the channel width prior to computing the cube.
- return_hdubool, optional
Return the cube as a FITS HDU. Enabled by default.
- pixel_ang_scale
Quantity
, optional Specify the angular scale of one spatial pixel to set values in the FITS header. Defaults to 1 arcmin.
- restfreq
Quantity
, optional Rest frequency of the spectral line passed to the FITS header. Defaults to 1.42 GHz, roughly the 21-cm HI rest frequency.
- vel_field
- Returns:
- cube
Quantity
orPrimaryHDU
The PPV cube as an array (
return_hdu=False
) or a FITS HDU (return_hdu=True
).- vel_axis
Quantity
When
return_hdu=False
is returned, the values for the velocity axis are returned.
- cube