# write_fits_spec¶

Write FITS spectrum.

Warning

If data is being written out as single-precision but wavelengths are in double-precision, some rows may be omitted.

Parameters
filenamestr

Output spectrum filename.

wavelengths, fluxesarray-like or Quantity

Wavelength and flux of the spectrum.

Metadata to be added to primary and given extension FITS header, respectively. Do not use this to define column names and units.

overwritebool

Overwrite existing file. Defaults to False.

trim_zerobool

Remove rows with zero-flux. Default is True.

Pad each end of the spectrum with a row of zero flux like synphot.spectrum.BaseSpectrum.taper(). This is unnecessary if input is already tapered.

precision{None, ‘single’, ‘double’}

Precision of values in output file. Use native flux precision by default.

epsilonfloat

Single-precision $$\epsilon$$ value, taken from IRAF SYNPHOT FAQ. This is the minimum separation in wavelengths necessary for SYNPHOT to read the entries as distinct single-precision numbers. This is only used if precision='single' but data are in double-precision. Default from the FAQ is 0.00032.

wave_col, flux_colstr

Wavelength and flux column names (case-insensitive).

wave_unit, flux_unitstr or Unit

Wavelength and flux units, which default to Angstrom and FLAM, respectively. These are only used if wavelengths and fluxes are not in astropy quantities.

Raises
synphot.exceptions.SynphotError

Wavelengths and fluxes have difference shapes or value precision is not supported.