Removal of Cosmic Ray Impacts on the Roman Space Telescope Coronagraph Instrument


NASA’s next flagship mission, the Nancy Grace Roman Space Telescope, is designed to research the areas of dark energy, exoplanets, and infrared astronomy. The Coronagraph Instrument on the telescope will allow astronomers to directly image planets in orbit around host stars by reducing the glare from the host star. However, with photons of light constantly hitting the telescope, the impacts of cosmic rays can create defects in the electron multiplying charge-coupled device (EMCCD) image. When a high energy particle makes a direct impact with the detector, the detector absorbs the energy and translates it into high-values pixels. This project aims to not only remove cosmic rays and their tails but also to retrieve the underlying true pixel values under the cosmic rays in a given EMCCD image through the Laplacian edge detection method. The method relies on the sharpness of the edges of cosmic-rays rather than the contrast between entire cosmic-rays and their surrounding pixels, eliminating abnormally high value pixel counts. The images are combined and averaged per-frame with the Laplacian edge detection applied to every frame. For the Coronagraph Instrument to directly image planets in orbit, it must collect very sensitive pieces of information. Cosmic rays can block out many data sources that can be useful towards the mission, therefore, removing and also retrieving the underlying data underneath the rays will be an important source of error reduction for the instrument. 

Author: Ramzi Saber
California Institute of Technology
Mentors: Marie Ygouf, Rob Zellem
Jet Propulsion Laboratory, California Institute of Technology
Editor: Stephanie Chen

Introduction

NASA’s next flagship mission, set to launch no later than May 2027, will be the Nancy Grace Roman Space Telescope – a 2.4-meter observatory designed to research the areas of dark energy, exoplanets, and infrared astrophysics, investigating questions surrounding the early universe, its composition, and its expansion. It will be equipped with two instruments essential to the success and development of the mission (Poberezhskiy 2021). One of these instruments is the Coronagraph Instrument,  an instrument expected to perform high-contrast imaging and spectroscopy of dozens of individual nearby exoplanets using Direct Imaging. Direct Imaging consists of capturing images of exoplanets directly, which is done by first searching for the light reflected from a planet’s atmosphere and then translating the light into digital data.

Exoplanets are extremely faint compared to their star, with their reflected light being fainter by a factor of about 100,000,000 or even more compared to their star. The Coronagraph Instrument will be one of the first telescope instruments to produce and illustrate a high-performance coronagraph system in space capable of directly imaging mature gas giant exoplanet systems, which will aid in future exoplanetary research. The coronagraph will nearly fully block out the star’s light, with the aim of leaving only the light emitted by the planet itself. Through this instrument and its direct imaging capabilities, astronomers can gain vital information about the composition of a particular exoplanet (Kasdin 2020).  Light that passes through the atmosphere of the planet will contain details about the atmosphere’s properties which will get us closer to answering one of the most important questions in the universe – if there is another planet capable of harboring life.

Getting an Image with the Coronagraph

The Coronagraph Instrument features photometry centered at 575 nm and 825 nm and spectroscopy centered at 730 nm and 825 nm. These bands are sufficient to display characteristic signatures that reflect the composition of a light source and signs of its age (Kasdin 2020). The Coronagraph Instrument also employs an electron multiplying charge-coupled device (EMCCD), a detector that is optimized for low photon count rates by achieving near-zero effective read noise, and deformable mirrors for the purpose of correcting aberrations.

A basic charged-couple device (CCD) uses a thin silicon chip that is divided into an array of small, light-sensitive squares called photosites. Each photosite corresponds to an individual pixel in the final image. A numerical value is assigned to each photosite and is based on the number of electrons contained in it (Mackay 1986). During the processing of the electron values, the data must pass through the electronics necessary to convert the light collected into digital data. Figure 1 illustrates the process in which electron data is collected and converted into a digital signal. The path in between the processing contains different forms of uncertainties. The most notable form of uncertainty is read noise, which is an accumulation of all the noise generated by each system component required to convert the charge of each pixel into a signal. The lower the read noise, the easier it is to detect weak signals as it allows for a higher dynamic range, allowing for the difference between signal levels to be detected more accurately. 

