Eval15 pointspread

A simulation (simulate>0) will result in a set of slices containing the number of (simulated) impacts. A pointspreadfunction will be applied to these impacts if pointspreadtype<>none. There is one pointspreadfunction available: pointspreadtype lorentz.

Lorentz function

The contribution of a specific pixel to the surrounding pixels at distance d (in pixels) is:
       1           G
 f =  ———— * ————————————————
      4*π     (d2+(0.5*G)2)1.5

where G is a constant depending on the detector and pixelsize. The value of G can be set with pointspreadgamma. A typical KappaCCD value for G=0.8

Implementation

The Lorentz function has to be applied on all simulated pixels to all pointspreaded pixels. This is an expensive process. It involves the summation of (Nh*Nv)*(Nh*Nv)*Nr evaluations of the lorentz function times the simulated intensity. Nh and Nv are the number of horizontal and vertical pixels, Nr is the number of frames. With typical numbers Nh=21, Nv=21, Nr=5 the number of evaluations for one reflection is 972405.

Integral

The lorentz function should be evaluated as in integral over the whole pixel. Take for instance the central pixel. The lorentz function for d=0 is 0.995. But one pixel further away is drops to 0.05. It is wrong to assume that the contribution to one pixel depends only on the value of the lorentzfunction of the centre of that pixel.
In Eval15, the lorentz function is integrated over the whole pixel using
       1               2*x*y/G
 f =  ———— * atan( ——————————————————— )
      2*π          (x2+y2+(0.5*G)2)0.5
at the four corners of the pixel x,y,
The final value of the LorentFactor = f(x+½,y+½) + f(x-½,y-½) - f(x-½,y+½) - f(x+½,y-½)

Table lookup

To speed things up, the evaluation of the Lorentz function is done with a table lookup. If the data are contained in a box with dimensions Nh, Nv and Nr, the horizontal distance between any two pixels varies from -Nh to Nh, but only the positive side of this range has to be evaluated. A similar argument holds for the vertical direction. So a table has to be build from 0 to Nh and from 0 to Nv.

Here is an example with G=0.8, p=0.11, Nh=21 and Nv=21. Note, the nubers have been multiplied by 1.000.000 for clarity.
     7     7     7     7     7     6     6     6     6     5     5     5     5     4     4     4     3     3     3     3     3     2
     8     8     8     8     8     7     7     7     6     6     6     5     5     5     4     4     4     4     3     3     3     3
     9     9     9     9     9     8     8     8     7     7     6     6     6     5     5     4     4     4     4     3     3     3
    11    11    11    10    10    10     9     9     8     8     7     7     6     6     5     5     5     4     4     4     3     3
    13    13    13    12    12    11    11    10    10     9     8     8     7     6     6     5     5     5     4     4     4     3
    16    15    15    15    14    14    13    12    11    10     9     9     8     7     7     6     5     5     5     4     4     3
    19    19    18    18    17    16    15    14    13    12    11    10     9     8     7     7     6     5     5     4     4     4
    23    23    23    22    21    19    18    17    15    14    13    11    10     9     8     7     7     6     5     5     4     4
    29    29    28    27    25    24    22    20    18    16    14    13    12    10     9     8     7     6     6     5     5     4
    37    36    35    34    31    29    26    24    21    19    17    15    13    12    10     9     8     7     6     6     5     5
    48    47    46    43    40    36    32    29    25    22    19    17    15    13    11    10     9     8     7     6     5     5
    64    63    60    56    51    46    40    35    30    26    23    19    17    14    13    11     9     8     7     6     6     5
    87    86    81    75    67    58    50    43    36    31    26    22    19    16    14    12    10     9     8     7     6     5
   125   122   114   102    89    76    64    53    44    36    30    25    21    18    15    13    11    10     8     7     6     6
   186   180   165   144   122   100    81    66    53    43    35    29    24    20    17    14    12    10     9     8     7     6
   296   284   252   211   170   134   104    81    64    50    40    32    26    22    18    15    13    11     9     8     7     6
   512   482   409   322   243   180   134   100    76    58    46    36    29    24    19    16    14    11    10     8     7     6
  1002   914   716   512   353   243   170   122    89    67    51    40    31    25    21    17    14    12    10     9     8     7
  2385  2035  1371   839   512   322   211   144   102    75    56    43    34    27    22    18    15    12    10     9     8     7
  8121  5818  2856  1371   716   409   252   165   114    81    60    46    35    28    23    18    15    13    11     9     8     7
 62659 23740  5818  2035   914   482   284   180   122    86    63    47    36    29    23    19    15    13    11     9     8     7
421517 62659  8121  2385  1002   512   296   186   125    87    64    48    37    29    23    19    16    13    11     9     8     7
The lower left point of this table (0.421517) corresponds to the central pixel, the lower right point (0.000007) is the contribution at a horizontal distance of 21 pixels. (This table will be displayed on the screen if output simulate=debug)

Threshold

For a further speedup, you may specify a threshold using pointspreadthreshold. To apply the pointspread of a specific pixel with Intensity to all the surrounding pixels, the program used the following algorithm:
  1. set vertical pixel to 0
  2. set horizontal pixel to 0
  3. increase vertical and repeat from step 2 until vertical is out of range
  4. set vertical pixel to -1
  5. set horizontal pixel to 0
  6. decrease vertical and repeat from step 2 until vertical is out of range
The horizontal step phases are continued as long as Intensity*LorentzFactor is larger than pointspreadthreshold (default=0.0) and the 'surrounding pixel' is within box limits.
Eval15
Eval15 commands