COG calculation of diffracted spots on a camera

In summary, Sophie Centaur wants to simulate diffracted spots on a camera, but is not too confident in coding. She found a code that calculates the COG, but there may be better approaches.
  • #1
Gifty01
11
0
TL;DR Summary
COG calculation of diffracted spots on a camera
Hi all,

I will like to simulate diffracted spots at least two spots, on a camera. I will be glad if someone can help out with a code. below are the details required:
camera pixel size = 4um (each pixel can be sub divided for better calculation), gap size = 100nm, camera length = 4000 x 4000 pixels, diffracted spot size on the camera = 30 um (airy disk eqn or gaussion eqn can be used to simulate the diffracted spot), photon noise = poisson distribution, read out noise = zero mean normal noise, monte-carlo simulation = 500 random realizations. Other details if needed are:
saturation capacity = 10300, QE = 68%, SNR =6.7 bit.
1634533214104.png
Eqn for COG calculation

At each iterations, the true center is placed randomly within the CCD pixel and then compared to the measured center.

A graph of Center of gravity (COG) against spot positioning (i.e moved across the sensor from left to right) should be calculated. A sample of how the plot will look like is attached.
1634533673735.png

Due to effect of sensor edge, the COG calculation deflects from the real value. I will like to create a matrix which corrects the COG calculation by subtracting e.g at the left edge of the edge, and adding up e,g at the other edge to the right. since the measured COG value is known. Thanks in advance.
 

Attachments

  • 1634533622564.png
    1634533622564.png
    11.1 KB · Views: 100
Astronomy news on Phys.org
  • #2
Gifty01 said:
Summary:: COG calculation of diffracted spots on a camera

I will like to simulate diffracted spots at least two spots, on a camera.
Not quite sure what you mean. Is the diffraction pattern due to the diameter of the optics? If so, then the output of a sensor pixel will be a rectangular / square sample in 2D.

In terms of basic ideas on sampling theory. Just working on one dimension, for a start (imagining a long, narrow sensor element), the output level on the sensor pixel will be the integral of the diffraction pattern between the limits of the sensor width. If you were to scan the sensor across the image, you would get a low pass filtered (smoothed) version of the original pattern.
 
  • #3
Thanks for your response sophiecentaur. The diffraction is due to the size of the aperture. I am not so good in coding. I wrote a bad code with MATLAB which takes a lot of time to run completely. the graph showing the plot of COG against spot position was the plot I obtained, which shows that there is much deviation of the spot position and the calculated COG, which is due to the finiteness of the pixel or sensor (since we used a finite sensor to sample a continuous function in this case the airy disk). That was why I am trying to obtain a matrix that could be added to effectively calculate the COG so as to get rid of the sensor edge effect. Thanks.
 
  • #4
Gifty01 said:
I am not so good in coding.
Practice makes perfect. It is ages since I did anything more than formulae in Excel.
Your problem could be straightforward - certainly it is in one dimension. That's just like the simple moments calculations.
if M is the total mass of a line of small masses m0 m1, m2 ...mn and they are spaced by d, the basic 'school' method to find the position x of M from one end of the row is:
M.x = d.m1 + 2d.m2 + 3d.m3 + 4d.m4 . . .etc . . .
In 2D, your m values would be the sum of the my 's on either side of the position of the max of the mx 's. It will give you a corrected x position for the CM to somewhere to one side of the chosen maximum. If you get several equal values of m, you can use the first and the correction will take care of it. In fact you can take any starting point but you wouldn't want to use too big a range or you could catch two stars.
If that makes sense then you can do the same for the y distances in the array.
There may be better approaches but I could code that without too much trouble
I just looked on Google and found this which does just what I said.
 

1. How is the COG (center of gravity) calculation of diffracted spots on a camera performed?

The COG calculation of diffracted spots on a camera is typically performed by using image processing algorithms to analyze the intensity and position of the diffracted spots. The algorithm calculates the center of gravity of the spot by taking into account the intensity of each pixel and its distance from the center of the spot. This results in a more accurate determination of the spot's position compared to simply taking the centroid of the spot's pixels.

2. Why is the COG calculation important in diffraction studies?

The COG calculation is important in diffraction studies because it allows for more precise determination of the position of diffracted spots on a camera. This is crucial in accurately measuring the diffraction angles and intensities, which are used to determine the crystal structure of a material.

3. Can the COG calculation be affected by noise or other factors?

Yes, the COG calculation can be affected by noise or other factors such as uneven illumination or background noise. These can lead to errors in the determination of the spot's position and intensity. To minimize these effects, it is important to use proper image processing techniques and to ensure that the camera is properly calibrated.

4. Is the COG calculation only applicable to X-ray diffraction studies?

No, the COG calculation can also be used in other diffraction studies such as electron diffraction or neutron diffraction. It is a general method for accurately determining the position of diffracted spots on a camera, regardless of the type of radiation used.

5. Are there any limitations to the COG calculation method?

One limitation of the COG calculation is that it assumes a symmetrical diffraction spot. If the spot is significantly asymmetrical, the COG method may not accurately determine its position. Additionally, the COG method may not be suitable for very low intensity spots, as the noise can significantly affect the calculation.

Similar threads

Replies
152
Views
5K
Replies
1
Views
2K
  • General Discussion
Replies
2
Views
6K
Back
Top