#include #include #include #include "segy.h" #include "defs.h" #include "larsemod.h" main() { int n,i,nt; int ngather=0; int splast=-1; char x[64004]; /* x= input - original data (segy data); */ char y[65000]; /* y=sis header + data */ struct segy *segyhead; struct traceinfo *sishead; struct LarseHead *larsehead; float *segydata; float *sisdata; double cos(); nt= 15001; segyhead=(struct segy*)(x); larsehead=(struct LarseHead*)(x); segydata= (float *)(&x[240 + 2000]); sishead=(struct traceinfo*)(y); sisdata= (float *)(&y[TRSIZE]); while ((n=read(0,x,64000)) >=0) { if(n==400) continue; if(n==3200) continue; if(n==0) break; ngather++; for (i=0;i<240;i++) y[i]=x[i]; if((segyhead->sp != splast) && (splast >=0)) { writeeof(1); ngather=1; } if ((larsehead->component)==1) { splast=segyhead->sp; /* source x coordinate UTM scale */ sishead->xs=larsehead->utmSrcX; /* source y coordinate UTM */ sishead->ys=larsehead->utmSrcY; sishead->zs=segyhead->szsurf; /* surface elevation at source */ /* x receiver group coordinate UTM scale */ sishead->xr=larsehead->utmRecX; /* y receiver group coordinate UTM scale */ sishead->yr=larsehead->utmRecY; sishead->zr=segyhead->gz; /* elevation at receiver group */ sishead->t0=0.0; sishead->samplerate=0.004; sishead->srcflagnum=segyhead->sp; /* shotpoint */ sishead->recflagnum=larsehead->fieldStakeNum; /*receiver*/ sishead->status=INIT; sishead->gain=1.0; sishead->dtstatic=0.0; sishead->nt=(7600); /*30 seconds for larse shot gathers */ for(i=0;iuser[i]=0; ibm2ieee(segydata,&nt); /*data IEEE float */ for (i=0;int;i++) sisdata[i]=(segydata[i]); write(1,y,TRSIZE+4*sishead->nt); } } }