fit_all_regions

jwst.adaptive_trace_model.trace_model.fit_all_regions(flux, alpha, region_map, signal_threshold, maximum_cores='none', **fit_kwargs)[source]

Fit a trace model to all regions in the flux image.

Parameters:
fluxndarray

The flux image to fit.

alphandarray

Alpha coordinates for all flux values.

region_mapndarray of int

Map containing the slice or slit number for valid regions. Values are >0 for pixels in valid regions, 0 otherwise.

signal_thresholddict

Threshold values for each valid region in the region map. If the median peak value across columns in the region is below this threshold, a fit will not be attempted for that region.

maximum_coresstr

Number of cores to use for multiprocessing. If set to ‘none’ (the default), then no multiprocessing will be done. The other allowable values are ‘quarter’, ‘half’, ‘all’, and string integers. This is the fraction of available or the explicit number of cores to use for multiprocessing.

**fit_kwargs

Keyword arguments to pass to the fitting routine (see fit_2d_spline_trace).

Returns:
spline_modelsdict

Keys are region numbers, values are dicts containing a spline model, scale, and bounds for each column index in the region. If a spline model could not be fit, the column index number is not present.