Figure 1. A visual depiction of an EMCCD. Photons are collected and converted into photoelectrons within the image capture area where they are then transferred to the storage area and undergo amplification in the multiplication register (Teledyne Princeton Instruments).

In an EMCCD, electron multiplication is used to increase the electron signal greatly above the read noise to maximize sensitivity for low-light imaging. Photons are collected on EMCCD sensors in a similar way to CCD sensors; however, the addition of an EM-gain register allows photoelectrons to be amplified before being read out. This means that the signal is so high above the read noise that the read noise is effectively below one electron. Due to this additional step, an EMCCD camera is able to achieve single-photon detection with sub-electron read noise at high frame rates, hence why an EMCCD is used in the Roman Space Telescope. Other forms of uncertainties include Dark Current Noise, Photon Shot Noise, and Clock Induced Charge.

The Problem at Hand – Cosmic Rays 
With the sensitivity that the Coronagraph Instrument is operating on, image contaminants will be a massive source of error when attempting to collect sensitive data such as that of exoplanets. Cosmic-ray hits cause defects in all astronomical images obtained with CCD detectors. When a high energy particle hits the CCD, it loses its energy by knocking the atoms constituting the chip itself, liberating many electrons and causing a bright spot on the image. These high energy particles can be produced by exploding supernovae, black holes, the release of a solar flare, or just the product of the decay of some radioactive atoms present in the lenses just above the CCD. Cosmic rays are usually easy to recognize as they are much sharper than stars because the high energy particle hits just a couple of pixels, which can be used as an advantage for removing them.

Method – Laplacian Edge Detection
The Laplacian is a 2-D isotropic measure of the second spatial derivative of an image, or in other words, the sharpness of an image. The Laplacian of an image highlights regions of rapid intensity change and is therefore often used for edge detection given an image array. This edge detection is prompted by a zero crossing detector. The zero crossing detector looks for places in the Laplacian of an image where the value of the Laplacian changes signs. These points occur in regions of rapid intensity change (Croke 1995) . This functionality can be used in cosmic ray detection since cosmic rays are in fact a rapid change of intensity, as depicted in Figure 2. The Laplacian Edge Detection can be applied towards the identification and removal of cosmic ray impacts in a CCD image.

Figure 2. A graphical depiction of an image with two cosmic ray hits. The sharpness-characteristic (high pixel value) of a cosmic ray can be seen as a sharp change in intensity and tail-off, representing the tail of the cosmic ray.

Given the context of a cosmic ray, the Laplacian of the edge of a cosmic ray is a negative value on areas of the CCD where there are no cosmic rays, and positive on the areas where there are sharp increases of pixel values, or in other words, areas where there are cosmic rays. Therefore, by setting all negative values in the Laplacian image to zero, pixels affected by cosmic rays are retained, and their negative cross patterns are removed. The given image is then resampled to its original median resolution. To identify cosmic rays in the Laplacian image, the value of each pixel is compared with the expected noise at that location (van Dokkum 2001). 

First Test – Blind Test
For the first test, the Laplacian edge detection method is applied to a sample contaminated image (Figure 3) to see if the cosmic rays can be detected given the read noise and gain of the raw image. The raw CCD image possesses a mix of true data and cosmic ray hits. The results of the cosmic ray detection and the subsequent removal of the detected cosmic rays are shown in Figures 4 and 5 respectively.  

Figure 3. Raw CCD image depicting several cosmic ray impacts. The color bar indicates pixel values. Values above 8000 illustrate high energy particles, i.e. cosmic rays.
Figure 4. The detected cosmic rays from Figure 3 after implementing the Laplacian Edge Detection Method.
Figure 5. The restoration image, free of cosmic ray hits.

