00001 #ifndef __SEAM_TRACEIO
00002 #define __SEAM_TRACEIO
00003
00004
00005 #define IWAVE_USE_FMGR
00006
00007 #include "utils.h"
00008 #include "usempi.h"
00009 #include "cubic.h"
00010
00011 #ifdef IWAVE_USE_FMGR
00012 #include "iwave_fopen.h"
00013 #endif
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018 #include "su.h"
00019 #include "header.h"
00020 #include "segy.h"
00021 #ifdef __cplusplus
00022 }
00023 #endif
00024
00025
00026 #define MAX_TRACES 500000
00027
00028 #define MAX_RECS 1000
00029
00030 #define SRC_TOL 0.001
00031
00032 #define W_EOF -10
00033
00034 void mygethdval(segy * tr, const char * ch, Value * val);
00035 void myputhdval(segy * tr, const char * ch, Value * val);
00036
00037 typedef struct s_offsegy {
00038 off_t m;
00039 segy tr;
00040 } offsegy;
00041
00060 typedef struct s_tracegeom {
00061
00063 int nrec;
00065 int irec;
00067 int xrec;
00069 int first;
00071 int last;
00073
00074 int * ntr;
00076
00077 off_t * recoff;
00079
00080 RPNT * src;
00082 int ntraces;
00084
00085 IPNT * ig;
00087
00088 RPNT * rg;
00090 IPNT is;
00092 RPNT rs;
00094 IPNT axord;
00096 int nt;
00098 int ntout;
00100 float dt;
00102 float dtout;
00104 int dtmus;
00106 float tmax;
00108 float t0;
00110 float t0out;
00112
00113 int * tracl;
00115
00116 int * tracr;
00118
00119 int * fldr;
00121
00122 int * tracf;
00124 int scalel;
00126 int scalco;
00128 float * buf;
00130 int interp;
00132 int ndim;
00134 ireal dvol;
00136 FILE * fpin;
00138
00139 off_t * troff;
00140 #ifdef IWAVE_USE_MPI
00141
00142 MPI_Datatype p;
00143 #endif
00144 } tracegeom;
00145
00168 int construct_tracegeom(tracegeom * tg,
00169 const char * fin,
00170 float dt,
00171 float tol,
00172 FILE * stream);
00173
00280
00281 int init_tracegeom(tracegeom * tg,
00282 int irec,
00283 RPNT og,
00284 IPNT n, RPNT d, RPNT o,
00285 IPNT axord,
00286 int order,
00287 int ndim,
00288 int initbuf,
00289 FILE * stream);
00290
00293 void destroy_tracegeom(tracegeom * tg);
00294
00300 void setnull_tracegeom(tracegeom * tg);
00301
00303 void fprint_tracegeom(tracegeom const * tg, FILE * fp);
00304
00306 void print_tracegeom(tracegeom const * tg);
00307
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373 void sampletraces(tracegeom * tg,
00374 int order,
00375 int load,
00376 int it,
00377 IPNT allocstrides,
00378 IPNT allocorigs,
00379 IPNT strides,
00380 IPNT origs,
00381 ireal * field,
00382
00383
00384
00385
00386
00387 ireal mult);
00388
00389 void tapermutetraces(tracegeom * tg,
00390 int it,
00391 float dx,
00392 int width,
00393 int wtime,
00394 float mslope,
00395 float mzotime,
00396 float mwidth);
00397
00412 int writetraces(tracegeom const * tg,
00413 RPNT d,
00414 RPNT og,
00415 FILE * stream);
00416
00417
00418
00419 void calc_group(int * first, int * last, int nrec);
00420
00428 void indexrange(tracegeom const * tg,
00429 IPNT gmin,
00430 IPNT gmax);
00431
00432 #endif