synthesizer.photoionisation.cloudy23

Given an SED (from an SPS model, for example), generate a cloudy atmosphere grid. Can optionally generate an array of input files for selected parameters.

Functions

synthesizer.photoionisation.cloudy23.convert_cloudy_wavelength(x)[source]

Convert a cloudy wavelength string (e.g. 6562.81A, 1.008m) to a wavelength float in units of angstroms.

Parameters:

x (str) – A cloudy wavelength string

Returns:

float

The wavelength in Angstroms

synthesizer.photoionisation.cloudy23.create_cloudy_input(model_name, shape_commands, abundances, output_dir='./', copy_linelist=True, **kwargs)[source]

A generic function for creating a cloudy input file

Parameters:
  • model_name (str) – The model name. Used in the naming of the outputs

  • shape_commands (list) – List of strings describing the cloudy input commands

  • abundances – (Abundances object) A synthsizer Abundances object

  • output_dir (str) – The output dir

Returns:

list

A list of cloudy commands

synthesizer.photoionisation.cloudy23.read_continuum(filename, return_dict=False)[source]

Extract just the spectra from a cloudy.cont file

Parameters:

filename (str) – The cloudy filename

Returns:

lam (array-like, float)

The wavelength grid

nu (array-like, float)

The frequency grid

incident (array-like, float)

The incident spectrum

transmitted (array-like, float)

The transmitted spectrum

nebular (array-like, float)

The nebular spectrum

nebular_continuum (array-like, float)

The nebular continuum spectrum

total (array-like, float)

The total spectrum

linecont (array-like, float)

The line contribution spectrum

alternatively returns a dictionary

synthesizer.photoionisation.cloudy23.read_linelist(filename, extension='elin')[source]
Parameters:
  • filename (str) – The cloudy filename

  • extension (str) – The extension of the file

Returns:

line_ids (list)

A list of line identificaitons

wavelengths (list)

A list of the line wavelengths

luminosities (list)

A list of the luminosities

synthesizer.photoionisation.cloudy23.read_lines(filename, extension='lines')[source]

Read a full line list from a cloudy output file.

Parameters:
  • filename (str) – The cloudy filename

  • extension (str) – The extension of the file

Returns:

line_ids (list)

A list of line identificaitons

blends (list)

A list containing flags whether the line is a blend

wavelengths (list)

A list of the line wavelengths

intrinsic (list)

A list of the intrinsic luminosities

emergent (list)

A list of emergent luminosities

synthesizer.photoionisation.cloudy23.read_wavelength(filename)[source]

Extract just the wavelength grid from cloudy .cont file and reverse the order

Parameters:

filename (str) – The cloudy filename

Returns:

ndnarray

The wavelength grid

Classes

class synthesizer.photoionisation.cloudy23.ShapeCommands[source]

A class for holding different cloudy shape commands

cloudy_agn(aox=-1.4, auv=-0.5, ax=-1.35)[source]

A function for specifying the cloudy AGN model. See 6.2 Hazy1.pdf.

Parameters:
  • model_name (str) – User defined name of the model used for cloudy inputs and outputs

  • TBB (float) – The Big Bump temperature

  • aox (float) – The x-ray slope (default value from Calabro CEERS AGN model)

  • auv (float) – The uv-slope (default value from Calabro CEERS AGN model)

  • ax (float) – Slope normalisation

Returns:

list

a list of strings with the cloudy input commands

table_sed(lam, lnu, output_dir='./')[source]

A function for creating a cloudy input file using a tabulated SED.

TODO: allow the user to instead specify nu and to automatically convert units if provided

Parameters:
  • model_name (str) – User defined name of the model used for cloudy inputs and outputs.

  • lam (array or unyt_array) – Wavelength grid with or without units (via unyt)

  • lnu (array) – Spectral luminosity density

  • output_dir (str) – Output directory path

Returns:

list

a list of strings with the cloudy input commands