Commit b7aa1511 authored by Carlo Marcocci's avatar Carlo Marcocci
Browse files

modificato l'output, a seconda del formato passato 0 le ampiezze dopo le fasi,...

modificato l'output, a seconda del formato passato 0 le ampiezze dopo le fasi, 1 le sole fasi senza nessuna ampiezza
parent 3222ca69
......@@ -5,6 +5,12 @@ $debug = $argv[1];
$outputformat = $argv[2];
$fk_hypocenter = $argv[3];
/*
outputformat
0 con le ampiezze scritte sotto le fasi con codice di fase A e 999 in amp e i valori veri a fine riga
1 solo le fasi, senza letture delle ampiezze
*/
/*
echo "*FK_HYPOCENTER\t$fk_hypocenter\n\n";
echo "\n\n";
......@@ -137,8 +143,6 @@ foreach ($hlists as $hlist) {
// output data of each row
// echo "\n12345678_1_2345678_2_2345678_3_2345678_4_2345678_5_2345678_6_2345678_7_2345678_8_23456789\n";
foreach ($results as $row) {
switch ($outputformat) {
case 0:
echo str_pad($row["sta4"],4) .
str_pad($row["phase_code"],1) .
str_pad($row["firstmotion"],1) .
......@@ -163,38 +167,6 @@ foreach ($hlists as $hlist) {
str_pad($row["net"],2) .
str_pad($row["loc"],2) .
"\n";
break;
case 1:
echo str_pad($row["sta4"],4) .
str_pad($row["phase_code"],1) .
str_pad($row["firstmotion"],1) .
str_pad($row["w"],1) .
str_pad($row["cha"],1) .
$row["ptime"] .
$row["psec"] .
" " .
str_pad($row["scent"],5) .
str_pad($row["scode"],2) .
" " . // da manuale 1X
str_pad($row["sw"],1) .
" " . // datasource code, A1 3X
str_pad($row["amp"],3) .
" ". // str_pad($row["per"],3) il periodo è sempre -1
" ". // 21 blanc
str_pad($row["dur"],4) .
" ".
str_pad($row["sta5"],1) .
str_pad($row["cha3"],3) .
str_pad($row["net"],2) .
str_pad($row["loc"],2) .
"#". // col 86 additional fields
str_pad($row["ampfull"],20) .
str_pad($row["amp_mag"],20) .
"\n";
break;
default:
echo "ERROR";
}
} // foreach ph
if ($debug==1) {
......@@ -210,9 +182,8 @@ foreach ($hlists as $hlist) {
// echo "\n-----------------------------\n";
// output data of each row AMPLITUDE
foreach ($results as $row) {
switch ($outputformat) {
case 0:
if ($outputformat==0) {
foreach ($results as $row) {
echo str_pad($row["sta4"],4) .
str_pad($row["phase_code"],1) .
str_pad($row["firstmotion"],1) .
......@@ -238,40 +209,8 @@ foreach ($hlists as $hlist) {
"#". // col 86 additional fields
str_pad($row["ampfull"],20) .
"\n";
break;
case 1:
echo str_pad($row["sta4"],4) .
str_pad($row["phase_code"],1) .
str_pad($row["firstmotion"],1) .
str_pad($row["w"],1) .
str_pad($row["cha"],1) .
$row["ptime"] .
$row["psec"] .
" " .
str_pad($row["scent"],5) .
str_pad($row["scode"],2) .
" " . // da manuale 1X
str_pad($row["sw"],1) .
" " . // datasource code, A1 3X
str_pad($row["amp"],3) .
" ". // str_pad($row["per"],3) il periodo è sempre -1
" ". // 21 blanc
str_pad($row["dur"],4) .
" ".
str_pad($row["sta5"],1) .
str_pad($row["cha3"],3) .
str_pad($row["net"],2) .
str_pad($row["loc"],2) .
"#". // col 86 additional fields
str_pad($row["ampfull"],20) .
str_pad($row["amp_mag"],20) .
"\n";
break;
default:
echo "ERROR";
}
} // foreach amp
} // foreach amp
}
echo " 10 #ide=$eid hid=$id_fk_hypocenter ot=$ot lat=$lat lon=$lon dep=$depth mag=$mag mag_type=$mag_type errh=$errh errz=$errz gap=$gap rms=$rms min_dist=$min_distance nph=$nph nph_s=$nph_s reg=$region \n"; // per hypoinvrse
}
// Close connection
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment