trident.utilities.make_onezone_dataset

trident.utilities.make_onezone_dataset(density=1e-26, temperature=1000, metallicity=0.3, domain_width=10.0)[source]

Create a one-zone hydro dataset for use as test data. The dataset consists of a single cubicle cell of gas with hydro quantities specified in the function kwargs. It makes an excellent test dataset through which to send a sightline and test Trident’s capabilities for making absorption spectra.

Using the defaults and passing a ray through the full domain should result in a spectrum with a good number of absorption features.

Parameters

Density

float, optional

The gas density value of the dataset in g/cm**3 Default: 1e-26

Temperature

float, optional

The gas temperature value of the dataset in K Default: 10**3

Metallicity

float, optional

The gas metallicity value of the dataset in Zsun Default: 0.3

Domain_width

float, optional

The width of the dataset in kpc Default: 10.

Returns

Example

Create a simple one-zone dataset, pass a ray through it, and generate a COS spectrum for that ray.

>>> import trident
>>> ds = trident.make_onezone_dataset()
>>> ray = trident.make_simple_ray(ds,
...         start_position=ds.domain_left_edge,
...         end_position=ds.domain_right_edge,
...         fields=['density', 'temperature', 'metallicity'])
>>> sg = trident.SpectrumGenerator('COS')
>>> sg.make_spectrum(ray)
>>> sg.plot_spectrum('spec_raw.png')