set the following env variables depending on the SHELL you are using, for instance in .bashrc or .tcshrc
ROOTSYS: /swdev_nfs/root_v5.28.00
PATH: add $ROOTSYS/bin
PATH: add /swdev_nfs/FACT++
LD_LIBRARY_PATH: $ROOTSYS/lib:/swdev_nfs/FACT++/.libs
PYTHONPATH: $ROOTSYS/lib
the absolute path depends on where you have checked (or will check) out the pyscripts repository
FACT data are stored in (gzipped) fits files, but the data files are too large to be read by the default tool:
pyfits <http://www.stsci.edu/institute/software_hardware/pyfits>.
To mitigate this problem a C++ class defined in fits.h is used. A simple possibility to create an interface of this C++ class and python is to use the
pyroot http://root.cern.ch/drupal/category/package-context/pyroot> module.
simple:
[pceth118] /home/luster/py > root
ROOT 5.28/00h (branches/v5-28-00-patches@42209, Feb 13 2012, 23:52:00 on linux)
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L fits.h++
Info in <TUnixSystem::ACLiC>: creating shared library /home/luster/py/./fits_h.so
root [1]
raw data access and calibration
initialize object
open data file and calibration data file get basic information about the data in data_file_name allocate buffers for data access
data_file_name : fits or fits.gz file of the data including the path calib_file_name : fits or fits.gz file containing DRS calibration data baseline_file_name : npy file containing the baseline values
subtract baseline from the data
open ROOT file with baseline histogram and read baseline values file name of the root file bsl_hist path to the histogram containing the basline values
time when the FAD was triggered, in some strange units...
drs calibration file
perform the drs amplitude calibration of the event data
1D array with raw data
data file (fits object)
print run information
number of events in the data run
used by __iter__
load the next event from disk and calibrate it
number of pixels (should be 1440)
region of interest (number of DRS slices read)
slice where drs readout started
organize file names of a FACT data run
rpath : directory path for the results; YYYYMMDD will be appended to rpath zipped : use zipped (True) or unzipped (Data)
print complete filenames
create (make) the filenames
names : dictionary of filenames, tags { ‘data’, ‘drscal’, ‘results’ } data : name of the data file drscal : name of the drs calibration file results : radikal of file name(s) for results (to be completed by suffixes)