Tips for sky subtraction


Not using default sky subtraction in hscPipe

Sky subtraction is carried out in singleFrameDriver.py and coaddDriver.py. The sky subtraction performed in singleFrameDriver.py can be recovered in coaddDriver.py.

# Restore the sky background subtracted in singleFrameDriver.py, then run coaddDriver.py
coaddDriver.py $home/HSC --calib=$home/HSC/CALIB --rerun test --id filter=HSC-I tract=0 --selectId visit=124776..124790:2 ccd=0..103 --config makeCoaddTempExp.bgSubtracted=False
detectCoaddSources.detection.reEstimateBackground=False

# Options
#     --config makeCoaddTempExp.bgSubtracted=False:It is set to True by default.
#                detectCoaddSources.detection.reEstimateBackground=False : If it is set to True, the background estimation have a problem.

You can check the restored data as ~/HSC/rerun/[rerun]/deepCoadd/[filter]/[tract]/[patch]/warp-[filter]-[tract]-[patch]-[visit].fits. Regarding calexp data, the difference of counts between CCDs sometimes looks clear.

Warning

If you have already done coaddDriver.py and created deepCoadd directory, hscPipe loads warp images under the existing deepCoadd directory when you run the second coaddDriver.py. So you need to rename the [filter] directory name, such as HSC-I to HSC-I_old, then the task generates new warp images which restored sky background.


Changing the size of region used for sky estimation in singleFrameDriver.py

You can change the size of region used for sky estimation with the following option.

# Change the size to 256 × 256
singleFrameDriver.py $home/hsc --calib=$home/hsc/CALIB --rerun test --id filter=HSC-I visit=902798..902808:2 --config processCcd.isr.doFringe=False processCcd.detection.background.binSize=256 processCcd.detection.background.binSize=256

# Option
#     --config processCcd.detection.background.binSize=256 processCcd.calibrate.background.binSize=256

Running coaddDriver.py without skycorrection.py

Run coaddDriver.py with “–config makeCoaddTempExp.doApplySkyCorr=False”

(https://community.lsst.org/t/sky-subtraction/2415)

# Running coaddDriver.py without skycorrection.py
coaddDriver.py $home/hsc --calib=$home/hsc/CALIB --rerun test --id filter=HSC-I visit=902798..902808:2 --config makeCoaddTempExp.doApplySkyCorr=False

# Option
#      --config makeCoaddTempExp.doApplySkyCorr=False