Page History
...
- Fetching the IPIMB and PhaseCavity information:
All the other information that we need, is available through theevt
object, and
event
member function is the place to get it:Code Block none none def event( self, evt, env ) :
Use "XppSb3Ipm-1|Ipimb-0" (a.k.a. IPM3) sum of all channels for normalization and filteringCode Block none none ipmN_raw = evt.get(TypeId.Type.Id_IpimbData, "XppSb3Ipm-1|Ipimb-0") ipmN_fex = evt.get(TypeId.Type.Id_IpmFex, "XppSb3Ipm-1|Ipimb-0") ipmN_norm = ipmN_fex.sum
Use "XppSb3Pim-1|Ipimb-0" (a.k.a. PIM3) channel 1 as signalCode Block none none ipmS_raw = evt.get(TypeId.Type.Id_IpimbData, "XppSb3Pim-1|Ipimb-0" ) ipmS_fex = evt.get(TypeId.Type.Id_IpmFex, "XppSb3Pim-1|Ipimb-0" ) ipm_sig = ipmS_fex.channel[1]
Get the phase cavity:Code Block none none pc = evt.getPhaseCavity() phasecav1 = pc.fFitTime1 phasecav2 = pc.fFitTime2 charge1 = pc.fCharge1 charge2 = pc.fCharge2
Compute delay time and fill histogramsCode Block none none delaytime = self.current_pv_value + phasecav1*1e3 # The "histograms" are nothing but python lists. Append to them, and turn them into arrays at the end. self.h_ipm_rsig.append( ipm_sig ) self.h_ipm_nsig.append( ipm_sig/ipm_norm ) self.h_delaytime.append( delaytime )
Image peak finding
http://docs.scipy.org/doc/scipy/reference/ndimage.html
CSPad images and tile arangements
...
Panel | ||
---|---|---|
| ||
|
Plotting with MatPlotLib
Matplotlib:
- The plotting can be done directly in the pyana module, but be aware that you need to disable plotting for the
module to run successfully in a batch job.Code Block import matplotlib.pyplot as plt plt.plot(array) plt.show()
- Or you can load arrays from a file and interactively plot them in iPython. The same ('recommended') syntax as above can be used, or if you use 'import *' you don't need to prepend the commands with the package name, which is handy when plotting interactively:
Code Block from matplotlib.pyplot import * ion() plot(array) draw()
Related useful tools and links
- http://www.scipy.org/NumPy_for_Matlab_Users
- http://www.scipy.org/
- http://www.sagemath.org/
- http://code.google.com/p/spyderlib/
Non-interactive batch analysis
...
Overview
Content Tools