CpFlatFitGradientsTask

CpFlatFitGradientsTask is a task to fit large scale radial and planar gradients in the full field-of-view, with emphasis on LSSTCam flat-fields. This task is intended to be used in two ways:

  1. The task can be applied to a sky flat to generate a reference gradient calibration product, with the default name of flat_gradient_reference (with one per physical filter).

  2. The task can be applied to a dome flat to generate an intermediate gradient product, with the default name of flat_gradient.

There is a second task, CpFlatApplyGradientsTask, that can be used to remove any planar gradients from a dome flat and adjust the radial function so that it matches the reference gradient generated from the sky flat.

Processing Summary

CpFlatFitGradientsTask runs this sequence of operations:

  1. All flats over the full focal plane are loaded, defects are applied, they are rebinned according to the configuration, and the bins are projected into focal plane coordinates (with x and y in millimeters).

  2. The flat may be normalized over the central region (rather than the default focal-plane average).

  3. A spline model to the radial gradient is fit, along with a nuisance parameter for the average relative throughput of the ITL to E2V detectors. Additionally, a planar gradient may be fit; an extra planar gradient that only applies at large radii; and an offset to the centroid for the radial spline model.

  4. Basic QA plots showing the focal plane model and residuals, along with the radial function, are created.

  5. The gradient is output, with the precise dataset type determined by whether this is a reference gradient or a dome gradient.

Python API summary

from lsst.cp.pipe.cpFlatGradients import CpFlatFitGradientsTask
classCpFlatFitGradientsTask(*, config=None, log=None, initInputs=None, **kwargs)

Task to measure gradients on sky/dome flats...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(*, camera, input_flat_handle_dict, input_defect_handle_dict)

Run the CpFlatFitGradientsTask...

See also

See the CpFlatFitGradientsTask API reference for complete details.

Configuration fields

bin_factor

Default
128
Field type

int Field

Binning factor for flats going into the focal plane.

connections

Data type

lsst.pipe.base.config.CpFlatFitGradientsConfigConnections

Field type

ConfigField

Configurations describing the connections of the PipelineTask to datatypes

detector_boundary

Default
10
Field type

int Field

Do not use pixels within detector_boundary of the edge for fitting.

do_constrain_zero

Default
True
Field type

bool Field

Constrain the outermost radial spline value to zero?

do_fit_centroid

Default
False
Field type

bool Field

Fit a centroid offset from the focal plane centroid?

do_fit_gradient

Default
False
Field type

bool Field

Fit a linear gradient over the focal plane?

do_fit_outer_gradient

Default
False
Field type

bool Field

Fit a separate gradient to the outer region of the focal plane?

do_normalize_center

Default
True
Field type

bool Field

Normalize center of focal plane to 1.0?

do_reference_gradient

Default
False
Field type

bool Field

Use task to produce a reference gradient (from sky)? This is used to control the dataset type of the output.

fit_eps

Default
1e-08
Field type

float Field

Minimizer epsilon parameter.

fit_gtol

Default
1e-10
Field type

float Field

Minimizer gtol parameter.

fp_centroid_x

Default
0.0
Field type

float Field

Focal plane centroid x (mm).

fp_centroid_y

Default
0.0
Field type

float Field

Focal plane centroid y (mm).

max_flat_value

Default
1.5
Field type

float Field

Maximum (relative) flat value to use in fit.

min_flat_value

Default
0.05
Field type

float Field

Minimum (relative) flat value to use in fit.

normalize_center_radius

Default
25.0
Field type

float Field

Center normalization will be done using the average within this radius (mm).

outer_gradient_radius

Default
325.0
Field type

float Field

Minimum radius (mm) for the outer gradient fit.

radial_spline_nodes

Default
[0.0, 200.0, 250.0, 300.0, 310.0, 320.0, 330.0, 340.0, 350.0, 360.0, 368.0]
Field type

float ListField

Spline nodes to use for radial fit.

saveLogOutput

Default
True
Field type

bool Field

Flag to enable/disable saving of log output for a task, enabled by default.