Program Name

fp_cont

PCS stream-state
group: EventStream table: <dbase-name> state: FPfit
group: TPP table: TPP state: FPfit
Description

fp_cont is the PCS client program for producing fault-plane solutions using fprun, fpfit, and fpplot_www (described below).

There are two instances of fp_cont running on post-processing systems. One handles new events from the EventStream-<dbase-name>-FPfit stream-state. The other handles events that have been finalized, in the TPP-TPP-FPfit stream-state. These two instances work in the /home/ncss/FP/prelim/ and /home/ncss/FP/final/ directories, respectively.

fp_cont runs a typical PCS client loop:

Program Location

post-proc systems: /home/ncss/ncpp/FP/bin

Configuration File
/home/ncss/ncpp/FP/prelim/conf/fp_cont.cfg
/home/ncss/ncpp/FP/final/conf/fp_cont.cfg
Source of Database name

masterdb

Cron Starter Program
2,12,22,32,42,52 * * * * /home/ncss/ncpp/FP/bin/startFpCont prelim
4,14,24,34,44,54 * * * * /home/ncss/ncpp/FP/bin/startFpCont final
Log File
/home/ncss/ncpp/FP/prelim/logs/fp_cont.log
/home/ncss/ncpp/FP/final/logs/fp_cont.log
Other Programs Called

/home/ncss/ncpp/FP/bin/fprun_pdl:

fprun_pdl (a perl script) controls the operation of fpfit and related programs. fprun_pdl is controlled by its command line options and configuration file. fprun_pdl usage:

fprun_pdl version 0.0.8
fprun_pdl - generate and publish fault plane solutions using fpfit, fpplot
Syntax:
        fprun_pdl -c config [-d DB] [-DpPqQqRvw] [-V version] eventID
        fprun_pdl -h
where:
        -c config   - specify the configuration file (required)
        -d DB       - specify masterDB instead of that returned by
                      $TPP_BIN_HOME/masterdb.
        -p          - populate mode; by default I don't populate mec tables
        -E          - send add-on (CUBE LI format) to EIDS
        -w          - send html and gif to DISTLIST from config file.
        -P          - send QuakeML, and gif (or delete) files to PDL
        -R          - Remove any FPFIT solutions for event preferred origin
        -h          - prints this help message.
        -v          - prints programmer debug code
        -V version  - specify the EIDS LI and PDL version number; the default
                      version number is the event version from DB
        -D          - Don't clean up work files; useful for debugging

fprun_pdl queries the database for the event parametric information fpfit needs for input. If the event qualifies for an fpfit solution (25 phase arrivals, azimuthal gap less than 235 degrees), fprun_pdl writes a sparse hypoinverse archive file.

Next fpfit is run to attempt a solution; not all events meeting fprun_pdl's criteria will result in successful fpfit solutions. If one or more solutions are produced, the results are populated into the database provided the -p flag is provided on the fprun_pdl command line.

If fprun_pdl was called with the -w flag, fpplot_www is run to create postscript files of the solution mechanisms. fprun_pdl does some fiddling with the postscript to adjust the image quality. Then the postscript is converted into a GIF image using the mogrify program (part of the GraphicsMagick package. Fprun_Pdl also generates an html page for each solution to host the solution image. These web products are then distributed, using rsync, to the configured list of web servers for publication.

After fprun_pdl has created the html and image files, if the -E flag was given it will create CUBE LI format (link) messages and submit these into the https://ehppdl1.cr.usgs.gov/PDL system. These link messages provide PDL clients with the URIs of the html pages.

fprun_pdl can also be directed , using the -P flag, to generate a QuakeML file describing the focal mechanism and submit focal-mech products into PDL. fprun_pdl will create database records in tne pdl_product and pdl_ids table for these PDL submissions.

Fpfit may produce more than one solution for an event. When fpfit is run a second time after an event has been re-timed and finalized, there may be fewer solutions that there were for the initial run. Fprun_Pdl queries the database to determine how many fpfit solutions were prepared for origins of the event other than the current preferred origin. If it finds that more solutions were prepared in previous runs, then fprun_pdl will generate CUBE LI deletion messages to remove the links to those old, extra solutions. It will also submit appropriate focal-mech products to delete the extra solutions.

Other programs used by fp_cont:

/home/ncss/ncpp/FP/bin/fpfit
/home/ncss/ncpp/FP/bin/fpplot_www
/usr/bin/gm mogrify
/usr/bin/rsync
/home/ncss/run/alarms/bin/qml
/home/ncss/run/ProductClient/bin/ProductClient.jar