Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with cosmic rays #23

Open
pmelchior opened this issue Sep 22, 2021 · 5 comments
Open

Test with cosmic rays #23

pmelchior opened this issue Sep 22, 2021 · 5 comments
Assignees

Comments

@pmelchior
Copy link
Contributor

Cosmic ray hits generate long, very thin streaks in CCDs. They are often quite bright, though, so they may affect the CNN estimators even though their influence is very local.

Create ~100 images with some cosmic ray patters as follows:

  • Draw a random number N from 1 to 20
  • For every streak:
    • Draw 2D positions (x,y) in image coordinates
    • Draw streak length L from 1 to L_max
    • Draw angle phi from 0 to 2 pi.
    • For every pixel in a straight line from (x,y) to (x+L*cos(phi), y+L*sin(phi)), set its value to V_max.

L_max depends on the thickness of the CCD, but from experience on some CCDs, this is of order 10 or 20 pixels. V_max is the full-well depth of the CCD (the maximum number of photoelectrons a pixel can store), in the units of the images (which is normally rescaled from the original count rates).

@harnessa can you check full-well depth of the CCDs in question and how that value would appear in the images that are fed to the CCN?

Then add a randomly selected one of these 100 "foreground images" to a normal test image and see how the presence of the cosmic rays affects the outcome. Repeat until satisfied that is does or does not matter.

@harnessa
Copy link
Collaborator

I believe this is the baselined CCD, with additional modifications to reduce the effects of traps and radiation damage.
https://www.teledyneimaging.com/en/aerospace-and-defense/products/sensors-overview/ccd/ccd201-20/

The full well capacity is 80,000 e/pixel, but that gets converted to counts by the ADC. The ADC is generally 16 bit, meaning a saturated signal gets maxed out at 65535.

Here's a presentation on the detector, which may or may not be helpful: https://www.spiedigitallibrary.org/conference-proceedings-of-spie/10709/2309387/Photon-counting-EMCCD-developments-for-the-WFIRST-coronagraph-Conference-Presentation/10.1117/12.2309387.full

@archen2019
Copy link
Collaborator

You mention that a fully saturated signal maxes out at 65535, but I'm not sure how exactly you fixed the image normalization. In other words, how are you translating these counts into the pixel values seen in the simulated images?

@harnessa
Copy link
Collaborator

First, we generate the simulated diffraction patterns (in units of contrast) with ./quadrature_code/generate_images.py. Then those are turned into images (in units of counts, or pixel values) with ./quadrature_code/add_noise.py using the Noise_Maker class in ./quadrature_code/noise_maker.py.

The function add_noise_to_image in the Noise_Maker class converts the images from units of contrast to pixel values. Immediately after this function is called is where you should apply the full saturated signal of 65535. (*actually, since we remove the CCD bias in Line 269, the saturated pixel value should be 65535 - self.ccd_bias).

@archen2019
Copy link
Collaborator

The maximum pixel value of the images after the add_noise_to_image function is on the order of 10^1, so once I add in the cosmic rays which are on the order of 10^4, the image just gets completely washed out by the cosmic rays. Is this what's supposed to happen?

@harnessa
Copy link
Collaborator

harnessa commented Oct 5, 2021

Yes, but it should only be a few pixels that are saturated. The image will look washed out because of the way the plotting routine displays the image, but the other information should still be in the image. You may need to adjust the 'stretch' of the image in order to see the other features of the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants