IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links
wiki:Background_Regeneration

Version 3 (modified by watersc1, 14 years ago) ( diff )

--

Background Regeneration

Status: 2012-12-14

Checking the results of the automatically generated background models made it clear that these models were doing more harm than good. This figure shows the automatic models (top row) along with some manually created models (bottom row). The large color jumps in the automatic models are on the order of ~100 counts, whereas for the manual models it is less than 10.

The change in the manual models is that each input warp model is matched to the model from the warp with the best zeropoint by measuring the offset and scale necessary for reference = offset + scale * input. This ensures that the models have similar zeropoints, and prevents the large discontinuities when some inputs are masked.

This image shows the input stack (asinh scaling removed) in the top row, along with the background restored version in the bottom row. The changes are not very dramatic, which is somewhat expected given the reasonably smooth manual background models.

I've made all the data used in this test available on the rsync server under watersc1-demo-data/bkgrest/m33. Each filter is in a separate subdirectory, with the following files:

g
|-- bkgrest_convolved.fpa.fits                                        ppBackground output/convolved/image
|-- bkgrest_convolved.fpa.mk.fits                                                                   mask
|-- bkgrest_unconvolved.fpa.fits                                                          unconvolved/image
|-- bkgrest_unconvolved.fpa.mk.fits                                                                   mask
|-- new_model.fits                                                    manual background model
|-- stack_data
|   |-- RINGS.V3.skycell.1935.063.stk.1827279.fits                    convolved stack image
|   |-- RINGS.V3.skycell.1935.063.stk.1827279.mask.fits                               mask
|   |-- RINGS.V3.skycell.1935.063.stk.1827279.mdl.fits                automatic background model
|   |-- RINGS.V3.skycell.1935.063.stk.1827279.unconv.fits             unconvolved stack image
|   |-- RINGS.V3.skycell.1935.063.stk.1827279.unconv.mask.fits                          mask
|   |-- linear_convolved.fits                                         stack image, asinh scaling removed
|   `-- linear_unconvolved.fits
`-- warp_models
    |-- o5482g0379o.239505.wrp.655200.skycell.1935.063.mdl.fits       input warp background model
    |-- o5482g0379o.239505.wrp.655200.skycell.1935.063.scaled.fits    input warp background model with offset and scale applied
    |-- o5482g0380o.239506.wrp.655285.skycell.1935.063.mdl.fits
    |-- o5482g0380o.239506.wrp.655285.skycell.1935.063.scaled.fits
    |-- o5482g0398o.239524.wrp.655201.skycell.1935.063.mdl.fits
    |-- o5482g0398o.239524.wrp.655201.skycell.1935.063.scaled.fits
    |-- o5482g0399o.239526.wrp.655287.skycell.1935.063.mdl.fits
    |-- o5482g0399o.239526.wrp.655287.skycell.1935.063.scaled.fits
    |-- o5498g0110o.246616.wrp.655293.skycell.1935.063.mdl.fits
    |-- o5498g0110o.246616.wrp.655293.skycell.1935.063.scaled.fits
    |-- o5498g0127o.246632.wrp.655299.skycell.1935.063.mdl.fits
    |-- o5498g0127o.246632.wrp.655299.skycell.1935.063.scaled.fits
    |-- o5805g0537o.385621.wrp.655212.skycell.1935.063.mdl.fits
    |-- o5805g0537o.385621.wrp.655212.skycell.1935.063.scaled.fits
    |-- o5805g0544o.385628.wrp.655217.skycell.1935.063.mdl.fits
    |-- o5805g0544o.385628.wrp.655217.skycell.1935.063.scaled.fits
    |-- o6219g0269o.534377.wrp.655222.skycell.1935.063.mdl.fits
    |-- o6219g0269o.534377.wrp.655222.skycell.1935.063.scaled.fits
    |-- o6219g0287o.534385.wrp.655226.skycell.1935.063.mdl.fits
    `-- o6219g0287o.534385.wrp.655226.skycell.1935.063.scaled.fits

Status: 2012-12-12

All the code is finished and committed to the trunk, but I am still checking the outputs.

Chip Stage

The background models are generated at the chip stage, and will be retained permanently, even after the other image data has been cleaned. These are small (13x13) images that contain the background samples that can be interpolated to construct the smooth background model that was subtracted from the science images.

Warp Stage

Previously, we have not generated warp stage background models. The new trunk (and next tag) will include the code to generate these models. They are similar to the chip stage models, which are interpolated onto a finer grid, and warped to match the science data. This increase in resolution is necessary to properly account for the inter-chip gaps. These models are still substantially smaller than the science images (~50x50).

Stack Stage

To construct the stack stage background model, all input warp background models are loaded, and the median value is selected for each model pixel. NAN and masked regions are excluded in this median, which should represent the "average" background model that was removed from all input images in the stack.

Applying a background model to an image

Generating a background restored image can be done using the ppBackground command:

 ppBackground restored_version -background input.mdl.fits -image input.fits -mask input.mask.fits -recipe PPBACKGROUND STACK

This can be done to either the warp or stack stage products.

Status

All the code is finished and committed to the trunk, but I am still checking the outputs.

Attachments (8)

Note: See TracWiki for help on using the wiki.