solspect.get_solspect

solspect.get_solspect(
    wl_knots=None,
    *,
    source=None,
    table=None,
    cols2drop=(),
    dflam_rho=1.0,
    add_fnu=True,
    add_abmag=True,
)

Load all source columns, optionally interpolate, and add derived flux columns.

Parameters

wl_knots : array-like or ~astropy.units.Quantity, default = None

Output wavelengths; plain values are in µm. None retains native rows. Otherwise, linearly interpolate flam, propagate dflam, and drop bandwidth with an INFO log. Order and duplicates are kept; an empty sequence returns an empty table. Extrapolation is rejected.

source : {"tsis_full", "tsis", "astm"}, default = None

Bundled reference. Defaults to "tsis_full" when table is omitted. Supply either source or table, not both.

table : ~astropy.table.QTable, default = None

Custom source. Requires finite, unmasked wl and flam with physical units, positive wavelengths, and nonnegative flux. Interpolation requires a nonempty, strictly increasing grid. Retained dflam must be nonnegative and bandwidth positive, both finite, unmasked, and in compatible units. Other columns are copied on native grids; drop them before interpolation.

cols2drop : str or sequence of str, default = ()

Column names to omit; defaults to none. Use cols2drop=("dflam", "bandwidth") to omit source uncertainties and widths. Known columns absent from a source are ignored; unknown names raise ValueError. Required wl and flam cannot be dropped. Dropping fnu or ABmag overrides its add flag.

dflam_rho : float or array-like, default = 1.0

Neighboring error correlation in [-1, 1], finite and dimensionless. Defaults to 1.0 (fully correlated, giving an upper bound). A scalar applies everywhere; an array needs one value per source interval. Nondefault values require interpolation with a retained dflam.

add_fnu : bool, default = True

Add or recompute fnu [MJy] from output wl and flam. Defaults to True; False omits the column.

add_abmag : bool, default = True

Add or recompute ABmag [mag] independently of add_fnu. Defaults to True; False omits the column.

Returns

result : ~astropy.table.QTable

Owned columns with deep-copied table metadata. wl and bandwidth use µm; flam and dflam use W m^-2 um^-1. Other native columns keep their units. Source tables remain unchanged. With wl_knots, the metadata bin_width_nm, sampling_interval_nm, and spectral_resolution_nm get the prefix source_.

Raises

: ValueError

Inputs, column selection, units, or correlations are invalid; extrapolation or interpolation of unsupported columns is requested.

Notes

Interpolation samples flux density; it does not conserve integrated flux when rebinning. Output covariance, wavelength errors, and interpolation model error are not included. dflam_propagation metadata identifies the correlation mode. Derived columns use the output flux; zero flux gives infinite ABmag.

See the bundled solar spectra README for dataset selection, coverage, uncertainty definitions, and provenance.