abscal.wfc3

Subpackages

Submodules

Package Contents

Functions

populate_table([data_table])

Search a directory and produce a table of exposures.

coadd(input_table, **kwargs)

Co-adds grism data

reduce(input_table, **kwargs)

Reduces grism data.

wlmeas(input_table, **kwargs)

Measure planetary nebula emission line locations.

wlmake(input_table, wl_table, **kwargs)

Derives a grism wavelength fit.

abscal.wfc3.populate_table(data_table=None, **kwargs)

Search a directory and produce a table of exposures.

Uses glob to search all directories in the table’s search_dirs array for files matching the table’s search_str template, and adds rows to the table containing metadata based on the files that were found.

Parameters:
  • data_table (abscal.common.exposure_data_table.AbscalDataTable, default None) – The table (which may contain existing data) to which the new data should be added.

  • kwargs (dict) –

    A dictionary of optional keywords. Currently checked keywords are:

    verbosebool

    Flag to indicate whether or not the program should print out informative text whilst running.

    compatbool

    Whether to operate in strict IDL compatibility mode

    In addition to these keywords, any default parameters may be set through passing a keyword argument.

  • None (If data_table is) –

  • case (a new table will be created in the function. In that) –

  • the

  • table (kwargs dict will be passed to that) –

  • sent (so any table-creation keywords will be) –

  • through.

Returns:

data_table – A table containing an entry for each input file and necessary metadata obtained from the FITS header of that file.

Return type:

abscal.common.exposure_data_table.AbscalDataTable

abscal.wfc3.coadd(input_table, **kwargs)

Co-adds grism data

Takes the input table, and

  • filters out the grism exposures, then for each

    • looks for an extracted spectrum

    • if none is found, call reduce_grism_extract to make one

  • groups the grism exposures by program/visit/grism, then for each group

    • co-adds the spectra in that group

    • creates a FITS file (and an ASCII table) for each co-added spectrum

  • writes out a new version of the input table with updated values (if any)

Parameters:
Returns:

input_table – The updated table of exposures

Return type:

abscal.common.exposure_data_table.AbscalDataTable

abscal.wfc3.reduce(input_table, **kwargs)

Reduces grism data.

Takes a table of grism data, and dispatches individual exposures to either the scan-mode or stare-mode reduction function as appropriate.

Parameters:
Returns:

input_table – Updated table of exposures

Return type:

abscal.common.exposure_data_table.AbscalDataTable

abscal.wfc3.wlmeas(input_table, **kwargs)

Measure planetary nebula emission line locations.

There are six planetary nebula emission lines that fall neatly into the WFC3 grism spectral orders, and this function uses the approximate wavelength solution to find the rough location of these lines, and then uses flux-weighting to determine the line centre. The user is able to override a given fit if the script is run with the show_plots flag.

Parameters:
Returns:

output_table – Table of emission line locations

Return type:

astropy.table.Table

abscal.wfc3.wlmake(input_table, wl_table, **kwargs)

Derives a grism wavelength fit.

Once planetary nebula emission lines have been located and fit, it is possible to use them as input in creating a full wavelength fit for the grism detector. ABSCAL fits the wavelength set with a linear slope and intercept, where both the slope and the intercept have constant terms, linear terms in X, and linear terms in y.

Once the fit has been calculated, the script prints out fit errors based on the input exposures, and creates an output table with all of the fit terms. A separate fit is derived for each order of each grism.

Parameters:
  • input_table (abscal.common.exposure_data_table.AbscalDataTable) – Table of exposures to be fit.

  • wl_table (astropy.table.Table) – Output of wlmeas.

  • kwargs (dict) – Dictionary of overrides to the default reduction parameters, and command-line option selections.

Returns:

output_table – Table of wavelength fit values

Return type:

astropy.table.Table