synthesizer.instruments.utils

Utility helpers for instrument-related workflows.

This module currently provides helpers for constructing wavelength grids from resolving power and for inspecting the available premade instruments.

Functions

synthesizer.instruments.utils.get_lams_from_resolving_power(lam_min, lam_max, resolving_power)[source]

Generate a wavelength array from a resolving-power definition.

This function creates an array of wavelengths between lam_min and lam_max, where the spacing between wavelengths is determined by the resolving power. The resolving power can be specified as a constant or as a function that varies with wavelength.

Parameters:
  • lam_min (unyt_quantity) – Minimum wavelength of the output grid.

  • lam_max (unyt_quantity) – Maximum wavelength of the output grid.

  • resolving_power (float or callable) – Resolving power (R = λ / Δλ). Can be a constant value or a function that takes a wavelength with units and returns a resolving power. This allows either a fixed-resolution grid or one whose spacing varies with wavelength.

Returns:

Array of wavelengths with the same units as the inputs.

The spacing is chosen such that successive wavelength bins follow the supplied resolving-power definition.

Return type:

unyt_array

synthesizer.instruments.utils.print_premade_instruments()[source]

List all available premade instruments.

This will also count the filters (if any) available for each instrument and check whether the cached instrument file has been downloaded or not. The output is formatted as a simple ASCII table for quick inspection at the command line.

Factory classes are included in the table, but they report cache availability as N/A because they do not correspond to a single cached instrument file.

Return type:

None