JWST ETC User Supplied Spectra

The JWST Exposure Time Calculator (ETC) allows users to upload a spectrum for a new source. This capability is especially helpful in cases where the ETC's library of template spectra does not contain the desired spectrum or spectral features.

On this page

Video Tutorial:  Uploading Spectra to the ETC

One of the features of the JWST ETC is its ability to handle a spectrum supplied by the user. This is accomplished by a direct upload from the machine where the user is running the web browser.

Words in bold are GUI menus/
panels or data software packages; 
bold italics are buttons in GUI
tools or package parameters.

To use this option, you will need to:

  • Prepare your spectrum file
  • Specify your spectrum file on the Upload Spectra page

Use the Upload Spectra page to upload and manage your spectra for a given workbook. On this page, you will find a list, if any, of previously uploaded spectra, including filename, wavelength range, and an optional note. Spectra can be selected and uploaded in the usual way for your web browser; the controls are located at the bottom of the Upload Spectra page. If the file is large or the computer has a slow Internet connection it will take more time for the browser to send the file to the ETC server. 

Filename Length

The maximum filename length for an uploaded file is 100 characters.

At this time, there is no capability to delete a spectrum once it has been uploaded. Uploading a file with the same name as an existing file, however, will overwrite the existing file in the ETC.



Prepare your file 

The user-specified spectrum file should be in one of the following file formats:

  • ASCII table, with the extension .dat or .txt
  • FITS table, with an extension .fits

Prepare your ASCII input spectrum file with 2 columns:

  • column 1: wavelength (µm)
  • column 2: flux density (mJy) 

For FITS format files, the format must be PySynphot compatible.

You may use PySynphot locally to validate your file by using the following command:

 >>> import pysynphot as psyn
 >>> sp = psyn.FileSpectrum('myfile.dat')

(The same command will also work for a FITS file.) If this command succeeds (i.e., no error messages), then your input spectrum file meets the necessary requirements.

Common reasons you have received an upload error:

  • Duplicate wavelengths
  • Wavelengths not in increasing order
  • Exceptionally large flux values
  • File size exceeds 10 MiB (10.49 MB)

Please note that if your spectrum has negative flux values, they will be clipped to zero and the calculation will proceed.

The wavelength range covered by the uploaded spectrum should cover the wavelength range of any instrument configurations one intends to use. If there is only partial coverage, the calculation will proceed with a warning, but may return a less accurate result. No spectral overlap with the instrument configuration will result in an error.



Spectrum file format 

ASCII 

If the file is an ASCII file, it must contain 2 columns (one for wavelength in µm and one for flux density in mJy) separated by one or more spaces. Any comment lines in the file must start with the # symbol to avoid confusion when it is used in the calculation. 

FITS

If the file is a FITS binary table, it should have 2 columns labeled “WAVELENGTH” and “FLUX”, with the units specified for each column. 

Wavelength and flux units must be compatible with PySynphot. Acceptable units are shown in Table 1.

 

Table 1. Acceptable units for PySynphot

Wavelengths
Flux
angstrom, angstroms

flam = erg cm-2 s-1 Å-1

hz

fnu = erg cm-2 s-1 Hz-1

nm

photlam = photons cm-2 s-1 Å-1

micron, microns, μm

photnu = photon cm-2 s-1 Hz-1

inversemicron, inversemicrons

jy = 10-23 erg cm-2 s-1 Hz-1

μm

mjy = 10-26 erg cm-2 s-1 Hz-1

mmabmag
cmstmag
m, meterobmag

vegamag

count, counts


In addition, the header of the FITS table should include lines similar to these describing the content of the file:

PCOUNT = 0 /
GCOUNT = 1 / Only one group
TFIELDS = 2 / Number of fields per row
EXTNAME = ’f4v_v15_flam.tab’ / Name of extension
TTYPE1 = ’WAVELENGTH’ /
TBCOL1 = 1 /
TFORM1 = ’E15.7 ’ /
TUNIT1 = ’angstroms’ /
TDISP1 = ’G15.7 ’ /
TTYPE2 = ’FLUX ’ /
TBCOL2 = 17 /
TFORM2 = ’E15.7 ’ /
TUNIT2 = ’flam ’ /
TDISP2 = ’G15.7 ’ /



Specify your spectrum 

On the Upload Spectra page, you may upload files in the usual way for your browser. Notes can be added in the pane next to the uploaded spectrum table after selecting a spectrum.

 


Apply your spectrum to a source

To use the uploaded spectrum, go to the Scenes and Sources page. You may either add a source with this new spectrum, or edit an existing source to apply this spectrum. 

To apply the new spectrum to an existing source, first select the source in the Select a Source pane. Go to the Source Editor pane. Click the Continuum sub-tab and then click the radio button titled Uploaded File and select your spectrum from the pull-down menu.  After you click the Save button, all edits made to the source will be automatically applied to all scenes using that source.

To add a new source with this spectrum to a scene, first select the Scene, then begin to define a new source by clicking New below the Select a Source pane. Select the source by clicking on the appropriate row in the Select a Source pane. Provide additional source details, if desired, via the different items in the sub-tabs located in the Source Editor pane. In the Continuum sub-tab, click the Uploaded File radio button, and select the newly uploaded spectrum from the pull-down menu, and click Save. The desired uploaded spectrum is now assigned to the source. The new source can be selected and added to the selected scene by using the Add Source button under the Select a Scene pane.

If you uploaded a spectrum in surface brightness units (e.g., mJy/square arcsecond) instead of flux density units (e.g., mJy), you will need to specify an Extended source under the Shape tab in the Source Editor pane. Then under Normalization choices, click the Surface Brightness radio button and select the correct units from the dropdown menu. For additional information on how to create an Extended source, see JWST ETC Defining an Extended Source.



References

JWST Exposure Time Calculator Tool

Pontoppidan, K. M., et al., 2016, Proc. SPIE 9910, Observatory Operations: Strategies, Processes, and Systems VI, 991016
Pandeia: a multi-mission exposure time calculator for JWST and WFIRST

PySynphot




Latest updates
  •  
    Updated for ETC 3.0.

  •  
    Clarifications added to the text.


  • Updated for ETC 1.5. Video link added.


  • Updated for ETC 1.3.

  •   
    Note added to include upload spectra filename limitation.
Originally published