The first test is called a blind test because statistical data is not available in this case: there is no way of comparing the restored image (Figure 5) to a clean image free of cosmic rays because the true image (Figure 3) itself is contaminated. Looking at Figure 5, however, it appears that all the cosmic rays were removed along with their tails. To verify this statistically, we started with a true image with known pixel values and no contaminants and then simulated cosmic ray hits on the true image. After applying the Laplacian edge detection method, the restored image was compared to the true image to see visually and statistically whether or not they were in agreement and to what yield the agreement was on.

To simulate cosmic rays, we utilized the EMCCD Detect package found in the public Roman Coronagraph Instrument Science Tools GitHub (Nemati 2021). The package is designed to simulate the parameters of the coronagraph instrument. Using the EMCCD Detect package, a user can simulate frame time, EM gain, full well image, full well serial, dark current, clock induced charge, read noise, bias, qe, CR rate, and pixel pitch values.  If all values other than those that generate cosmic rays are set to 0, then cosmic rays can be simulated over any given image.

First Simulation Data and Results – Blank Image
To check the replacement and statistical efficiency of the removal algorithm, the first simulation involved generating an empty image of zero valued pixels (Figure 6) and then contaminating it with three cosmic ray hits (Figure 7). The algorithm was then run with a read noise value of zero and a gain of 10, which represents the gain of the cosmic ray and its tail. After retrieving the restored image (Figure 8), a sigma agreement test was conducted to see statistically whether or not the true image and the restored image agree with each other. A sigma agreement value is at most 1 if the two images are at least 99.99% in agreement with each other; the sigma calculation reflects how similar the two images are, 1 being 99.99% similar, and values significantly greater than 1 reflecting significant differences between the two images. For the first simulation, a sigma agreement value of 0 was calculated, indicating that the two images are identical.

Figure 6. Blank generated 1056×1037 image of zero-valued pixels along with its pixel value chart with respect to the flattened array in the x-axis. The true image possessed a mean and standard deviation of 0. 
Figure 7. Three cosmic ray impacts contaminating Figure 6, the zero-pixel background image.
Figure 8. The restored image shows no signs of cosmic rays, and no signs of any error pixel replacement either. The pixel value graph on the right is identical to the pixel value chart of Figure 7, supporting the sigma agreement value of 0, and signifying that the restored image and the true image are identical. 

Second Simulation Data and Results – Introducing Read Noise
For the second simulation, we introduced 0.36 read noise in order to generate some pixel data and see the efficiency and accuracy of the removal algorithm. This value was chosen in order to simulate the Coronagraph Instrument capabilities. The true image (Figure 9) possesses a mean pixel value of 0.008 and a pixel standard deviation of 0.08877. The true image was then contaminated by three cosmic rays (Figure 10) and restored using the Laplacian removal algorithm (Figure 11). The restoration image possessed a mean of 0.004 and a standard deviation of 0.064. The values of the true image and restored image yielded a sigma agreement value of 0.07358, representing a 99.99% agreement.

Figure 9. A blank 1056×1037 image superimposed with read noise valued at 0.36 e. The true image possessed a mean pixel value of 0.008 and a standard deviation of 0.08877.
Figure 10. The Figure 9 image contaminated with three cosmic ray hits.
Figure 11. The restored image of the second simulation possessing a standard deviation of 0.064 and yielding a 0.07358 sigma agreement value.

Third Simulation Data and Results – OS 11 Data
The sigma agreement values for both simulations one and two were <<1, demonstrating very strong agreements between the true image and restored image. However, a test with respect to the exact Roman Coronagraph parameters is necessary to see how reliable this algorithm is when applied to sample data that the Coronagraph Instrument will be collecting. The Roman Space Telescope Coronagraph Instrument team at JPL provides sets of simulated images in order to facilitate investigations of optimum image processing algorithms and expected scientific performance with respect to the parameters of the coronagraph instrument, with the latest release being Observing Scenario 11. Observing Scenario 11 (OS11) is representative of a realistic observing sequence, but does not reflect any particular requirements for total observation time, number of rolls, etc. Figure 12 is a raw image from the simulated Observing Scenario. The same methodology was applied here: simulating cosmic ray hits on top of the OS 11 raw data and implementing the removal technique to compare the restoration and raw image. The raw image possessed a mean pixel value of 0.012 and standard deviation of 0.0356. The restored image possessed a mean of 0.0887 and standard deviation of 0.2418. The two statistical parameters yielded a sigma agreement value of 0.3138.

