Commit b15a550c authored by tilman.metz's avatar tilman.metz

Stopped support for segy and simplified the output

Segy isn't used in our working group and therfore not tested.
Also an segy Input for the obeserved seismograms is missing.
In future options for reading binary and ascii seismograms should be implemented
parent c9e22a3e
...@@ -191,12 +191,9 @@ The last option (\textbf{READREC}=2) is very attractive for 3D FWI because it de ...@@ -191,12 +191,9 @@ The last option (\textbf{READREC}=2) is very attractive for 3D FWI because it de
\end{verbatim} \end{verbatim}
For the seismogram output every \textbf{NDT}th sample is written to file starting at timestep \textbf{NDTSHIFT} of the FD modeling. The file format can be choosen with \textbf{SEIS\_FORMAT}:\\ For the seismogram output every \textbf{NDT}th sample is written to file starting at timestep \textbf{NDTSHIFT} of the FD modeling. The file format can be choosen with \textbf{SEIS\_FORMAT}:\\
0: SEG-Y (ASCII-text/native 4-byte-floats (IEEE on PC)/little endian on PC)\\
1: SU (native 4-byte-floats (IEEE on PC)/little endian on PC)\\ 1: SU (native 4-byte-floats (IEEE on PC)/little endian on PC)\\
2: TEXTUAL (native ASCII)\\ 2: TEXTUAL (native ASCII)\\
3: BINARY (IEEE-4-byte-floats on PC/little endian on PC)\\ 3: BINARY (IEEE-4-byte-floats on PC/little endian on PC)\\
4: SEG-Y (ASCII-text/native 4-byte-floats (IEEE on PC)/little endian on PC)\\
5: SEG-Y (ASCII-text/IBM-4-byte-floats on PC/big endian on PC) \\
We recommend the use of the SU-format. This format stores a header in front of each trace with information like time sampling, source and receiver position and tracenumber. Seismic Unix offers different functions for data processing of SU-files.\\ We recommend the use of the SU-format. This format stores a header in front of each trace with information like time sampling, source and receiver position and tracenumber. Seismic Unix offers different functions for data processing of SU-files.\\
The seismograms are stored for each component, each shot and each iteration in the folder \textit{su}. \textbf{SEIS\_FILE} defines the name of the files, here for example \textit{cal\_toy\_vx\_it3.su.shot2} The seismograms are stored for each component, each shot and each iteration in the folder \textit{su}. \textbf{SEIS\_FILE} defines the name of the files, here for example \textit{cal\_toy\_vx\_it3.su.shot2}
\subsubsection*{Snapshots} \subsubsection*{Snapshots}
......
...@@ -94,7 +94,6 @@ IFOS_UTIL = \ ...@@ -94,7 +94,6 @@ IFOS_UTIL = \
writedsk.c \ writedsk.c \
writemod.c \ writemod.c \
writepar.c \ writepar.c \
rwsegy.c \
IFOS_SRC = \ IFOS_SRC = \
ifos3d.c \ ifos3d.c \
......
...@@ -45,7 +45,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r ...@@ -45,7 +45,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r
extern int NX, NY, NZ, L, MYID, IDX, IDY, IDZ, FW, POS[4], NT, NDT, NDTSHIFT; extern int NX, NY, NZ, L, MYID, IDX, IDY, IDZ, FW, POS[4], NT, NDT, NDTSHIFT;
extern int FDCOEFF; extern int FDCOEFF;
extern int READREC, NPROCX,NPROCY,NPROCZ, FW, ABS_TYPE, SRCREC, FREE_SURF; extern int READREC, NPROCX,NPROCY,NPROCZ, FW, ABS_TYPE, SRCREC, FREE_SURF;
extern int SNAP, SEISMO, SEIS_FORMAT[6], SNAP_FORMAT; extern int SNAP, SEISMO, SEIS_FORMAT, SNAP_FORMAT;
extern int NSHOTS_STEP; extern int NSHOTS_STEP;
/*extern int RUN_MULTIPLE_SHOTS; no determination is done for the output check whether the simulation runs with one or multiple shot /*extern int RUN_MULTIPLE_SHOTS; no determination is done for the output check whether the simulation runs with one or multiple shot
-> directorys specified in input file should work in both cases */ -> directorys specified in input file should work in both cases */
...@@ -308,16 +308,14 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r ...@@ -308,16 +308,14 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r
/*Checking SEISMOGRAM Output Particle velocities */ /*Checking SEISMOGRAM Output Particle velocities */
/*-------------------------------------- */ /*-------------------------------------- */
if (SEISMO>0) { if (SEISMO>0) {
switch (SEIS_FORMAT[0]){ switch (SEIS_FORMAT){
case 0: sprintf(file_ext,"sgy"); break; case 0: sprintf(file_ext,"su"); break;
case 1: sprintf(file_ext,"su"); break; case 1: sprintf(file_ext,"su"); break;
case 2: sprintf(file_ext,"txt"); break; case 2: sprintf(file_ext,"txt"); break;
case 3: sprintf(file_ext,"bin"); break; case 3: sprintf(file_ext,"bin"); break;
case 4: sprintf(file_ext,"sgy"); break;
case 5: sprintf(file_ext,"sgy"); break;
} }
/*if ((RUN_MULTIPLE_SHOTS)||(SEIS_FORMAT[4])) { /*if ((RUN_MULTIPLE_SHOTS)||(SEIS_FORMAT)) {
possibly many files ... -> perform check of write and execute permission for directories, only possibly many files ... -> perform check of write and execute permission for directories, only
fprintf(fp," Check accessibility for seismogram files (multiple shots) ... \n"); fprintf(fp," Check accessibility for seismogram files (multiple shots) ... \n");
...@@ -354,7 +352,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r ...@@ -354,7 +352,7 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r
fprintf(fp," Check accessibility for seismogram files ... \n"); fprintf(fp," Check accessibility for seismogram files ... \n");
if (SEIS_FORMAT[0]==2) strcpy(xmod,"a"); if (SEIS_FORMAT==2) strcpy(xmod,"a");
else strcpy(xmod,"ab"); else strcpy(xmod,"ab");
switch (SEISMO){ switch (SEISMO){
case 1: /* particle velocities only */ case 1: /* particle velocities only */
......
...@@ -31,7 +31,7 @@ void exchange_par(void){ ...@@ -31,7 +31,7 @@ void exchange_par(void){
extern float XREC1, XREC2, YREC1, YREC2, ZREC1, ZREC2; extern float XREC1, XREC2, YREC1, YREC2, ZREC1, ZREC2;
extern float ALPHA, BETA, VPPML; extern float ALPHA, BETA, VPPML;
extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST; extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST;
extern int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT[6], FREE_SURF, READMOD, READREC; extern int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT, FREE_SURF, READMOD, READREC;
extern int BOUNDARY, REC_ARRAY, LOG, IDX, IDY, IDZ, ABS_TYPE; extern int BOUNDARY, REC_ARRAY, LOG, IDX, IDY, IDZ, ABS_TYPE;
extern float TSNAP1, TSNAP2, TSNAPINC, FW, REFREC[4], DAMPING, FPML; extern float TSNAP1, TSNAP2, TSNAPINC, FW, REFREC[4], DAMPING, FPML;
extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE]; extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE];
...@@ -123,12 +123,8 @@ void exchange_par(void){ ...@@ -123,12 +123,8 @@ void exchange_par(void){
idum[27] = NDT; idum[27] = NDT;
idum[28] = NDTSHIFT; idum[28] = NDTSHIFT;
idum[29] = SEIS_FORMAT[0]; idum[29] = SEIS_FORMAT;
idum[30] = SEIS_FORMAT[1];
idum[31] = SEIS_FORMAT[2];
idum[32] = SEIS_FORMAT[3];
idum[33] = SEIS_FORMAT[4];
idum[34] = SEIS_FORMAT[5];
idum[35] = RUN_MULTIPLE_SHOTS; idum[35] = RUN_MULTIPLE_SHOTS;
idum[36] = SNAP_PLANE; idum[36] = SNAP_PLANE;
...@@ -252,12 +248,7 @@ void exchange_par(void){ ...@@ -252,12 +248,7 @@ void exchange_par(void){
NDT = idum[27]; NDT = idum[27];
NDTSHIFT = idum[28]; NDTSHIFT = idum[28];
SEIS_FORMAT[0] = idum[29]; SEIS_FORMAT = idum[29];
SEIS_FORMAT[1] = idum[30];
SEIS_FORMAT[2] = idum[31];
SEIS_FORMAT[3] = idum[32];
SEIS_FORMAT[4] = idum[33];
SEIS_FORMAT[5] = idum[34];
RUN_MULTIPLE_SHOTS= idum[35]; RUN_MULTIPLE_SHOTS= idum[35];
SNAP_PLANE= idum[36]; SNAP_PLANE= idum[36];
......
...@@ -119,7 +119,7 @@ void note(FILE *fp); ...@@ -119,7 +119,7 @@ void note(FILE *fp);
void outseis(FILE *fp, FILE *fpdata, int comp, float **section, void outseis(FILE *fp, FILE *fpdata, int comp, float **section,
int **recpos, int **recpos_loc, int ntr, float ** srcpos_loc, int **recpos, int **recpos_loc, int ntr, float ** srcpos_loc,
int nsrc, int ns, int seis_form[6]); int nsrc, int ns, int seis_form);
float *rd_sour(int *nts,FILE* fp_source); float *rd_sour(int *nts,FILE* fp_source);
......
...@@ -28,7 +28,7 @@ float DX, DY, DZ, TIME, DT, TS, PLANE_WAVE_DEPTH, PHI; ...@@ -28,7 +28,7 @@ float DX, DY, DZ, TIME, DT, TS, PLANE_WAVE_DEPTH, PHI;
float TSNAP1, TSNAP2, TSNAPINC, *FL, TAU, REC_ARRAY_DEPTH, REC_ARRAY_DIST; float TSNAP1, TSNAP2, TSNAPINC, *FL, TAU, REC_ARRAY_DEPTH, REC_ARRAY_DIST;
float XREC1, XREC2, YREC1, YREC2, ZREC1=0.0, ZREC2=0.0; float XREC1, XREC2, YREC1, YREC2, ZREC1=0.0, ZREC2=0.0;
float REFREC[4]={0.0, 0.0, 0.0, 0.0}, DAMPING=8.0, VPPML, FPML; float REFREC[4]={0.0, 0.0, 0.0, 0.0}, DAMPING=8.0, VPPML, FPML;
int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT[6]={0, 0, 0, 0, 0, 0}, FREE_SURF, READMOD, MOD_FORMAT, READREC, REC_ARRAY, LOG, FDORDER, FW=0, ABS_TYPE, BLOCK; int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT, FREE_SURF, READMOD, MOD_FORMAT, READREC, REC_ARRAY, LOG, FDORDER, FW=0, ABS_TYPE, BLOCK;
int NX, NY, NZ=1, NT, SOURCE_SHAPE, SOURCE_TYPE, SNAP, SNAP_FORMAT, BOUNDARY, SRCREC, SNAP_PLANE; int NX, NY, NZ=1, NT, SOURCE_SHAPE, SOURCE_TYPE, SNAP, SNAP_FORMAT, BOUNDARY, SRCREC, SNAP_PLANE;
float ALPHA, BETA; float ALPHA, BETA;
int NXG, NYG, NZG, IDX, IDY, IDZ, L=1, NX1, NX2, NY1, NY2, NZ1, NZ2, DRX, DRZ, RUN_MULTIPLE_SHOTS, FDCOEFF; int NXG, NYG, NZG, IDX, IDY, IDZ, L=1, NX1, NX2, NY1, NY2, NZ1, NZ2, DRX, DRZ, RUN_MULTIPLE_SHOTS, FDCOEFF;
......
...@@ -245,7 +245,7 @@ if(METHOD) nseismograms+=4; ...@@ -245,7 +245,7 @@ if(METHOD) nseismograms+=4;
if(HESS) memgrad+=3*fac2*fac3; if(HESS) memgrad+=3*fac2*fac3;
if(LBFGS) membfgs=NUMPAR*BFGSNUM*3*fac3; if(LBFGS) membfgs=NUMPAR*BFGSNUM*3*fac3;
} }
memtotal=memdyn+memmodel+memseismograms+membuffer+(buffsize*pow(2.0,-20.0))+memgrad+memdynf+membfgs; memtotal=memdyn+memmodel+memseismograms+membuffer+(buffsize*pow(2.0,-20.0))+memgrad+memdynf+membfgs+memcpml;
if (MYID==0){ if (MYID==0){
fprintf(FP,"\n ------------------ MEMORY ALLOCATION --------------------------- \n"); fprintf(FP,"\n ------------------ MEMORY ALLOCATION --------------------------- \n");
......
This diff is collapsed.
...@@ -33,14 +33,14 @@ void read_par_json(FILE *fp, char *fileinp) { ...@@ -33,14 +33,14 @@ void read_par_json(FILE *fp, char *fileinp) {
extern float DX, DY, DZ, TIME, DT, TS, *FL, TAU, PLANE_WAVE_DEPTH, PHI; extern float DX, DY, DZ, TIME, DT, TS, *FL, TAU, PLANE_WAVE_DEPTH, PHI;
extern float XREC1, XREC2, YREC1, YREC2, ZREC1, ZREC2, ALPHA, BETA; extern float XREC1, XREC2, YREC1, YREC2, ZREC1, ZREC2, ALPHA, BETA;
extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST; extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST;
extern int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT[6], FREE_SURF, READMOD, MOD_FORMAT, READREC, RUN_MULTIPLE_SHOTS; extern int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT, FREE_SURF, READMOD, MOD_FORMAT, READREC, RUN_MULTIPLE_SHOTS;
extern int BOUNDARY, REC_ARRAY, IDX, IDY, IDZ, ABS_TYPE; extern int BOUNDARY, REC_ARRAY, IDX, IDY, IDZ, ABS_TYPE;
extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4], DAMPING, FPML, VPPML; extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4], DAMPING, FPML, VPPML;
extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE]; extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE];
extern char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], REC_FILE[STRING_SIZE]; extern char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], REC_FILE[STRING_SIZE];
extern char SEIS_FILE[STRING_SIZE],GRAD_FILE[STRING_SIZE], SEIS_OBS_FILE[STRING_SIZE],INV_FILE[STRING_SIZE]; extern char SEIS_FILE[STRING_SIZE],GRAD_FILE[STRING_SIZE], SEIS_OBS_FILE[STRING_SIZE],INV_FILE[STRING_SIZE];
extern int NPROCX,NPROCY,NPROCZ; extern int NPROCX,NPROCY,NPROCZ;
extern int ASCIIEBCDIC,LITTLEBIG,IEEEIBM; extern int LITTLEBIG;
extern float REFSRC[3], SRCTSHIFT; extern float REFSRC[3], SRCTSHIFT;
extern int SRC_MF, SIGNAL_FORMAT; extern int SRC_MF, SIGNAL_FORMAT;
...@@ -505,35 +505,17 @@ void read_par_json(FILE *fp, char *fileinp) { ...@@ -505,35 +505,17 @@ void read_par_json(FILE *fp, char *fileinp) {
fprintf(fp," Variable NDTSHIFT is set to default value %d.\n",NDT); fprintf(fp," Variable NDTSHIFT is set to default value %d.\n",NDT);
} }
if (get_int_from_objectlist("SEIS_FORMAT",number_readobjects,&SEIS_FORMAT[0],varname_list, value_list)) { if (get_int_from_objectlist("SEIS_FORMAT",number_readobjects,&SEIS_FORMAT,varname_list, value_list)) {
err("Variable SEIS_FORMAT could not be retrieved from the json input file!"); err("Variable SEIS_FORMAT could not be retrieved from the json input file!");
} else { }
if (SEIS_FORMAT[0]==4) {
SEIS_FORMAT[0]=0;
}
if (SEIS_FORMAT[0]==5) {
SEIS_FORMAT[0]=0;
SEIS_FORMAT[1]=1;
SEIS_FORMAT[3]=1;
SEIS_FORMAT[4]=0;
SEIS_FORMAT[5]=0;
}
}
}/*end of seismo*/ }/*end of seismo*/
if (get_int_from_objectlist("ASCIIEBCDIC",number_readobjects,&ASCIIEBCDIC,varname_list, value_list)) {
ASCIIEBCDIC=0;
}
if (get_int_from_objectlist("LITTLEBIG",number_readobjects,&LITTLEBIG,varname_list, value_list)) { if (get_int_from_objectlist("LITTLEBIG",number_readobjects,&LITTLEBIG,varname_list, value_list)) {
LITTLEBIG=0; LITTLEBIG=0;
} }
if (get_int_from_objectlist("IEEEIBM",number_readobjects,&IEEEIBM,varname_list, value_list)) {
IEEEIBM=0;
}
/*================================= /*=================================
section inversion parameters section inversion parameters
......
This diff is collapsed.
...@@ -27,7 +27,7 @@ void saveseis(FILE *fp, float **sectionvx, float **sectionvy,float **sectionvz, ...@@ -27,7 +27,7 @@ void saveseis(FILE *fp, float **sectionvx, float **sectionvy,float **sectionvz,
float **sectionp, float **sectioncurl, float **sectiondiv, float **sectionp, float **sectioncurl, float **sectiondiv,
int **recpos, int **recpos_loc, int ntr, float ** srcpos, int ishot,int ns, int obs, int iteration){ int **recpos, int **recpos_loc, int ntr, float ** srcpos, int ishot,int ns, int obs, int iteration){
extern int SEISMO, SEIS_FORMAT[6], MYID, RUN_MULTIPLE_SHOTS,NPROC,METHOD; extern int SEISMO, SEIS_FORMAT, MYID, RUN_MULTIPLE_SHOTS,NPROC,METHOD;
extern char SEIS_FILE[STRING_SIZE], SEIS_OBS_FILE[STRING_SIZE]; extern char SEIS_FILE[STRING_SIZE], SEIS_OBS_FILE[STRING_SIZE];
extern FILE *FP; extern FILE *FP;
...@@ -41,14 +41,11 @@ int **recpos, int **recpos_loc, int ntr, float ** srcpos, int ishot,int ns, in ...@@ -41,14 +41,11 @@ int **recpos, int **recpos_loc, int ntr, float ** srcpos, int ishot,int ns, in
srcpos1=fmatrix(1,7,1,1); srcpos1=fmatrix(1,7,1,1);
for (nt=1;nt<=7;nt++) srcpos1[nt][1]=srcpos[nt][ishot]; for (nt=1;nt<=7;nt++) srcpos1[nt][1]=srcpos[nt][ishot];
switch (SEIS_FORMAT[0]){ switch (SEIS_FORMAT){
case 0: sprintf(file_ext,"sgy"); break; case 0: sprintf(file_ext,"su"); break;
case 1: sprintf(file_ext,"su"); break; case 1: sprintf(file_ext,"su"); break;
case 2: sprintf(file_ext,"txt"); break; case 2: sprintf(file_ext,"txt"); break;
case 3: sprintf(file_ext,"bin"); break; case 3: sprintf(file_ext,"bin"); break;
case 4: sprintf(file_ext,"sgy"); break;
case 5: sprintf(file_ext,"sgy"); break;
case 7: sprintf(file_ext,"su"); break;
} }
if(obs==0) sprintf(seisfile,"%s",SEIS_FILE); if(obs==0) sprintf(seisfile,"%s",SEIS_FILE);
......
...@@ -33,7 +33,7 @@ void writepar(FILE *fp, int ns) { ...@@ -33,7 +33,7 @@ void writepar(FILE *fp, int ns) {
extern float XREC1, XREC2, YREC1, YREC2, ZREC1, ZREC2; extern float XREC1, XREC2, YREC1, YREC2, ZREC1, ZREC2;
extern float ALPHA, BETA; extern float ALPHA, BETA;
extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST; extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST;
extern int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT[6], FREE_SURF; extern int SEISMO, NDT, NDTSHIFT, NGEOPH, SEIS_FORMAT, FREE_SURF;
extern int READMOD, READREC, DRX, DRZ, BOUNDARY, SRCREC, IDX, IDY, IDZ; extern int READMOD, READREC, DRX, DRZ, BOUNDARY, SRCREC, IDX, IDY, IDZ;
extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4], DAMPING; extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4], DAMPING;
extern char SNAP_FILE[STRING_SIZE], SOURCE_FILE[], SIGNAL_FILE[], REC_FILE[], SEIS_FILE[STRING_SIZE]; extern char SNAP_FILE[STRING_SIZE], SOURCE_FILE[], SIGNAL_FILE[], REC_FILE[], SEIS_FILE[STRING_SIZE];
...@@ -43,8 +43,8 @@ void writepar(FILE *fp, int ns) { ...@@ -43,8 +43,8 @@ void writepar(FILE *fp, int ns) {
extern int NP, NPROCX, NPROCY, NPROCZ, MYID; extern int NP, NPROCX, NPROCY, NPROCZ, MYID;
extern int ITMIN, ITMAX, FILT, NFMAX, TAST, NSHOTS_STEP, DAMPTYPE, HESS, READ_HESS, REC_HESS, LBFGS,EXTOBS; extern int ITMIN, ITMAX, FILT, NFMAX, TAST, NSHOTS_STEP, DAMPTYPE, HESS, READ_HESS, REC_HESS, LBFGS,EXTOBS;
extern int NUMPAR, BFGSNUM; extern int NUMPAR, BFGSNUM;
extern int VERBOSE; //extern int VERBOSE;
extern int LITTLEBIG;
extern float TESTSTEP,WATER_HESS[3], WEIGHT[3], VP0, VS0, RHO0; extern float TESTSTEP,WATER_HESS[3], WEIGHT[3], VP0, VS0, RHO0;
/* definition of local variables */ /* definition of local variables */
char th1[3], file_ext[8]; char th1[3], file_ext[8];
...@@ -349,9 +349,9 @@ void writepar(FILE *fp, int ns) { ...@@ -349,9 +349,9 @@ void writepar(FILE *fp, int ns) {
fprintf(fp,"\n"); fprintf(fp,"\n");
fprintf(fp," ----------------------- SEISMOGRAMS ----------------------\n"); fprintf(fp," ----------------------- SEISMOGRAMS ----------------------\n");
switch (SEIS_FORMAT[0]) { switch (SEIS_FORMAT) {
case 0: case 0:
sprintf(file_ext,"sgy"); sprintf(file_ext,"su");
break; break;
case 1: case 1:
...@@ -365,14 +365,6 @@ void writepar(FILE *fp, int ns) { ...@@ -365,14 +365,6 @@ void writepar(FILE *fp, int ns) {
case 3: case 3:
sprintf(file_ext,"bin"); sprintf(file_ext,"bin");
break; break;
case 4:
sprintf(file_ext,"sgy");
break;
case 5:
sprintf(file_ext,"sgy");
break;
} }
if ((SEISMO==1) || (SEISMO==4)) { if ((SEISMO==1) || (SEISMO==4)) {
...@@ -450,150 +442,36 @@ void writepar(FILE *fp, int ns) { ...@@ -450,150 +442,36 @@ void writepar(FILE *fp, int ns) {
fprintf(fp," Amplitudes will be written every %d%s time-step, starting at the %d%s.\n",NDT,th1,NDTSHIFT+1,th2); fprintf(fp," Amplitudes will be written every %d%s time-step, starting at the %d%s.\n",NDT,th1,NDTSHIFT+1,th2);
} else { } else {
if ((SEIS_FORMAT[0]==2)||(SEIS_FORMAT[0]==3)) { if ((SEIS_FORMAT==2)||(SEIS_FORMAT==3)) {
fprintf(fp," Warning: seismogram files will be empty! \n"); fprintf(fp," Warning: seismogram files will be empty! \n");
} else if ((SEIS_FORMAT[0]==0)||(SEIS_FORMAT[0]==1)||(SEIS_FORMAT[0]==4)) { } else if ((SEIS_FORMAT==0)||(SEIS_FORMAT==1)) {
fprintf(fp," Warning: seismogram files will contain only headers! \n"); fprintf(fp," Warning: seismogram files will contain only headers! \n");
} }
} }
switch (SEIS_FORMAT[0]) { switch (SEIS_FORMAT) {
case 0 : case 0 :
case 5 :
fprintf(fp," Seismograms are written in SEG-Y format. \n");
if (!SEIS_FORMAT[1]) {
fprintf(fp," \t textual header: ASCII \n");
} else if (SEIS_FORMAT[1]==1) {
fprintf(fp," \t textual header: EBCDIC \n");
}
if (!SEIS_FORMAT[2]) {
fprintf(fp," \t byte order: little endian \n");
} else if (SEIS_FORMAT[2]==1) {
fprintf(fp," \t byte order: big endian \n");
}
if (!SEIS_FORMAT[3]) {
fprintf(fp," \t data type: IEEE 4-byte floats \n");
} else if (SEIS_FORMAT[3]==1) {
fprintf(fp," \t data type: IBM 4-byte floats \n");
}
if (!SEIS_FORMAT[4]) {
fprintf(fp," \t coordinate unit: meter \n");
} else if (SEIS_FORMAT[4]==1) {
fprintf(fp," \t coordinate unit: feet \n");
}
break;
case 1 : case 1 :
fprintf(fp," Seismograms are written in SU-format. \n"); fprintf(fp," Seismograms are written in SU-format (output in meter, native endian and floats). \n");
if (VERBOSE) {
if (!SEIS_FORMAT[2]) {
fprintf(fp," \t byte order: little endian \n");
} else if (SEIS_FORMAT[2]==1) {
fprintf(fp," \t byte order: big endian \n");
}
if (!SEIS_FORMAT[3]) {
fprintf(fp," \t data type: IEEE 4-byte floats \n");
} else if (SEIS_FORMAT[3]==1) {
fprintf(fp," \t CAUTION: data type: IBM 4-byte floats \n");
}
if (!SEIS_FORMAT[4]) {
fprintf(fp," \t coordinate unit: meter \n");
} else if (SEIS_FORMAT[4]==1) {
fprintf(fp," \t coordinate unit: feet \n");
}
}
break; break;
case 2 : case 2 :
if (!SEIS_FORMAT[1]) {
fprintf(fp," Seismograms are written in ASCII. \n"); fprintf(fp," Seismograms are written in ASCII. \n");
fprintf(fp," one Receiver per collumn \n");
} else if (!SEIS_FORMAT[1]==1) {
fprintf(fp," Seismograms are written in EBCDIC. \n");
}
if (!SEIS_FORMAT[4]) {
fprintf(fp," \t coordinate unit: meter \n");
} else if (SEIS_FORMAT[4]==1) {
fprintf(fp," \t coordinate unit: feet \n");
}
break; break;
case 3 : case 3 :
fprintf(fp," Seismograms are written in binary format."); fprintf(fp," Seismograms are written in binary format.");
if (!SEIS_FORMAT[2]) { if (!LITTLEBIG) {
fprintf(fp," \t byte order: little endian \n"); fprintf(fp," \t byte order: little endian \n");
} else if (SEIS_FORMAT[2]==1) { } else if (LITTLEBIG==1) {
fprintf(fp," \t byte order: big endian \n"); fprintf(fp," \t byte order: big endian \n");
} }
if (!SEIS_FORMAT[3]) {
fprintf(fp," \t data type: IEEE 4-byte floats \n");
} else if (SEIS_FORMAT[3]==1) {
fprintf(fp," \t data type: IBM 4-byte floats \n");
}
if (!SEIS_FORMAT[4]) {
fprintf(fp," \t coordinate unit: meter \n");
} else if (SEIS_FORMAT[4]==1) {
fprintf(fp," \t coordinate unit: feet \n");
}
break; break;
case 6 :
fprintf(fp," Seismograms are written in pseudo SU-format (SEG-Y with trace headers only). \n");
if (!SEIS_FORMAT[2]) {
fprintf(fp," \t byte order: little endian \n");
} else if (SEIS_FORMAT[2]==1) {
fprintf(fp," \t byte order: big endian \n");
}
if (!SEIS_FORMAT[3]) {
fprintf(fp," \t data type: IEEE 4-byte floats \n");
} else if (SEIS_FORMAT[3]==1) {
fprintf(fp," \t CAUTION: data type: IBM 4-byte floats \n");
}
if (!SEIS_FORMAT[4]) {
fprintf(fp," \t coordinate unit: meter \n");
} else if (SEIS_FORMAT[4]==1) {
fprintf(fp," \t coordinate unit: feet \n");
}
break;
case 7 :
fprintf(fp," Seismograms are written in SU-format (output in meter, native endian and floats). \n");
break;
default: default:
err(" Sorry. Unknown format for seismic data! \n"); err(" Sorry. Unknown format for seismic data! \n");
} }
...@@ -606,20 +484,11 @@ void writepar(FILE *fp, int ns) { ...@@ -606,20 +484,11 @@ void writepar(FILE *fp, int ns) {
fprintf(fp," Number of samples per receiver: %i \n", ns); fprintf(fp," Number of samples per receiver: %i \n", ns);
if (!SEIS_FORMAT[5]) {
SEIS_FORMAT[5]=USHRT_MAX; /* default */
}
if (ns<=abs(SEIS_FORMAT[5])) { if (ns<=USHRT_MAX) {
fprintf(fp," Number of samples per trace: %i \n", ns); fprintf(fp," Number of samples per trace: %i \n", ns);
} else if (SEIS_FORMAT[5]<0) {
fprintf(fp," Number of samples per trace: %i \n", -SEIS_FORMAT[5]);
fprintf(fp," Number of traces per receiver: %i \n", ns / -SEIS_FORMAT[5]);
fprintf(fp," Number of significant samples in last trace: %i \n", ns % -SEIS_FORMAT[5]);
} else { } else {
fprintf(fp," Maximum allowed number of samples per trace: %i \n", SEIS_FORMAT[5]); fprintf(fp," Maximum allowed number of samples per trace: %i \n", USHRT_MAX);
err(" Sorry. Too many samples per receiver! \n"); err(" Sorry. Too many samples per receiver! \n");
} }
......
Markdown is supported
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