HDF_Eventpar : processing of FDM X-ray measurements to get energy resolutions

Pipeline script for processing HDF5 X-ray event files. Performs event selection, optimal filtering and other functions, depending on the parameters set.

Can be used for multiprocessor execution, using mpiexec.

usage:

     HDF_Eventpar [-h] [-ch CHANNEL] [-f FREQUENCY [FREQUENCY ...]]
                  [-n NRECS] [--delist DELIST] [-sum] [--pdf] [--debug]
                  [--threshold THRESHOLD] [--bsec BSEC] [--bpo]
                  [--nopulseselect] [--absolute] [--noise]
                  [--brange BRANGE BRANGE] [-nf NOISEFILE] [-np] [-nc]
                  [-fc FREQCUTOFF] [-pl PRLEN] [-rot] [-ph PHASE]
                  [--tdfilter] [-ect] [-rt] [--rterange RTERANGE RTERANGE]
                  [--afitrange AFITRANGE AFITRANGE] [--avout] [-ss] [-el]
                  [-rel] [--eventtime] [--woptf] [--useoptf USEOPTF]
                  [--etprev ETPREV ETPREV] [--etnext ETNEXT ETNEXT]
                  [--alltim]
                  dir

Get event parameters for selections

positional arguments:
  dir                   Directory or file of x-ray data HDF5 file(s)

optional arguments:
  -h, --help            show this help message and exit
  -ch CHANNEL, --channel CHANNEL
                        Channel number to use. Default is first available
                        channel.
  -f FREQUENCY, --frequency FREQUENCY
                        Frequency number (pixel) to use. Default is first
                        available frequency. 'all' for all frequencies
  -n NRECS, --nrecs NRECS
                        Number of records to display. When single is not
                        selected, average of records is shown. Default is all
                        records
  --delist DELIST       file specifying the event record numbers to ignore;
                        list of "from-to" to ignore
  -sum, --summary       Print summary of results to file
  --pdf                 Only pdf output
  --debug               show some debug info + plots on screen
  --threshold THRESHOLD, -t THRESHOLD
                        Amplitude threshold for event detection (default 2000)
  --bsec BSEC           Section (start+end) of record to use for background
                        (default 0.05)
  --bpo                 select only pretrigger section for baseline value
  --absolute            Use sqrt(I^2+Q^2) for pulse record
  --noise               Let the script ask for seperate noise file
  --brange BRANGE BRANGE
                        Range of baseline values to select. Default: no
                        selection
  -nf NOISEFILE, --noisefile NOISEFILE
                        Define seperate noise file(name)
  -np, --nopulseposition
                        do not select pulses based on pulse position
  -nc, --nocorrelation
                        do not correct for opt.filter vs. baseline correlation
  -fc FREQCUTOFF, --freqcutoff FREQCUTOFF
                        Maximum frequency cutoff for optimal filtering
  -pl PRLEN, --prlen PRLEN
                        Length (power of 2) of record to process for optimal
                        filtering (default entire record)
  -rot, --rotate        Rotate events for minimum Q-signal (based on 100
                        events phase average)
  -ph PHASE, --phase PHASE
                        Rotate events with given fixed phase (degrees)
  --tdfilter            Perform optimal filtering in time domain
  -ect, --ectfilter     Perform filtering to exclude electric crosstalk positive pulses
  -rt, --risetime       compute and show histograms of rise time for pulses
                        (only for single frequency)
  --rterange RTERANGE RTERANGE
                        range in energy for rise time correlation plot
  --afitrange AFITRANGE AFITRANGE
                        Fitrange in keV for alpha lines (default 5.860 5.920 )
  --avout               output ASCII text files with average pulses
  -ss, --sumspectrum    show spectrum, summed over all frequencies (pixels)
  -el, --eventlist      write eventlist with optimal filter and baseline
                        values
  -rel, --raweventlist  write eventlist of all pulses with raw pulse
                        parameters (no optimal fit and energy)
  --eventtime           write event times in eventlist file
  --woptf               write optimal filter data to file
  --useoptf USEOPTF     use given external optimal filter file template
  --etprev ETPREV ETPREV
                        only select events with delta time within given
                        interval from previous event
  --etnext ETNEXT ETNEXT
                        only select events with delta time within given
                        interval to next event
  --alltim              for deltatimes for "etprev", use all events from all pixels

examples

Some example of use:

HDF_Eventpar -f all --pdf -sum dir

Process all frequencies (pixels) and write-out pdf plot and (ascii) summary file. Since only a directory is speficied where data files are located, the actual datafile to process will be interactively queried.

Other example:

HDF_Eventpar -f 0 2 5 6 --pdf -sum -np -el -ss -fc 5000 dir/data.h5

Process only frequencies 0,2,5 and 6. Write plot to pdf file and write (ascii) summary. Do not require all pulses to be on the sameposition within the record and plot a summed spectrum. Set frequency cutoff to 5000 Hz and write (ascii) evenlists, which contains the selected events with the record index and relevant parameters. The complete filename is provided (so no further interactive queries are neccesary)

input files

Some notes on input file specification:

When the input file (dir) is a straight h5 data file, with the file name containing _xray_, the script will search for the associated noise file, containing _noise_. When the input dir is a directory, the script will interactively ask the user for the h5 data file in that directory. The same file will also be used to obtain the noise data, unless the parameter --noise is set. In that case the script will also ask interactively for a noise file. The noise file can also be provided beforehand, using the --noisefile parameter.

[source download]