Using cztpipeline in Python Scripts

Users may want to do processing of mutiple data sets or the same data set with different parameters in scripts. This can be done by calling cztpipeline from within python scripts of the users. An example of calling cztpipeline in python script is shown in the code snippet below. For this, import the class Cztpipeline from the module cztpipeline and create an instance of the same. Then use the method run with the parameters of cztpipeline are given as an array of strings with keyword value pair as shown in the example below. All parameters including the hidden parameters are accessible in this manner.

In the below code snippet, spectra and images of a crab observation are generated by calling cztpipline from within python.

from cztpipeline import Cztpipeline

l2dir = '/home/user/path/data_czti/20181014_C04_007T02_9000002432_level2'
parameter_list = ['entrystage = 2', 'exitstage = 3', 'l2dir = {}'.format(l2dir), 'maskWeight = yes', \
'usergtifile = -', 'outputtype = spec', 'clobber = yes', 'rasrc = 83.63308', 'decsrc = 22.01446']

czt = Cztpipeline()

It may be noted that the full CZTI pipeline software needs to be installed in the system for this to work including the the addition of python path in bashrc as mentioned in the installation instructions.