2 Software installation
The combination of Python and C++ is used for the automatic alert level estimation. The database connection is written in Python, including the evaluation and discretization of the observations. The observations are piped (that requires a POSIX system) into the C++ program. The C++ program is based on the C++ library SMILE, it reads in the network file, sets the observations and propagates the probabilities to determine the alert level. The program returns the network with the observations included and prints the alert level which is piped back into the Python script. An XML file is written and uploaded to the database. For automation the program needs to be called from the crontab on a daily basis. A more detailed description follows below.
2.1 Installation on POSIX (Linux, Unix, MAC) Systems
Requirements and Current Code
- python (>=2.5), python-lxml, python-numpy
- gcc
- SMILE library
- GeNIe program
- alertlevel_exupery.tar.gz (current code)
Installation
- Download and install requirements
- Unpack (alertlevel_exupery.tar.gz) which contains: al.py, main.cpp, Makefile, SHVSAC4.xdsl, crontab
- Edit path to SMILE (first line) in Makefile
- Run make
- Adapt SeisHub parameters in al.py
- Run crontab -e and copy adapted lines from crontab file
2.2 Detailed description of processing steps in al.py
- In the first part, the al.py program queries SeisHub for current observations via the alertlevel mapper. This mapper (which resides on the database side) needs to be updated in order to query for different observations than the current.
- The observations are discretized depending on the observation type. In the same step the input string (with a lot of new lines for the C++ program main are generated). In order to use a different BBN network, this input string must be modified. The composition of the input string can be easily determined by calling ./main network.xdsl output.xdsl from the command line --- the corresponding input parameters are then interactively prompted. Note the main program need not be modified for different XDSL networks, just the input string need to be adapted.
- The input string is piped to main and the output is catched.
- The alert level is determined and a XML is generated which includes the output.xdsl file from the main program.
- The XML is uploaded to the database.
The al.py scripts is commented in detail, including the step numbers given above.