#!/bin/sh

# specify event id's on the command line

export SEISCOMP_ROOT=/data/home/saul/seiscomp3/trunk

host=geofon-cluster
db="mysql://sysop:sysop@$host/seiscomp3"

for evt in "$@"
do
    echo $evt
    python dumppickwaveforms.py --debug -d "$db" -H $host -E "$evt" || continue

    xml="$evt/$evt.xml"
    scxmldump -d "$db" -E $evt --with-picks --with-amplitudes --with-magnitudes --all-magnitudes --formatted --output "$xml"

    scbulletin -3 -d "$db" -E "$evt" > "$evt"/bulletin || continue
    cat "$evt"/bulletin
done
