thespacedoctor / soxspipe

The pipeline for the SOXS instrument
GNU General Public License v3.0
3 stars 0 forks source link

Use LACosmic via CCDProc to remove CRHs from single images #90

Open thespacedoctor opened 2 years ago

thespacedoctor commented 2 years ago

The Kelson sky background subtraction will likely remove CRHs from stare mode observations, so LACosmic will be needed only for single nod / offset images (i.e. less than 3 images per nod location). Some notes:

The LACosmic method is a good technique to remove cosmic ray hits (CRHs) from single exposures. LACosmic was originally implemented in IRAF by Pieter G. van Dokkum. The method is implemented in Python within the Astro-SCRAPPY package.

Before using LACosmic:

  1. Images need to have bias and dark signatures removed
  2. It’s best that images are flat fielded but not mandatory
  3. Images must not have sky subtracted

The recommended level of sigma clip the CRHs is 5𝜎, but you should experiment.

In Python’s CCDProc the cosmicray_lacosmic function will return a new image with CRHs identified in a mask. Where CRHs are found, the data in the image has pixel values replaced with values interpolated from neighbouring pixels.

see Craig, M. & Chambers, L. 'Cosmic Ray Removal with CCDProc.'

bookends://sonnysoftware.com/190278

smarttgit commented 2 years ago

LACosmic is a good algorithm and experience has shown it works well.

Need to do a timing check on how long it will take to run it on the e2V CCD full frame. It can be lengthy for a full 4kx2k pixel frame. In PESSTO pipeline, for EFOSC2, only the few hundred pixels either side of the object trace were cleaned, which significantly improved speed.

The UV-VIS 4-order structure may allow us to do that too - only run it +/- 50 pixels around the traces, rather than whole frame. If run time is proportional to pixel count then this could reduce LACosmic run time by factor 5-10.

Will need to check if the NIR chip requires cosmic removal - usually HgCdTe chips don't suffer significantly from CR hits. So may not need it for IR arm. But let's double check.