API

Public Step API

jwst.extract_1d.extract_1d_step Module

Extract 1-D spectra from JWST spectroscopic data.

Classes

Extract1dStep([name, parent, config_file, ...])

Extract a 1D spectrum from 2D data.

Complete Developer API

jwst.extract_1d.apply_apcorr Module

Functions

select_apcorr(input_model)

Select appropriate aperture correction class based on input data model.

Classes

ApCorrBase(input_model, apcorr_table, sizeunit)

Base class for aperture correction classes.

ApCorrPhase(*args[, pixphase])

Produce and apply aperture correction for input data with pixel phase.

ApCorrRadial(input_model, apcorr_table[, ...])

Aperture correction class for spectra produced from an extraction aperture radius.

ApCorr(*args, **kwargs)

Default aperture correction class for use with most spectroscopic modes.

jwst.extract_1d.extract Module

Functions

run_extract1d(input_model[, ...])

Extract all 1-D spectra from an input model.

read_extract1d_ref(refname)

Read the EXTRACT1D reference file.

read_apcorr_ref(refname, exptype)

Read the APCORR reference file.

get_extract_parameters(ref_dict, ...[, ...])

Get extraction parameter values.

box_profile(shape, extract_params, wl_array)

Create a spatial profile for box extraction.

aperture_center(profile[, dispaxis, middle_pix])

Determine the nominal center of an aperture.

shift_by_offset(offset, extract_params[, ...])

Shift the nominal extraction parameters by a pixel offset.

define_aperture(input_model, slit, ...)

Define an extraction aperture from input parameters.

extract_one_slit(data_model, integration, ...)

Extract data for one slit, or spectral order, or integration.

create_extraction(input_model, slit, ...[, ...])

Extract spectra from an input model and append to an output model.

jwst.extract_1d.extract1d Module

Functions

extract1d(image, profiles_2d, variance_rn, ...)

Extract the spectrum, optionally subtracting background.

jwst.extract_1d.ifu Module

Functions

ifu_extract1d(input_model, ref_file, ...[, ...])

Extract a 1D spectrum from an IFU cube.

get_extract_parameters(ref_file, bkg_sigma_clip)

Read extraction parameters for an IFU.

extract_ifu(input_model, source_type, ...)

Perform 1D extraction for IFU data.

locn_from_wcs(input_model, ra_targ, dec_targ)

Get the location of the spectrum, based on the WCS.

celestial_to_cartesian(ra, dec)

Convert celestial coordinates to Cartesian.

get_coordinates(input_model, x0, y0)

Get celestial coordinates and wavelengths.

nans_in_wavelength(wavelength, dq)

Check for NaNs in the wavelength array.

separate_target_and_background(ref)

Create masks for target and background.

im_centroid(data, mask_target)

Compute the mean location of the target.

shift_ref_image(mask, delta_y, delta_x[, fill])

Apply source position offset to target or background for ref image.

sigma_clip_extended_region(data, ...)

Sigma clip the extraction region.

jwst.extract_1d.psf_profile Module

Functions

psf_profile(input_model, trace, wl_array, ...)

Create a spatial profile from a PSF reference.

jwst.extract_1d.soss_extract.atoca Module

Main classes for ATOCA (Darveau-Bernier 2021, in prep.).

ATOCA:

  • Algorithm to Treat Order ContAmination (English)

  • Algorithme de Traitement d’Ordres ContAmines (French)

Classes

MaskOverlapError(message)

Too few valid pixels in a spectral order.

ExtractionEngine(wave_map, trace_profile, ...)

Run the ATOCA algorithm.

jwst.extract_1d.soss_extract.atoca_utils Module

Utilities for jwst.extract_1d.soss_extract.atoca.

Functions

arange_2d(starts, stops)

Generate indices on the oversampled wavelength grid.

sparse_k(val, k, n_k)

Transform a 2D array val to a sparse matrix.

get_wave_p_or_m(wave_map[, dispersion_axis])

Compute upper and lower boundaries of a pixel map, given the pixel central value.

oversample_grid(wave_grid, n_os)

Create an oversampled version of the input 1D wavelength grid.

grid_from_map(wave_map, trace_profile)

Define a wavelength grid based on the wave_map and trace_profile.

grid_from_map_with_extrapolation(wave_map, ...)

Define a wavelength grid based on wave_map, trace_profile, and optional user wave_range.

make_combined_adaptive_grid(all_grids, ...)

Build an irregular oversampled grid needed to reach a given precision when integrating.

throughput_soss(wavelength, throughput)

Create an interpolator for the throughput values.

get_c_matrix(kernel, grid[, i_bounds, thresh])

Return a convolution matrix.

finite_first_d(grid)

Return the first derivative operator based on grid.

try_solve_two_methods(matrix, result)

Solve sparse matrix equation A.x=b, reverting to least-squared solver when spsolve fails.

Classes

ThroughputInterpolator(wavelength, throughput)

Picklable interpolator for SOSS throughput.

WebbKernel(wave_kernels, kernels, ...)

The JWST kernel.

TikhoTests(test_dict[, default_chi2])

Store results of Tikhonov tests for different factors.

Tikhonov(a_mat, b_vec, t_mat)

Use Tikhonov regularization to solve the ill-posed problem A.x = b.

jwst.extract_1d.soss_extract.pastasoss Module

Functions

get_soss_traces(pwcpos, order[, subarray, ...])

Get the SOSS traces for a given input model and spectral order.

get_soss_wavemaps(pwcpos[, subarray, ...])

Get the SOSS wavelength maps and (optionally) spectraces.

retrieve_default_pastasoss_model()

Retrieve the default PASTASOSS reference file.

jwst.extract_1d.soss_extract.soss_boxextract Module

Functions

get_box_weights(centroid, n_pix, shape, cols)

Return the weights of a box aperture given the centroid and the width of the box in pixels.

box_extract(scidata, scierr, scimask, ...)

Perform a box extraction.

estim_error_nearest_data(err, data, ...)

Estimate pixel error empirically using error on nearby pixel values in data.

jwst.extract_1d.soss_extract.soss_extract Module

Functions

get_ref_file_args(ref_files[, orders_requested])

Prepare the reference files for the extraction engine.

run_extract1d(input_model, ...)

Run the spectral extraction on NIRISS SOSS data.

Classes

DetectorModelOrder(spectral_order, wavemap, ...)

Model of detector properties for the ATOCA algorithm for a single spectral order.

Integration(scidata, scierr, scimask, ...[, ...])

Class to handle extraction of a single integration.

jwst.extract_1d.soss_extract.soss_syscor Module

Functions

soss_background(scidata, scimask, bkg_mask)

Compute a column-wise background for a SOSS observation.

make_background_mask(deepstack, width)

Build mask of pixels containing most of the flux.

jwst.extract_1d.source_location Module

Functions

middle_from_wcs(wcs, bounding_box, dispaxis)

Calculate the effective middle of the spectral region.

location_from_wcs(input_model, slit[, ...])

Get the cross-dispersion location of the spectrum, based on the WCS.

trace_from_wcs(exp_type, shape, ...)

Calculate a source trace from WCS.

nod_pair_location(input_model, middle_wl)

Estimate a nod pair location from the WCS.

jwst.extract_1d.spec_wcs Module

Functions

create_spectral_wcs(ra, dec, wavelength)

Assign a WCS for sky coordinates and a table of wavelengths.