Using the tool "ipython" (included in psana) it is possible to interactively explore the capabilities of the various Detector objects, without reading documentation, using "tab completion" and the "?" operator. All you need to know is your experiment name, run number, and detector name. An example of such a session is shown here:
[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=amotut13:run=206') In [3]: det = Detector('AmoETOF.0:Acqiris.0') In [4]: det. 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? Type: instancemethod String form: <bound method WFDetector.waveform of <Detector.WFDetector.WFDetector instance at 0x7f07a5b96b90>> File: /reg/g/psdm/sw/releases/ana-0.17.14/arch/x86_64-rhel7-gcc48-opt/python/Detector/WFDetector.py Definition: det.waveform(self, evt) Docstring: Returns np.array with waveforms In [5]: evt = ds.events().next() In [6]: print det.waveform(evt) [[-0.03222656 -0.03027344 -0.01757812 ..., -0.03222656 -0.01757812 -0.03027344] [-0.07275391 -0.07275391 -0.07080078 ..., -0.07275391 -0.07080078 -0.07080078] [ 0.04296875 0.04492188 0.04492188 ..., 0.04492188 0.04492188 0.04296875] ..., [-0.10351562 -0.09570312 -0.09179688 ..., -0.10351562 -0.08447266 -0.09570312] [ 0.05615234 0.06982422 0.06982422 ..., 0.06591797 0.06787109 0.06982422] [-0.15673828 -0.14453125 -0.16259766 ..., -0.15673828 -0.14892578 -0.15478516]] In [7]:
Overview
Content Tools