📄 dep2dat.c
字号:
/* * This file is part of tomo3d * * Copyright (C) 2002, 2003, Sebastien Judenherc <sebastien.judenherc@na.infn.it> * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * */#include <stdio.h>#include <stdlib.h>#include <stdio.h>#include <time.h>#include <sismoutil.h>#include <iasp.h>#define OK fprintf(stderr,"FILE %s LINE %d\n",__FILE__,__LINE__);int main(int argc,char **argv){ struct dep_t *dep=NULL; struct stainfo *sinf=NULL; struct ttime tt; FLOAT64 T0,now; FLOAT64 az,baz,dist; INT32 i,j; ALLOW_I=1; argv=parseoptions(&argc,argv); if (argc<0) { argc*=-1; goto error; } if (argc<2) { badargnum(); goto usage; } now=(double)time(NULL); for (i=1; i<argc; i++) { if (VERBOSE) printlog("reading %s\n",argv[i]); T0=now; dep=readrenassdep(argv[i],dep,&T0); if (!dep) continue; if (!(dep->status&(LOCLOC|LOCTOK))) { printwarning("location for %s might be wrong\n",dep->name); } for (j=0; j<dep->Npck; j++) { INT32 ii; for (sinf=NULL,ii=0; (ii<10)&&(sinf==NULL); ii++) { if (!sinf) { sinf=getcodeinfo(NULL, dep->pck[j].sta, ii, T0); } } if (!sinf) { printerror("%s not found (%s) skipping\n", dep->pck[j].sta,dep->name); continue; } if (distaz(sinf->lat,sinf->lon,dep->lat, dep->lon, &dist,NULL,&az,&baz)) { printerror("cannot compute distance for %s, %s. Please correct\n", dep->name,sinf->code); continue; } if (!wmtptt("P",dist,dep->dep,&tt)) { printerror("cannot get travel time for %s, %s. Please correct\n", dep->name,sinf->code); continue; } printf("%-5s %7.3f %7.3f %5.0f ", sinf->code,sinf->lat,sinf->lon,sinf->elev); printf("%3d %7.2f %7.2f %4.0f ",i,dep->lat,dep->lon,dep->dep); printf("%5.2f %5.2f %5.2f ",dist,baz,az); printf("%14.3f %8.3f %8.3f %7.3f %7.3f ", dep->T0,dep->pck[j].Tobs-dep->T0,tt.mtt[0], dep->pck[j].Tobs-dep->T0-tt.mtt[0],tt.mdtdd[0]); printf("%.8s %s\n",tt.mphase[0],dep->name); freestainfo(sinf); } } return(0);error: badarg(argv[i]);usage: printbaseoptions("file1.dep file2.dep ..."); return(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -