# calwebb_detector1: Stage 1 Detector Processing¶

Config

calwebb_detector1.cfg, calwebb_tso1.cfg

Class

Detector1Pipeline

The Detector1Pipeline applies basic detector-level corrections to all exposure types (imaging, spectroscopic, coronagraphic, etc.). It is applied to one exposure at a time. It is sometimes referred to as “ramps-to-slopes” processing, because the input raw data are in the form of one or more ramps (integrations) containing accumulating counts from the non-destructive detector readouts and the output is a corrected countrate (slope) image.

There are two unique configuration files to be used to control this pipeline, depending on whether the data are to be treated as a Time Series Observation (TSO). Non-TSO exposures use the calwebb_detector1 configuration, which applies all applicable steps to the data. The calwebb_tso1 configuration, on the other hand, should be used for TSO exposures, for which some steps are set to be skipped by default (see the list of steps in the table below). Both configurations call the Detector1Pipeline; the only difference is which steps are applied.

The list of steps applied by the Detector1Pipeline pipeline is shown in the table below. Note that MIRI exposures use some instrument-specific steps and some of the steps are applied in a different order than for Near-IR (NIR) instrument exposures.

Near-IR

MIRI

calwebb_detector1

tso1

calwebb_detector1

tso1

group_scale

group_scale

dq_init

dq_init

saturation

saturation

ipc

superbias

firstframe

refpix

lastframe

linearity

linearity

rscd

dark_current

dark_current

refpix

jump

jump

ramp_fitting

ramp_fitting

gain_scale

gain_scale

1

The ipc step is currently set to be skipped by default in the “calwebb_detector1.cfg” and “calwebb_tso1.cfg” configuration files for all instruments.

2

The persistence step is currently hardwired to be skipped in the Detector1Pipeline module for all NIRSpec exposures.

## Arguments¶

The calwebb_detector1 pipeline has one optional argument:

--save_calibrated_ramp  boolean  default=False


If set to True, the pipeline will save intermediate data to a file as it exists at the end of the jump step (just before ramp fitting). The data at this stage of the pipeline are still in the form of the original 4D ramps (ncols x nrows x ngroups x nints) and have had all of the detector-level correction steps applied to it, including the detection and flagging of Cosmic-Ray (CR) hits within each ramp (integration). If created, the name of the intermediate file will be constructed from the root name of the input file, with the new product type suffix “_ramp” appended, e.g. “jw80600012001_02101_00003_mirimage_ramp.fits”.

## Inputs¶

### 4D raw data¶

Data model

RampModel

File suffix

_uncal

The input to Detector1Pipeline is a single raw exposure, e.g. “jw80600012001_02101_00003_mirimage_uncal.fits”, which contains the original raw data from all of the detector readouts in the exposure (ncols x nrows x ngroups x nintegrations).

Note that in the operational environment, the input will be in the form of a Level1bModel, which only contains the 4D array of detector pixel values, along with some optional extensions. When such a file is loaded into the pipeline, it is immediately converted into a RampModel, and has all additional data arrays for errors and Data Quality flags created and initialized to zero.

## Outputs¶

### 4D corrected ramp¶

Data model

RampModel

File suffix

_ramp

Result of applying all pipeline steps up through the jump step, to produce corrected and CR-flagged 4D ramp data, which will have the same data dimensions as the input raw 4D data (ncols x nints x ngroups x nints). Only created when the pipeline argument --save_calibrated_ramp is set to True (default is False).

### 2D countrate product¶

Data model
File suffix

_rate

All types of inputs result in a 2D countrate product, based on averaging over all of the integrations within the exposure. The output file will be of type “_rate”, e.g. “jw80600012001_02101_00003_mirimage_rate.fits”. The 2D “_rate” product is passed along to subsequent pipeline modules for all non-TSO and non-Coronagraphic exposures. For MIRI MRS and NIRSpec IFU exposures, the output data model will be IFUImageModel, while all others will be ImageModel.

### 3D countrate product¶

Data model

CubeModel

File suffix

_rateints

If the input exposure contains more than one integration (NINTS>1), a 3D countrate product is created that contains the individual results of each integration. The 2D countrate images for each integration are stacked along the 3rd axis of the data cubes (ncols x nrows x nints). This output file will be of type “_rateints”. The 3D “_rateints” product is passed along to subsequent pipeline modules for all TSO and Coronagraphic exposures.