Figure 12. Raw OS11 data along with its pixel values. 
Figure 13. Contaminated OS 11 data with two cosmic ray impacts alongside their pixel value chart.
Figure 14. Restored OS 11 image alongside its pixel values, having a 0.3138 sigma agreement value 

Conclusions

After the first two simulations, the sigma agreement values retrieved were both <<1, signifying a strong agreement between the true image, and the restored image. However, what does that tell us about the Laplacian edge detection technique? It is evident that the algorithm is able to remove cosmic rays as represented in the figures above – visually and graphically. The Laplacian edge detection method replaces cosmic rays by the median of surrounding good pixels and offers the option of applying the algorithm iteratively to ensure the complete removal of sharp edges, or in this case, cosmic rays. A Monte Carlo Simulation Test of 100,000 simulations was conducted to collect a sample of sigma agreement values. This was done for the purpose of gathering a more concrete statistical correlation between the efficiency of the Laplacian Edge Detection Algorithm and the simulation of two cosmic ray hits on the OS 11 data. The average sigma agreement value for the algorithm given the OS 11 data and the cosmic ray simulations is 0.375, with the median sigma agreement value being 0.3726. All sigma agreement values were around the 0.3 value, mainly due to the fact that the image was kept constant, and the rate of cosmic ray hits was kept constant as well.

Future work, however, needs to be conducted to ensure the statistical significance and efficiency of this method. The Monte Carlo Simulation aided in acquiring a large data set of statistical values that relate directly to the overall efficiency of the Laplacian Edge Detection Algorithm given a particular FITS image. However, since all of this data is simulated, it would be beneficial to see how the algorithm responds to actual cosmic ray hits that have been collected rather than simulated. This future work will aid in understanding the credibility of this algorithm in removing cosmic rays from important data collection instruments like the Coronagraph Instrument, as well as understanding how to remove cosmic ray contaminants from other instruments and experiments as a whole.

Further Reading

Acknowledgments

This research was carried out at the Jet Propulsion Laboratory, California Institute of Technology, and was sponsored by JPLSIP and the National Aeronautics and Space Administration (80NM0018D0004)

References

 Croke, B. F. W. “Removal of Cosmic-Ray Events in Spectroscopic CCD Data.” Publications of the Astronomical Society of the Pacific 107.718 (1995): 1255.

Gonzalez, Rafael C., and Richard E. Woods. “Digital image processing Reading.” MA:  Addison-Wesley (1992). 

Kasdin, N. Jeremy, et al. “The Nancy Grace Roman space telescope coronagraph instrument (CGI)  technology demonstration.” Space Telescopes and Instrumentation 2020: Optical, Infrared, and  Millimeter Wave. Vol. 11443. SPIE, 2020.

Mackay, Craig D. “Charge-coupled devices in astronomy.” Annual review of astronomy and astrophysics 24  (1986): 255-283.

Nemati, Bijan. Miller, Sam. “EMCCD_Detect”. (2021) https://github.com/wfirst-cgi/emccd_detect

Poberezhskiy, Ilya, et al. “Roman space telescope coronagraph: engineering design and operating concept.” Space Telescopes and  Instrumentation 2020: Optical, Infrared, and Millimeter Wave. Vol. 11443. SPIE, 2021.

Teledyne Princeton Instruments. “EMCCDs: The Basics Educational Notes.”  https://www.princetoninstruments.com/learn/camera-fundamentals/emccds-the-basics

van Dokkum, Pieter G. “Cosmic‐Ray Rejection by Laplacian Edge Detection.” Publications of the  Astronomical Society of the Pacific, vol. 113, no. 789, 2001, pp. 1420–27. JSTORhttps://doi.org/10.1086/323894. Accessed 23 Aug. 2022.


Leave a comment