diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0d0ba6e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +Releases +CODE/bin +CODE/matlab/*.mex* +CODE/i18n/locales +DOC/user-manual/* +!DOC/user-manual/*.tex +!DOC/user-manual/*.bib +!DOC/user-manual/figures +PACK/* +!PACK/build +!PACK/build-mac +!PACK/fpm* +.DS_Store +**/.DS_Store diff --git a/.package_add b/.package_add new file mode 100644 index 00000000..7ed7a739 --- /dev/null +++ b/.package_add @@ -0,0 +1,4 @@ +CODE/bin +CODE/matlab/bin +CODE/i18n/locales +DOC/user-manual/WebObs_Manual.pdf diff --git a/CODE/bin/WebObsConfig b/CODE/bin/WebObsConfig deleted file mode 100755 index 608c8df5..00000000 --- a/CODE/bin/WebObsConfig +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -eval $(./WebObsConfig.pl); -printenv | grep 'WEBOBS_'; - diff --git a/CODE/bin/WebObsConfig.pl b/CODE/bin/WebObsConfig.pl deleted file mode 100755 index 0528a15d..00000000 --- a/CODE/bin/WebObsConfig.pl +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/perl -I../cgi-bin -use strict; -use WebObs::Config; -for (keys(%WEBOBS)) { print "export WEBOBS_$_=\"$WEBOBS{$_}\"\n" } - diff --git a/CODE/bin/arclinkfetch/bin/arclink_fetch b/CODE/bin/arclinkfetch/bin/arclink_fetch deleted file mode 100755 index 35e503a9..00000000 --- a/CODE/bin/arclinkfetch/bin/arclink_fetch +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/sh - -P=`dirname $0` -export basefolder="${P}/../share/seiscomp3af" -if [ ! -d "$basefolder" ] -then - #DL-was: echo "Wrong installation, please reinstall this package and try again." - echo "$0 could'nt find $basefolder" - exit -else - export PYTHONPATH="$basefolder:$PYTHONPATH" -fi - -exec python "$basefolder/arclink/lib/arclink_fetch.py" "$@" diff --git a/CODE/bin/arclinkfetch/bin/arclink_fetch_wrapper b/CODE/bin/arclinkfetch/bin/arclink_fetch_wrapper deleted file mode 100755 index b43278e6..00000000 --- a/CODE/bin/arclinkfetch/bin/arclink_fetch_wrapper +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Aide -#------------------------------------------------------------------------------- -usage () -{ - cat < -EOF -} - -#------------------------------------------------------------------------------- -# Valeurs par défaut -#------------------------------------------------------------------------------- -# Nombre maximum de jours d'une requête -JOURS_MAX=100 -# Par défaut, lit l'entrée standard comme fichier de requête (comme arclink_fetch) -FICHIER_REQ=/dev/stdin -export PATH=$PATH:$(dirname "$0") - -#------------------------------------------------------------------------------- -# Conversion d'une date arclink en timestamp -#------------------------------------------------------------------------------- -date2ts () -{ - date=$1 - date -d "$(echo $date|sed 's/^\([0-9]\+\),\([0-9]\+\),\([0-9]\+\),\([0-9]\+\),\([0-9]\+\),\([0-9]\+\)/\1-\2-\3 \4:\5:\6 UTC/')" +%s -} - -#------------------------------------------------------------------------------- -# Conversion d'un timestamp en date arclink -#------------------------------------------------------------------------------- -ts2date () -{ - ts=$1 - date -d "@$ts" -u "+%Y,%m,%d,%H,%M,%S" -} - -#------------------------------------------------------------------------------- -# Fractionnement d'une ligne de requête arclink -#------------------------------------------------------------------------------- -fractionnement_ligne() -{ - # Extraction des champs de la ligne de requête : dates et reste de la ligne - ligne="$1" - date_deb="$(echo "$ligne"|gawk '{print $1}')" - date_fin="$(echo "$ligne"|gawk '{print $2}')" - reste="$(echo "$ligne"|gawk '{$1=$2="";print}')" - # Calcul des timestamps correspondant aux dates - ts_deb=$(date2ts $date_deb) - ts_fin=$(date2ts $date_fin) - # Différence maximale de timestamp (période la plus longue d'interrogation) - dts_max=$(($JOURS_MAX*86400)) - # Tant que la date de fin n'est pas en vue de la période maximale depuis la date de début - while [ $(($ts_fin-$ts_deb)) -gt $dts_max ] - do - # Calcul d'une date intermédiaire : date précédente + période maximale - ts_int=$(($ts_deb+$dts_max)) - date_int=$(ts2date $ts_int) - # Génération d'une ligne de requête intermédiaire - echo "$date_deb $date_int $reste" - # Incrémentation de la date de début à la date intermédiaire - ts_deb=$ts_int - date_deb=$(ts2date $ts_deb) - done - # La date de fin n'est plus trop loin, on affiche la période restante - echo "$date_deb $date_fin $reste" -} - -################################################################################ -# Programme principal -################################################################################ - -# Traitement des options -while [ $# -ge 1 ] -do - case $1 in - (-h|-help|--help) usage ; exit 0 ;; - # Seul argument de ce script : nombre max de jours - (-m|--max) shift ; JOURS_MAX="$1" ;; - # Récupération du nom du fichier de sortie - (-o|--output-file) OUTPUT_FILE="$2" ; shift ;; - (--output-file=*) OUTPUT_FILE="${1#*=}" ; shift ;; - # Passage des autres arguments à arclink_fetch - (-l|-n|-g|-p|-v|-q|--longhelp|--no-resp-dict|--rebuild-volume|--proxy|--password-file=*|--address=*|--request-format=*|--data-format=*|--preferred-sample-rate=*|--label=*|--timeout=*|--retries=*|--user=*) ARGS="$ARGS $1" ;; - (-w|-a|-f|-k|-s|-L|-t|-x|-u|--password-file|--address|--request-format|--data-format|--preferred-sample-rate|--label|--timeout|--retries|--user) ARGS="$ARGS $1 $2" ; shift ;; - (-*) echo "Option inconnue : [$1]" ; usage ; exit 1 ;; - (*) FICHIER_REQ="$1" - esac - shift -done - -# Lecture du fichier de requête (fonctionne avec /dev/stdin) -requete=$(cat "$FICHIER_REQ") - -# Fichier temporaire dans lequel arclink_fetch écrira à chaque itération, qui sera concaténé pour former le fichier demandé -TMP_OUTPUT=$OUTPUT_FILE.tmp - -# Le fichier de sortie demandé est vide au départ -:>$OUTPUT_FILE - -# Traitement du fichier -while read -do - ligne="$REPLY" - requete_fractionnee_ligne="$(fractionnement_ligne "$ligne")" - while read - do - ligne_fractionnee="$REPLY" - # Exécution de la requête arclink sur la ligne fractionnée - echo "Requête arclink avec la ligne [$ligne_fractionnee]" - # Avec la version 1.2.1 installée dans Webobs, l'argument REQUEST est obligatoire, d'où le /dev/stdin, inutile en version 1.2.8 - echo "$ligne_fractionnee" | arclink_fetch $ARGS -o $TMP_OUTPUT /dev/stdin - # Copie du fichier miniseed temporaire dans celui demandé - cat $TMP_OUTPUT >> $OUTPUT_FILE - done <<< "$requete_fractionnee_ligne" -done <<< "$requete" - -# Effacement du fichier temporaire -rm $TMP_OUTPUT diff --git a/CODE/bin/arclinkfetch/bin/inventory b/CODE/bin/arclinkfetch/bin/inventory deleted file mode 100644 index 74e2d24a..00000000 --- a/CODE/bin/arclinkfetch/bin/inventory +++ /dev/null @@ -1,1461 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ResponseFIR#20120119110426.873187.361 - - - - - - - - - - - - - - - ResponsePAZ#20120119110413.07213.229 - ResponsePAZ#20120119110413.072287.230 - - - - - - - - - ResponsePAZ#20120119110404.173581.104 - ResponsePAZ#20120119110404.173663.105 - - - - - - - - - - - - - - - - ResponseFIR#20120119110435.180829.569 - - - - - - - - - - - - - - - ResponsePAZ#20120227100833.713669.571 - ResponseFIR#20120227100833.712916.569 ResponseFIR#20120227100833.713096.570 - - - - - - - - - - - - - - - - ResponseFIR#20120119110430.243286.459 - - - - - - - - - - - - - - - - ResponseFIR#20120119110433.041607.490 - - - - - - - - - - - - - - - ResponsePAZ#20120119110412.79656.206 - - - - - - - - - - ResponsePAZ#20120119110415.142738.243 - - - - - - - - - - ResponsePAZ#20120227100836.608378.607 - ResponseFIR#20120227100836.607674.605 ResponseFIR#20120227100836.607845.606 - - - - - - - - - - - - - - - ResponsePAZ#20120227100834.890662.589 - ResponseFIR#20120227100834.889917.587 ResponseFIR#20120227100834.890079.588 - - - - - - - - - - - - - - - ResponsePAZ#20120119110404.174467.108 - ResponsePAZ#20120119110404.174552.109 - - - - - - - - - - - - ResponsePAZ#20120119110411.514002.185 - - - - - - - - - - ResponsePAZ#20120119110419.00675.309 - - - - - - - - - - ResponsePAZ#20120119110415.517365.248 - ResponsePAZ#20120119110415.517464.249 - - - - - - - - - ResponsePAZ#20120119110416.406839.264 - - - - - - - - - - ResponsePAZ#20120119110412.461164.201 - - - - - - - - - - ResponsePAZ#20120119110404.170985.92 - ResponsePAZ#20120119110404.171065.93 - - - - - - - - - - - - - - - ResponsePAZ#20120119110415.88727.254 - - - - - - - - - - - ResponseFIR#20120227113707.832599.771 - - - - - - - - - - - - - - - - ResponseFIR#20120119110433.788055.501 - - - - - - - - - - - - - - - - ResponseFIR#20120119110432.129757.479 - - - - - - - - - - - - - - - - ResponseFIR#20120119110429.101905.420 - - - - - - - - - - - - - - - ResponsePAZ#20120119110414.290931.238 - - - - - - - - - - - - - ResponsePAZ#20120119110407.558576.114 - ResponsePAZ#20120119110407.558669.115 - - - - - - - - - - ResponseFIR#20120119110439.929374.645 - - - - - - - - - - - - - - - ResponsePAZ#20120119110413.070402.224 - ResponsePAZ#20120119110413.070597.225 - - - - - - - - - - - - - - - - ResponseFIR#20120119110434.431165.513 - - - - - - - - - - - - - - - ResponsePAZ#20120119110416.147014.259 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -3.0967e-06 -2.94187e-05 -9.79035e-05 -0.00016222 -9.99283e-05 0.000120533 0.000261672 2.525e-05 -0.000410075 -0.000366483 0.000375892 0.000853738 -3.04906e-05 -0.00127548 -0.000910431 0.00127596 0.00215042 -0.00046129 -0.00333575 -0.00140852 0.00376857 0.00419175 -0.00264137 -0.0071971 -0.000643638 0.00917875 0.00608097 -0.00857334 -0.0127328 0.00397998 0.0186155 0.00520222 -0.0209287 -0.0181525 0.0166574 0.0322263 -0.0034639 -0.0429283 -0.0193155 0.0442837 0.0497625 -0.0293996 -0.0825606 -0.00933633 0.107491 0.0816138 -0.103051 -0.204092 -3.12053e-05 0.39021 0.589621 - - - - 0.000244141 0.00292969 0.0161133 0.0537109 0.12085 0.193359 0.225586 - - - - -3.0967e-06 -2.94187e-05 -9.79035e-05 -0.00016222 -9.99283e-05 0.000120533 0.000261672 2.525e-05 -0.000410075 -0.000366483 0.000375892 0.000853738 -3.04906e-05 -0.00127548 -0.000910431 0.00127596 0.00215042 -0.00046129 -0.00333575 -0.00140852 0.00376857 0.00419175 -0.00264137 -0.0071971 -0.000643638 0.00917875 0.00608097 -0.00857334 -0.0127328 0.00397998 0.0186155 0.00520222 -0.0209287 -0.0181525 0.0166574 0.0322263 -0.0034639 -0.0429283 -0.0193155 0.0442837 0.0497625 -0.0293996 -0.0825606 -0.00933633 0.107491 0.0816138 -0.103051 -0.204092 -3.12053e-05 0.39021 0.589621 - - - - 0.000244141 0.00292969 0.0161133 0.0537109 0.12085 0.193359 0.225586 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - 0.000244141 0.00292969 0.0161133 0.0537109 0.12085 0.193359 0.225586 - - - - -3.0967e-06 -2.94187e-05 -9.79035e-05 -0.00016222 -9.99283e-05 0.000120533 0.000261672 2.525e-05 -0.000410075 -0.000366483 0.000375892 0.000853738 -3.04906e-05 -0.00127548 -0.000910431 0.00127596 0.00215042 -0.00046129 -0.00333575 -0.00140852 0.00376857 0.00419175 -0.00264137 -0.0071971 -0.000643638 0.00917875 0.00608097 -0.00857334 -0.0127328 0.00397998 0.0186155 0.00520222 -0.0209287 -0.0181525 0.0166574 0.0322263 -0.0034639 -0.0429283 -0.0193155 0.0442837 0.0497625 -0.0293996 -0.0825606 -0.00933633 0.107491 0.0816138 -0.103051 -0.204092 -3.12053e-05 0.39021 0.589621 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - -7.01862e-10 2.57791e-09 1.05627e-08 1.38851e-08 -3.3252e-08 -1.09905e-07 -8.07416e-08 3.22664e-07 2.64288e-07 1.06677e-07 -1.25103e-06 2.24187e-07 7.04206e-07 1.37628e-06 -4.64812e-06 8.7398e-06 -1.51246e-05 2.53029e-05 -3.85647e-05 5.15277e-05 -5.61805e-05 3.80757e-05 2.4378e-05 -0.000158366 0.000392175 -0.000746049 0.00121864 -0.00177052 0.0023074 -0.00266617 0.00259604 -0.00177876 -8.94756e-05 0.00325516 -0.00767579 0.012782 -0.0171387 0.0187973 -0.0184698 0.0127882 -0.00236608 -0.0124829 0.0297771 -0.0462333 0.0575793 -0.0593383 0.0476806 -0.0209313 -0.0192712 0.0670548 -0.111447 0.13548 -0.114313 0.0387967 0.0707588 -0.202903 0.257181 -0.122033 -0.260836 0.517383 0.568809 0.164429 0.0133968 0.000150107 1.31549e-11 - - - - (0.0,0.0) (0.0,0.0) - (-0.898258,0.0) (-1.758,0.0) - - - - (1.0,0.0) - (0.999999,0.0) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (1.0,0.0) - (0.999999,0.0) - - - - - - - - - (1.0,0.0) - (0.999999,0.0) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - (1.0,0.0) - (0.999999,0.0) - - - - (1.0,0.0) - (0.999999,0.0) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-0.898258,0.0) (-1.758,0.0) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-1005.31,0.0) (-502.655,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - (1.0,0.0) - (0.999999,0.0) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - (0.0,0.0) (0.0,0.0) - (-1005.31,0.0) (-502.655,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-1005.31,0.0) (-502.655,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - - - - - - - - - - - (1.0,0.0) - (0.999999,0.0) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - - (0.0,0.0) (0.0,0.0) - (-502.655,0.0) (-1005.31,0.0) (-1130.97,0.0) (-0.0740159,0.0740159) (-0.0740159,-0.0740159) - - - - (0.0,0.0) (0.0,0.0) - (-4.33452,-4.54866) (-4.33452,4.54866) - - - \ No newline at end of file diff --git a/CODE/bin/arclinkfetch/bin/r b/CODE/bin/arclinkfetch/bin/r deleted file mode 100644 index e965726a..00000000 --- a/CODE/bin/arclinkfetch/bin/r +++ /dev/null @@ -1,16 +0,0 @@ -2012,05,18,00,00,0 2012,05,18,00,01,00 GL SEG EHZ 90 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL DSD HHZ 00 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL DHS HHZ 00 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL STG EHZ 90 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL CAG EHZ 90 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL SAV HHZ 00 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL MGG EHZ 90 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL TBG EHZ 90 -2012,05,18,00,00,0 2012,05,18,00,01,00 GL BBL EHZ 90 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ CPM EHZ 91 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ LAM HHZ 00 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ BAM EHZ 91 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ FDF HHZ 00 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ TTM EHZ 91 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ ZAM EHZ 91 -2012,05,18,00,00,0 2012,05,18,00,01,00 MQ TRM EHZ 91 diff --git a/CODE/bin/arclinkfetch/bin/z b/CODE/bin/arclinkfetch/bin/z deleted file mode 100644 index fc0506b2..00000000 --- a/CODE/bin/arclinkfetch/bin/z +++ /dev/null @@ -1,2 +0,0 @@ -2012,02,24,11,24,00 2012,02,24,11,25,00 PF FLR HH* 00 -2012,02,24,11,24,00 2012,02,24,11,25,00 PF DSO EH* 90 diff --git a/CODE/bin/arclinkfetch/share/seiscomp3af/arclink/lib/arclink_fetch.py b/CODE/bin/arclinkfetch/share/seiscomp3af/arclink/lib/arclink_fetch.py deleted file mode 100644 index e31bcfd4..00000000 --- a/CODE/bin/arclinkfetch/share/seiscomp3af/arclink/lib/arclink_fetch.py +++ /dev/null @@ -1,616 +0,0 @@ -#***************************************************************************** -# arclink_fetch.py -# -# ArcLink command-line client with routing support -# -# (c) 2009 Andres Heinloo, GFZ Potsdam -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2, or (at your option) any later -# version. For more information, see http://www.gnu.org/ -#***************************************************************************** - -import os -import sys -import datetime -import shutil -from optparse import OptionParser -from tempfile import TemporaryFile -from breqfast import BreqParser -from seiscomp import logs -from seiscomp.arclink.manager import * -from seiscomp.db import DBError -from seiscomp.db.generic.inventory import Inventory -from seiscomp.mseedlite import Input as MSeedInput, MSeedError -from seiscomp.fseed import SEEDVolume, SEEDError, _WaveformData - -VERSION = "1.2.1 (2011.269)" - -ORGANIZATION = "WebDC" -LABEL = "WebDC SEED Volume" - -verbosity = 1 - -class SeedOutput(object): - def __init__(self, fd, inv, resp_dict): - self.__fd = fd - self.__inv = inv - self.__resp_dict = resp_dict - self.__mseed_fd = TemporaryFile() - - def write(self, data): - self.__mseed_fd.write(data) - - def close(self): - try: - try: - seed_volume = SEEDVolume(self.__inv, ORGANIZATION, LABEL, - self.__resp_dict) - - self.__mseed_fd.seek(0) - for rec in MSeedInput(self.__mseed_fd): - seed_volume.add_data(rec) - - seed_volume.output(self.__fd) - - except (MSeedError, SEEDError, DBError), e: - logs.error("error creating SEED volume: " + str(e)) - - finally: - self.__mseed_fd.close() - self.__fd.close() - -class MSeed4KOutput(object): - def __init__(self, fd): - self.__fd = fd - self.__mseed_fd = TemporaryFile() - - def write(self, data): - self.__mseed_fd.write(data) - - def close(self): - try: - try: - wfd = _WaveformData() - - self.__mseed_fd.seek(0) - for rec in MSeedInput(self.__mseed_fd): - wfd.add_data(rec) - - wfd.output_data(self.__fd, 0) - - except (MSeedError, SEEDError, DBError), e: - logs.error("error reblocking Mini-SEED data: " + str(e)) - - finally: - self.__mseed_fd.close() - self.__fd.close() - -def show_status(request): - try: - logs.info("datacenter name: " + request.dcname) - rqstat = request.status() - except ArclinkError, e: - logs.error(str(e)) - return - - if rqstat.error: - req_status = "ERROR" - elif rqstat.ready: - req_status = "READY" - else: - req_status = "PROCESSING" - - IrequestCompressed = request.args.get("compression") - - logs.info("request ID: %s, Label: %s, Type: %s, Encrypted: %s, Args: %s" % \ - (rqstat.id, rqstat.label, rqstat.type, rqstat.encrypted, rqstat.args)) - logs.info("status: %s, Size: %d, Info: %s" % \ - (req_status, rqstat.size, rqstat.message)) - - for vol in rqstat.volume: - logs.info(" volume ID: %s, dcid: %s, Status: %s, Size: %d, Encrypted: %s, Info: %s" % \ - (vol.id, vol.dcid, arclink_status_string(vol.status), vol.size, vol.encrypted, vol.message)) - - for rqln in vol.line: - logs.info(" request: %s" % (rqln.content,)) - logs.info(" status: %s, Size: %d, Info: %s" % \ - (arclink_status_string(rqln.status), rqln.size, rqln.message)) - - logs.info("") - -def parse_native(req, input_file): - fd = open(input_file) - try: - rqline = fd.readline() - while rqline: - rqline = rqline.strip() - if not rqline: - rqline = fd.readline() - logs.debug("skipping empty request line") - continue - - rqsplit = rqline.split() - if len(rqsplit) < 3: - logs.error("invalid request line: '%s'" % (rqline,)) - rqline = fd.readline() - continue - - try: - start_time = datetime.datetime(*map(int, rqsplit[0].split(","))) - end_time = datetime.datetime(*map(int, rqsplit[1].split(","))) - except ValueError, e: - logs.error("syntax error (%s): '%s'" % (str(e), rqline)) - rqline = fd.readline() - continue - - network = rqsplit[2] - station = "." - channel = "." - location = "." - - i = 3 - if len(rqsplit) > 3 and rqsplit[3] != ".": - station = rqsplit[3] - i += 1 - if len(rqsplit) > 4 and rqsplit[4] != ".": - channel = rqsplit[4] - i += 1 - if len(rqsplit) > 5 and rqsplit[5] != ".": - location = rqsplit[5] - i += 1 - - while len(rqsplit) > i and rqsplit[i] == ".": - i += 1 - - constraints = {} - for arg in rqsplit[i:]: - pv = arg.split('=', 1) - if len(pv) != 2: - raise ArclinkHandlerError, "invalid request syntax" - - constraints[pv[0]] = pv[1] - - req.add(network, station, channel, location, start_time, end_time, - constraints) - - rqline = fd.readline() - - finally: - fd.close() - -def parse_breqfast(req, input_file): - parser = BreqParser() - parser.parse_email(input_file) - req.content = parser.reqlist - logs.debug("") - if parser.failstr: - logs.error(parser.failstr) - else: - logs.info("parsed %d lines from breqfast message" % len(req.content)) - -def add_verbosity(option, opt_str, value, parser): - global verbosity - verbosity += 1 - -def add_quietness(option, opt_str, value, parser): - global verbosity - verbosity -= 1 - -def process_options(): - parser = OptionParser(usage="usage: %prog [-h|--help] [OPTIONS] -u USER -o OUTPUTFILE REQUEST", version="%prog v" + VERSION, add_help_option=False) - - parser.set_defaults(address = "webdc.eu:18001", - request_format = "native", - data_format = "mseed", - no_resp_dict = False, - rebuild_volume = False, - proxymode = False, - timeout = 300, - retries = 5, - SSLpasswordFile = "dcidpasswords.txt") - - parser.add_option("-h", "--help", action="store_true", dest="showhelp", default=False) - parser.add_option("-l", "--longhelp", action="store_true", dest="showlonghelp", default=False) - - parser.add_option("-w","--password-file", type="string", dest="SSLpasswordFile", - help="file containing passwords used for decryption of encrypted data (default %default)") - - parser.add_option("-a", "--address", type="string", dest="address", - help="address of primary ArcLink node (default %default)") - - foptions = ("native", "breqfast") - parser.add_option("-f", "--request-format", type="choice", dest="request_format", choices=foptions, - help="request format: breqfast, native (default %default)") - - koptions = ("mseed", "mseed4k", "fseed", "dseed", "inv", "inventory") - parser.add_option("-k", "--data-format", type="choice", dest="data_format", choices=koptions, - help="data format: mseed, mseed4k, fseed, dseed, inv[entory] (default %default)") - - parser.add_option("-n", "--no-resp-dict", action="store_true", dest="no_resp_dict", - help="avoid using response dictionary (default %default)") - - parser.add_option("-g", "--rebuild-volume", action="store_true", dest="rebuild_volume", - help="rebuild SEED volume (default %default)") - - parser.add_option("-p", "--proxy", action="store_true", dest="proxymode", - help="proxy mode, no routing (default %default)") - - parser.add_option("-t", "--timeout", type="int", dest="timeout", - help="timeout in seconds (default %default)") - - parser.add_option("-x", "--retries", type="int", dest="retries", - help="download retries (default %default)") - - parser.add_option("-v", action="callback", callback=add_verbosity, - help="increase verbosity level") - - parser.add_option("-q", action="callback", callback=add_quietness, - help="decrease verbosity level") - - parser.add_option("-u", "--user", type="string", dest="user", - help="user's e-mail address") - - parser.add_option("-o", "--output-file", type="string", dest="output_file", - help="file where downloaded data is written") - - (options, args) = parser.parse_args() - - if options.showhelp or options.showlonghelp: - parser.print_help(); - if options.showlonghelp: - print """ -About ArcLink Protocol -====================== - -The ArcLink is a protocol used to request distributed archive seismological -data. Today it gives you access to several European data archives (European -Integrated Data Archive - EIDA) that are supporting the protocol developed by -GEOFON (geofon_dc@gfz-potsdam.de) at the GeoForschungZentrum, Potsdam, -Germany. - -You can find more information about it at the SeisComp3 and GEOFON web pages: - - * http://www.seiscomp3.org/ - * http://geofon.gfz-potsdam.de/ - -ArcLink Password File (for decryption) -====================================== - -In this file (default: dcidpasswords.txt) you can store your private passwords -given by different data centers. Each data center that you request encrypted -data will send you a different password. - -The format of the file is really simple: just the data center ID followed by -the password that you received. One data center ID and password per line. Any -empty lines or lines starting with # are ignored. - -Example: - -gfz password1 -odc password2 -ipgp password3 - -The data center ID and password can be found on the automatically generated -e-mail that you received from each data center. (You will only receive this -email if you have been authorized to download encrypted data, and you have -tried to download it.) - -Input File Format -================= - -ArcLink Fetch program supports two different input formats for the request -file. It supports the traditional BREQ FAST format, and its own native -format. Both formats contains the same information and they differ slightly. - -Native Format: --------------- - -The native format has the following format: - -YYYY,MM,DD,HH,MM,SS YYYY,MM,DD,HH,MM,SS Network Station Channel [Location] - -the Channel, Station and Location, can contains wildcards (*) and the Location -field is optional. For matching all locations please use the '*' symbol. - -Example: - -2010,02,18,12,00,00 2010,02,18,12,10,00 GE WLF BH* -2010,02,18,12,00,00 2010,02,18,12,10,00 GE VSU BH* 00 - -BREQ FAST Format: ------------------ - -The BREQ FAST format is a standard format used on seismology to request -data. Each header line start with '.' and the request lines have the following -format: - -Station Network {Time Start} {Time End} {Number of Channels} N x Channels Location - -Time Specification should have the following format: YYYY MM DD HH MM SS.TTTT - -Please read more about the BREQ FAST format at: - -http://www.iris.edu/manuals/breq_fast.htm - -""" - sys.exit() - - errors = [] - warnings = [] - if options.user == None: - errors.append("Username required") - - if options.output_file == None: - errors.append("Output file required") - - if options.data_format.upper() != "FSEED" and options.rebuild_volume: - errors.append("-g is only applicable to FSEED format") - - if len(args) == 0: - errors.append("No request file supplied") - else: - for reqfile in args: - if not os.path.exists(reqfile): - errors.append("Request file '%s' not found." % reqfile) - - SSLpasswordDict = {} - if os.path.exists(options.SSLpasswordFile): - fd = open(options.SSLpasswordFile) - line = fd.readline() - while line: - line = line.strip() - if line and line[0] != "#": - try: - (dcid, password) = line.split() - SSLpasswordDict[dcid] = password - except ValueError: - logs.error(options.SSLpasswordFile + " invalid line: " + line) - fd.close() - sys.exit() - line = fd.readline() - else: - if options.SSLpasswordFile != parser.defaults['SSLpasswordFile']: - errors.append("Supplied password file (%s) not found" % options.SSLpasswordFile) - else: - warnings.append("Default password file (%s) not found" % options.SSLpasswordFile) - - - if len(errors) > 0: - logs.error("\n** ArcLink Fetch %s **\n" % VERSION) - parser.print_usage() - logs.error("Errors detected on the command line:") - for item in errors: - logs.error("\t%s" % item) - print "" - - if len(warnings) > 0: - logs.debug("Warnings detected on the command line:") - for item in warnings: - logs.debug("\t%s" % item) - print "" - - if len(errors) > 0: - sys.exit() - - return (SSLpasswordDict, options.address, options.request_format, options.data_format, - not options.no_resp_dict, options.rebuild_volume, options.proxymode, options.user, - options.timeout, options.retries, options.output_file, args[0]) - -def build_filename(encrypted, compressed, req_args): - endung = '' - if compressed is True: - endung = '.bz2' - elif compressed is None and req_args.has_key("compression"): - endung = '.bz2' - - if encrypted: - endung = endung + '.openssl' - return endung; - -def main(): - (SSLpasswordDict, addr, request_format, data_format, resp_dict, rebuild_volume, proxymode, user, timeout, retries, output_file, input_file) = process_options() - - reblock_mseed = False - use_inventory = False - use_routing = not proxymode - - req_args = {"compression": "bzip2"} - - if data_format.upper() == "MSEED": - req_type = "WAVEFORM" - req_args["format"] = "MSEED" - - elif data_format.upper() == "MSEED4K": - req_type = "WAVEFORM" - req_args["format"] = "MSEED" - reblock_mseed = True - - elif data_format.upper() == "FSEED": - req_type = "WAVEFORM" - if rebuild_volume: - req_args["format"] = "MSEED" - else: - req_args["format"] = "FSEED" - - elif data_format.upper() == "DSEED": - req_type = "RESPONSE" - use_routing = False - - elif len(data_format) >= 3 and data_format.upper() == "INVENTORY"[:len(data_format)]: - req_type = "INVENTORY" - req_args["instruments"] = "true" - use_routing = False - - else: - logs.error("unsupported data format: %s" % (data_format,)) - return 1 - - if resp_dict: - req_args["resp_dict"] = "true" - else: - req_args["resp_dict"] = "false" - - - mgr = ArclinkManager(addr, user, socket_timeout=timeout, download_retry=retries) - req = mgr.new_request(req_type, req_args) - - if request_format == "native": - parse_native(req, input_file) - - elif request_format == "breqfast": - parse_breqfast(req, input_file) - - else: - logs.error("unsupported request format: %s" % (request_format,)) - return 1 - - if not req.content: - logs.error("empty request") - return 1 - - wildcards = False - for i in req.content: - for j in i[:4]: - if j.find("*") >= 0 or j.find("?") >= 0: - wildcards = True - break - - if rebuild_volume or wildcards: - use_inventory = True - - try: - (inv, req_ok, req_noroute, req_nodata) = mgr.execute(req, use_inventory, use_routing) - - except ArclinkError, e: - logs.error(str(e)) - return - -## Better report what was going on - if verbosity > 1: - logs.info("\nthe following data requests were sent:\n") - for req in req_ok: - show_status(req) - - if req_nodata: - logs.info("\nthe following entries returned no data:\n") - req_nodata.dump(sys.stdout) - - if req_noroute: - logs.info("\nthe following entries could not be routed:\n") - req_noroute.dump(sys.stdout) - else: - if req_nodata: - logs.info('some requests returned NODATA') - - if req_noroute: - logs.warning('some requests could not be routed') - - warn = False - for req in req_ok: - for vol in req.status().volume: - for line in vol.line: - if (line.size == 0): - warn = True - if warn: - logs.warning('some lines returned NODATA') - -## Prepare to download - canJoin = True - volumecount = 0 - - if req_type == "WAVEFORM" and req_args.get("format") != "MSEED": - canJoin = False - - for req in req_ok: - for vol in req.status().volume: - if (arclink_status_string(vol.status) == "OK" or arclink_status_string(vol.status) == "WARNING") and vol.size > 0: - volumecount += 1 - if vol.encrypted and (vol.dcid not in SSLpasswordDict): - canJoin = False - if arclink_status_string(vol.status) == "WARNING": - logs.warning("\nsome requests returned a Warning status.") - - if volumecount == 0: - logs.warning("\nnone of the requests returned data.\n") - return 1 - - if not canJoin and volumecount > 1: - logs.warning('cannot merge volumes saving volumes as individual files') - -## Download - if canJoin: - filename = output_file - fd_out = open(filename, "wb") - if rebuild_volume: - logs.info("rebuilding SEED volume") - fd_out = SeedOutput(fd_out, inv, resp_dict) - elif reblock_mseed: - logs.info("reblocking Mini-SEED data") - fd_out = MSeed4KOutput(fd_out) - - for req in req_ok: - for vol in req.status().volume: - if vol.size == 0 or (arclink_status_string(vol.status) != "OK" and arclink_status_string(vol.status) != "WARNING"): - continue - try: - req.download_data(fd_out, vol.id, block=True, purge=False, password=SSLpasswordDict.get(vol.dcid)) - except ArclinkError, e: - logs.error('error on downloading request: ' + str(e)) - try: - req.purge() - except ArclinkError, e: - logs.error('error on purging request: ' + str(e)) - - fd_out.close() - logs.warning("saved file: %s" % filename) - - else: - if rebuild_volume: - logs.warning('cannot rebuild volume, saving file as received MiniSeed') - elif reblock_mseed: - logs.warning('cannot reblock MSEED, saving file as received MiniSeed') - - for req in req_ok: - for vol in req.status().volume: - if vol.size == 0 or (arclink_status_string(vol.status) != "OK" and arclink_status_string(vol.status) != "WARNING"): - continue - - filename = None - fd_out = None - try: - filename = str("%s.%s.%s" % (output_file, req.id, vol.id)) - fd_out = open(filename, "wb") - req.download_data(fd_out, vol.id, block=True, purge=False, password=SSLpasswordDict.get(vol.dcid)) - endung = build_filename(req.encStatus, req.decStatus, req_args) - if endung is not None: - os.rename(filename, filename + endung) - filename = filename + endung - logs.warning("saved file: %s" % filename) - fd_out.close() - except ArclinkError, e: - logs.error('error on downloading request: ' + str(e)) - filename = None - if fd_out is not None and not fd_out.closed: - fd_out.close() - - try: - req.purge() - except ArclinkError, e: - logs.error('error on purging request: ' + str(e)) - -def _debug(s): - if verbosity > 1: - print s - sys.stdout.flush() - -def _info(s): - if verbosity > 0: - print s - sys.stdout.flush() - -if __name__ == "__main__": - logs.info = _info - logs.debug = _debug - sys.exit(main()) diff --git a/CODE/bin/arclinkfetch/share/seiscomp3af/arclink/lib/breqfast.py b/CODE/bin/arclinkfetch/share/seiscomp3af/arclink/lib/breqfast.py deleted file mode 100644 index 1bdcd481..00000000 --- a/CODE/bin/arclinkfetch/share/seiscomp3af/arclink/lib/breqfast.py +++ /dev/null @@ -1,1053 +0,0 @@ -############################################################################# -# breqfast.py # -# # -# Processing breq_fast requests. # -# # -# (c) 2006 Doreen Pahlke, GFZ Potsdam # -# (c) 2007 Mathias Hoffmann, GFZ Potsdam # -# # -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the # -# Free Software Foundation; either version 2, or (at your option) any later # -# version. For more information, see http://www.gnu.org/ # -# # -############################################################################# - -# changes 2011.234, MB&Andres -# * Added support to multiples files in the case where no join is possible -# (proxy + encryption). -# * Created a BASEDIR variable pointing to base installation - -# changes 2008.046, Mathias Hoffmann -# -# - allow trailing colon in header token (e.g. .MEDIA: ) -# - allow network and station wildcards (limited to e.g.: ? * ??? * SN* *AA SN?? etc.) -# - more detailed error message, if request is too large -# - calculate file size only from available data -# -# - -import os, shutil, datetime, poplib, smtplib, sys, StringIO, commands, fnmatch -from sets import Set -from re import * -from time import * -from types import * -from email.MIMEText import MIMEText -from seiscomp import logs -from seiscomp.fseed import * -from seiscomp.arclink.manager import * -from seiscomp.db import DBError -from seiscomp.db.generic.inventory import Inventory -import seiscomp.mseedlite as mseed - - -DEFAULT_HOST = "localhost" -DEFAULT_PORT = 18001 -DEFAULT_USER = "sysop" -ORGANIZATION = "WebDC" -SEED_LABEL = "WebDC SEED Volume" -ARCLINK_TIMEOUT = 100 -ARCLINK_TIMEOUT_CHECK = 5 -SOCKET_TIMEOUT = 100 -REQUEST_TIMEOUT = 1800 -REQUEST_WAIT = 10 - -BASEDIR = "/home/sysop/breqfast2" - -BREQ_DIR = BASEDIR+"/breq" -SPOOL_DIR = BASEDIR+"/spool" -ACC_DIR = BASEDIR+"/lib" - -FTP_DIR = BASEDIR+"/data" -FTP_URL = "ftp://ftp.webdc.eu/breqfast" - -SMTP_SERVER = "smtp-server.gfz-potsdam.de" -EMAIL_ADDR = "breqfast@webdc.eu" -EMAIL_FROM = "WebDC " - -LABEL = "breq_req" - -FORMAIL_BIN = "/usr/bin/formail" -SENDMAIL_BIN = "/usr/sbin/sendmail" - -VERSION = "0.8 (2011.234)" - -class BreqParser(object): - """ - Parses the breq_fast email format using regular expressions. - - @classvaribales: __tokenrule, defines the syntax of the beginning of a Breq_fast header token - __tokenlist, specifies the tokens required for the ArcLink request - __reqlist, defines the syntax for a request line in Breq_fast format - """ - __tokenrule="^\.[A-Z_]+[:]?\s" - - __tokenlist=( - "\.NAME\s+(?P.+)", - "\.INST\s+(?P.+)?", - "\.EMAIL\s+(?P.+[@].+)", - "\.LABEL\s+(?P