read_calspec

Contents

read_calspec#

read_calspec(filename, url='https://archive.stsci.edu/hlsps/reference-atlases/cdbs/current_calspec/', wrange=[3990, 17010], description='')[source]#

Read a CalSpec reference flux FITS file.

Parameters:
  • filename (str) – Name of the reference flux file. If it is not found locally (or in PACKAGE_PATH.joinpath("config")), it is read from url.

  • url (str, optional) – Base URL of the remote CalSpec repository. Default is CALSPEC_URL.

  • wrange (list of float, optional) – [min, max] wavelength domain to keep (inclusive), in Angstrom. Default is [3_990, 17_010].

  • description (str, optional) – Description of the file; if not empty, the file name is printed. Default is ''.

Returns:

astropy.table.Table – File content as a table with columns "wavelength" (Angstrom) and "flux" (erg/s/cm^2/A).

Raises:

AssertionError – If the file units are not ANGSTROMS and FLAM.

Examples

>>> tab = read_calspec('gd71_mod_012.fits',
...                    description='GD71')
Reading GD71 CalSpec file 'https://archive.stsci.edu/...
>>> tab.info()
<Table length=43735>
   name     dtype           unit           format
---------- ------- ---------------------- --------
wavelength float64               Angstrom {:10.4g}
      flux float32 erg / (Angstrom s cm2) {:12.4e}