linear_oversample
- jwst.adaptive_trace_model.trace_model.linear_oversample(data, region_map, oversample_factor, require_ngood, edge_limit=0, preserve_nan=True)[source]
Oversample the input data with a linear interpolation.
Linear interpolation is performed for each column in each region in the provided region map.
- Parameters:
- datandarray
Original data to oversample.
- region_mapndarray of int
Map containing the slice or slit number for valid regions. Values are >0 for pixels in valid regions, 0 otherwise.
- oversample_factorfloat
Scaling factor to oversample by.
- require_ngoodint
Minimum number of pixels required in a column to perform an interpolation.
- edge_limitint, optional
If greater than zero, this many pixels at the edges of the interpolated values will be set to NaN.
- preserve_nanbool, optional
If True, NaNs in the input will be preserved in the output.
- Returns:
- os_datandarray
The oversampled data array.