Content
Analysis of cxif5315
Comments and references to code
2015-05-04 from Kartik Ayyer:
2015-04-30 Meng's link for the CFEL confluence that has the data analysis summary
Fraser transformation in python
Menng's matlab code fraser1.m, fraser2.m for Fraser transformation is implemented in python fraser.py (download).
Assumptions in implemented algorithm:
- detector plane is transverse to the beam
- by default image center (sizex/2, sizey/2) coincides with origin for transformation. Non-default center can be set to different point.
Example of diffraction and transformed images:
Angles phi and beta using Kartik's code
Using Kartik's formulas for angles phi and beta kartik-2-peak-ev-angles.py.txt one can get distributions:
In summary:
- angle phi is evaluated using two peak positions and sample-to-detector distance
- angle beta is evaluated using one !!! peak position and angle phi.
- peak and event selection need to be improved
- it could be nice to have explanation to this formalism...
Angles phi and beta from fit
Solving equation for tan(theta) we may get functional dependence between x and y peak position for angles phi and theta,
funy(x,phi,beta)
this function presents a solution of quadratic equation which has two roots. The root is selected depending on sign of theta angle...
This function is catheterized in python script fiber_angles.py and can be plotted for different angles:
Solutions: y1=-B+sqtr(B^2-C) and y2=-B-sqtr(B^2-C):
Similar function is used in data processing to fit peak (x,y) positions in equatorial region and use two angles as a fit parameters.
from scipy.optimize import curve_fit def funcy(x, phi_deg, bet_deg) : # ATTENTION! x is treated as numpy array..., # so function should also return numpy array of the same size <some parameterization> def procEventEqu() : # summary for event if sp.count_equ_pks_sel > 1 : yn = [-line[4] / L for line in sp.lst_equ_evt_peaks] xn = [ line[5] / L for line in sp.lst_equ_evt_peaks] #? yn.append(0) #? xn.append(0) en = np.ones_like(xn) p0 = [-3.1,-5.1] popt, pcov = curve_fit(funcy, xn, yn, p0, en)
results of the fit to peaks found in each event gives distributions for two angles: