Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
[cpo@psana1602 ~/examplePython]$ ipython
Python 2.7.10 (default, May 27 2015, 10:33:01) 
Type "copyright", "credits" or "license" for more information.
IPython 2.3.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
In [1]: from psana import *
In [2]: ds = DataSource('exp=amotut13xpptut15:run=206280')
In [3]: det = Detector('AmoETOF.0:Acqiris.0ACQ1')
In [4]: det.   (NOTE: user hits <TAB> after typing the "." to get list of available methods)
det.dettype                   det.runnum
det.env                       det.set_calib_imp
det.instrument                det.set_correct_acqiris_time
det.iscpp                     det.set_env
det.ispyt                     det.set_print_bits
det.pbits                     det.set_source
det.print_attributes          det.source
det.print_config              det.waveform
det.pyda                      det.wftime
det.raw                       
In [4]: det.waveform?  (NOTE: "?" operator returns help for specified method, including how to call it) Signature: det.waveform(evt)
TypeDocstring:
Returns np.array       instancemethod
String form: <bound method WFDetector.waveform of <Detector.WFDetector.WFDetector instance at 0x7f07a5b96b90>>with waveforms
        
File:        /reg/g/psdm/sdf/group/lcls/ds/ana/sw/releasesconda1/inst/envs/ana-4.0.17.14/arch/x86_64-rhel7-gcc48-opt/python59-py3/lib/python3.9/site-packages/Detector/WFDetector.py
DefinitionType:  det.waveform(self, evt)
Docstring:
Returns np.array with waveforms
        method

In [5]: evt = next(ds.events().next()    (NOTE: getting an event, since the above "Definition" line requires it)
In [6]: print(det.waveform(evt))     (NOTE: calling the "waveform" method as required by the above "Definition" line)  [[ 0.00258789  0.00087891  0.00258789 ...  0.          0.
   
[0.        ]
 [-0.0322265600400391 -0.0302734400327148 -0.0175781200302734 ...,  -0.03222656 -          0.01757812
  - 0.03027344]
 ...,         ]
 [-0.00742188 -0.00595703 -0.00107422 ...  0.          0.
   0.        ]
 [-0.156738280027832  -0.1445312500083008 -0.1625976600302734 ...,  -0.15673828 -          0.14892578
   -0.15478516        ]]
 In [7]: 
 

References