Commit 2f88f362 authored by Florian Wittkamp's avatar Florian Wittkamp

Changes naming of seismograms

parent 9356ad6a
......@@ -331,11 +331,7 @@ In our example, we specify 100 receiver location. Due to the small size of the m
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/DENISE_x.su",
"SEIS_FILE_VY" : "su/DENISE_y.su",
"SEIS_FILE_CURL" : "su/DENISE_rot.su",
"SEIS_FILE_DIV" : "su/DENISE_div.su",
"SEIS_FILE_P" : "su/DENISE_p.su",
"SEIS_FILE" : "su/DENISE",
\end{verbatim}}}
{\color{red}{\begin{verbatim}
......@@ -343,7 +339,7 @@ Default values are:
NDT=1
\end{verbatim}}}
If SEISMO$>$0 seismograms recorded at the receiver positions are written to the corresponding output files. The sampling rate of the seismograms is NDT*DT seconds. In case of a small time step interval and a high number of time steps, it might be useful to choose a high NDT in order to avoid a unnecessary detailed sampling of the seismograms and consequently large files of seismogram data. Possible output formats of the seismograms are SU, ASCII and BINARY. It is recommended to use SU format for saving the seismograms. The main advantage of this format is that the time step interval (NDT*DT) and the acquisition geometry (shot and receiver locations) are stored in the corresponding SU header words. Also additional header words like offset are set by DENISE. This format thus facilitates a further visualization and processing of the synthetic seismograms. Note, however, that SU cannot handle sampling rates smaller than 1.0e-6 seconds and the number of samples is limited to about 32.000. In such cases, you should increase the sampling rate by increasing NDT. If this is impossible (for example because the Nyquist criterion is violated) you must choose a different output format (ASCII or binary).
If SEISMO$>$0 seismograms recorded at the receiver positions are written to the corresponding output files. The sampling rate of the seismograms is NDT*DT seconds. In case of a small time step interval and a high number of time steps, it might be useful to choose a high NDT in order to avoid a unnecessary detailed sampling of the seismograms and consequently large files of seismogram data. Possible output formats of the seismograms are SU, ASCII and BINARY. It is recommended to use SU format for saving the seismograms. The main advantage of this format is that the time step interval (NDT*DT) and the acquisition geometry (shot and receiver locations) are stored in the corresponding SU header words. Also additional header words like offset are set by DENISE. This format thus facilitates a further visualization and processing of the synthetic seismograms. Note, however, that SU cannot handle sampling rates smaller than 1.0e-6 seconds and the number of samples is limited to about 32.000. In such cases, you should increase the sampling rate by increasing NDT. If this is impossible (for example because the Nyquist criterion is violated) you must choose a different output format (ASCII or binary). File endings will be added to SEIS\_FILE automatically.
\section{Q-approximation}
......
......@@ -59,8 +59,7 @@
"Seismograms" : "comment",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/DENISE_x.su",
"SEIS_FILE_VY" : "su/DENISE_y.su",
"SEIS_FILE" : "su/DENISE",
"General inversion parameters" : "comment",
......
......@@ -61,12 +61,7 @@
"Seismograms" : "comment",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/DENISE_x.su",
"SEIS_FILE_VY" : "su/DENISE_y.su",
"SEIS_FILE_CURL" : "su/DENISE_rot.su",
"SEIS_FILE_DIV" : "su/DENISE_div.su",
"SEIS_FILE_P" : "su/DENISE_p.su",
"SEIS_FILE" : "su/DENISE",
"General inversion parameters" : "comment",
"INVMAT1" : "1",
......
......@@ -68,11 +68,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/DENISE_x.su",
"SEIS_FILE_VY" : "su/DENISE_y.su",
"SEIS_FILE_CURL" : "su/DENISE_rot.su",
"SEIS_FILE_DIV" : "su/DENISE_div.su",
"SEIS_FILE_P" : "su/DENISE_p.su",
"SEIS_FILE" : "su/DENISE",
"Q-approximation" : "comment",
"L" : "0",
......
......@@ -61,12 +61,7 @@
"Seismograms" : "comment",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/DENISE_x.su",
"SEIS_FILE_VY" : "su/DENISE_y.su",
"SEIS_FILE_CURL" : "su/DENISE_rot.su",
"SEIS_FILE_DIV" : "su/DENISE_div.su",
"SEIS_FILE_P" : "su/DENISE_p.su",
"SEIS_FILE" : "su/DENISE",
"General inversion parameters" : "comment",
"ITERMAX" : "10",
......
......@@ -68,11 +68,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/DENISE_x.su",
"SEIS_FILE_VY" : "su/DENISE_y.su",
"SEIS_FILE_CURL" : "su/DENISE_rot.su",
"SEIS_FILE_DIV" : "su/DENISE_div.su",
"SEIS_FILE_P" : "su/DENISE_p.su",
"SEIS_FILE" : "su/DENISE",
"Q-approximation" : "comment",
"L" : "0",
......
......@@ -67,8 +67,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/measured_data/toy_example_vx.su",
"SEIS_FILE_VY" : "su/measured_data/toy_example_vy.su",
"SEIS_FILE" : "su/measured_data/toy_example",
"Q-approximation" : "comment",
"L" : "3",
......
......@@ -70,10 +70,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_P" : "su/measured_data/toy_example_p.su",
"SEIS_FILE_VX" : "su/measured_data/toy_example_vx.su",
"SEIS_FILE_VY" : "su/measured_data/toy_example_vy.su",
"SEIS_FILE_VZ" : "su/measured_data/toy_example_vz.su",
"SEIS_FILE" : "su/measured_data/toy_example",
"Q-approximation" : "comment",
"L" : "0",
......
......@@ -64,8 +64,7 @@
"Seismograms" : "comment",
"NDT" : "15",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/toy_example/toy_example_vx.su",
"SEIS_FILE_VY" : "su/toy_example/toy_example_vy.su",
"SEIS_FILE" : "su/toy_example/toy_example",
"Q-approximation" : "comment",
"L" : "3",
......
......@@ -70,10 +70,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_P" : "su/toy_example/toy_example_p.su",
"SEIS_FILE_VX" : "su/toy_example/toy_example_vx.su",
"SEIS_FILE_VY" : "su/toy_example/toy_example_vy.su",
"SEIS_FILE_VZ" : "su/toy_example/toy_example_vz.su",
"SEIS_FILE" : "su/toy_example/toy_example",
"Q-approximation" : "comment",
"L" : "0",
......
......@@ -64,9 +64,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/measured_data/toy_example_ac_vx.su",
"SEIS_FILE_VY" : "su/measured_data/toy_example_ac_vy.su",
"SEIS_FILE_P" : "su/measured_data/toy_example_ac_p.su",
"SEIS_FILE" : "su/measured_data/toy_example_ac",
"Q-approximation" : "comment",
"L" : "0",
......
......@@ -64,9 +64,7 @@
"Seismograms" : "comment",
"NDT" : "1",
"SEIS_FORMAT" : "1",
"SEIS_FILE_VX" : "su/toy_example/toy_example_ac_vx.su",
"SEIS_FILE_VY" : "su/toy_example/toy_example_ac_vy.su",
"SEIS_FILE_P" : "su/toy_example/toy_example_ac_p.su",
"SEIS_FILE" : "su/toy_example/toy_example_ac",
"Q-approximation" : "comment",
"L" : "0",
......
......@@ -14,16 +14,6 @@ make denise MODEL=../genmod/toy_example_true.c
#lamboot
mpirun -np 4 nice -19 ../bin/denise in_and_out/toy_example/toy_example_FW.json | tee in_and_out/toy_example/toy_example_FW.out
# the forward modeled data have to be renamed for the inversion
for (( i=1; i <= 5; i++ )) ; do
mv su/measured_data/toy_example_vx.su.shot${i}.it1 su/measured_data/toy_example_x.su.shot${i}
mv su/measured_data/toy_example_vy.su.shot${i}.it1 su/measured_data/toy_example_y.su.shot${i}
done
###############################################################
# running the inversion #
###############################################################
......
......@@ -14,12 +14,6 @@ make denise MODEL=../genmod/toy_example_true.c MODEL_EL=../genmod/toy_example_el
#lamboot
mpirun -np 4 ../bin/denise in_and_out/toy_example/toy_example_FW_SH.json | tee in_and_out/toy_example/toy_example_FW_SH.out
# the forward modeled data have to be renamed for the inversion
for (( i=1; i <= 5; i++ )) ; do
mv su/measured_data/toy_example_vz.su.shot${i}.it1 su/measured_data/toy_example_z.su.shot${i}
done
###############################################################
# running the inversion #
......
......@@ -17,15 +17,6 @@ make denise MODEL_AC=../genmod/toy_example_ac_true.c
# starting DENISE for forward modeling
mpirun -np 4 nice -19 ../bin/denise in_and_out/toy_example/toy_example_ac_FW.json | tee in_and_out/toy_example/toy_example_ac_FW.out
# mpirun -np 4 xterm -e gdb --args ../bin/denise in_and_out/toy_example/toy_example_ac_FW.json | tee in_and_out/toy_example/toy_example_ac_FW.out
# the forward modeled data have to be renamed for the inversion
for (( i=1; i <= 5; i++ )) ; do
mv su/measured_data/toy_example_ac_p.su.shot${i}.it1 su/measured_data/toy_example_ac_p.su.shot${i}
mv su/measured_data/toy_example_ac_vx.su.shot${i}.it1 su/measured_data/toy_example_ac_x.su.shot${i}
mv su/measured_data/toy_example_ac_vy.su.shot${i}.it1 su/measured_data/toy_example_ac_y.su.shot${i}
done
###############################################################
# running the inversion #
......
......@@ -110,7 +110,6 @@ DENISE= \
max_grad.c \
note.c \
norm.c \
outseis.c \
outseis_vector.c \
outseis_glob.c \
catseis.c \
......@@ -127,7 +126,6 @@ DENISE= \
rd_sour.c \
read_workflow.c \
apply_workflow.c \
saveseis.c \
saveseis_glob.c \
sources.c \
solvelin.c \
......
......@@ -85,6 +85,7 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST
}
}
/* Abort criterium */
PRO=workflow[WORKFLOW_STAGE][5];
/* Frequency filtering */
......@@ -100,6 +101,7 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST
} else {
if(MYID==0&&(workflow[WORKFLOW_STAGE][6]>0))printf("\n TIME_FILT cannot be activated due to it is not activated in the JSON File \n");
}
/* Change of wavetype */
if(wavetype_start!=3&&(WAVETYPE!=workflow[WORKFLOW_STAGE][8])){
if(MYID==0)printf("\n Sorry, change of WAVETYPE with workflow only possible if WAVETYPE==3 in *.json");
......@@ -118,6 +120,9 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST
JOINT_INVERSION_PSV_SH_ALPHA_RHO=workflow[WORKFLOW_STAGE][10];
/* Approx. Hessian */
if(EPRECOND==0 && workflow[WORKFLOW_STAGE][11]!=0){
if(MYID==0) printf(" WARNING: EPRECOND have to be set >0 in JSON (if so, ignore this message)");
}
EPRECOND=workflow[WORKFLOW_STAGE][11];
EPSILON_WE=workflow[WORKFLOW_STAGE][12];
......
......@@ -39,8 +39,7 @@ void exchange_par(void){
extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4];
extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE],SIGNAL_FILE_SH[STRING_SIZE], LOG_FILE[STRING_SIZE];
extern char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], REC_FILE[STRING_SIZE];
extern char SEIS_FILE_VX[STRING_SIZE], SEIS_FILE_VY[STRING_SIZE];
extern char SEIS_FILE_CURL[STRING_SIZE], SEIS_FILE_DIV[STRING_SIZE], SEIS_FILE_P[STRING_SIZE];
extern char SEIS_FILE[STRING_SIZE];
extern char JACOBIAN[STRING_SIZE], DATA_DIR[STRING_SIZE], INV_MODELFILE[STRING_SIZE], FREQ_FILE[STRING_SIZE];
extern int RUN_MULTIPLE_SHOTS, TAPERLENGTH, INVTYPE;
extern int NPROC, NPROCX, NPROCY, MYID, IDX, IDY;
......@@ -367,11 +366,7 @@ void exchange_par(void){
MPI_Bcast(&MFILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SNAP_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&REC_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SEIS_FILE_VX,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SEIS_FILE_VY,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SEIS_FILE_CURL,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SEIS_FILE_DIV,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SEIS_FILE_P,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SEIS_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&LOG_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SIGNAL_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
MPI_Bcast(&SIGNAL_FILE_SH,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
......
......@@ -170,9 +170,6 @@ void mergemod(char modfile[STRING_SIZE], int format);
void note(FILE *fp);
void outseis(FILE *fp, FILE *fpdata, int comp, float **section,
int **recpos, int **recpos_loc, int ntr, float ** srcpos_loc,
int nsrc, int ns, int seis_form, int ishot, int sws);
void outseis_glob(FILE *fp, FILE *fpdata, int comp, float **section,
int **recpos, int **recpos_loc, int ntr, float ** srcpos_loc,
......@@ -235,10 +232,6 @@ int **receiver(FILE *fp, int *ntr);
void save_checkpoint(int nx1, int nx2, int ny1, int ny2,
float ** vx, float ** vy, float ** sxx, float ** syy, float ** sxy);
void saveseis(FILE *fp, float **sectionvx, float **sectionvy,float **sectionp,
float **sectioncurl, float **sectiondiv, int **recpos, int **recpos_loc,
int ntr, float ** srcpos_loc, int nsrc,int ns, int iter);
void saveseis_glob(FILE *fp, float **sectionvx, float **sectionvy,float **sectionvz,float **sectionp,float **sectioncurl, float **sectiondiv, int **recpos, int **recpos_loc,int ntr, float ** srcpos, int ishot, int ns, int iter, int type_switch);
void snap(FILE *fp,int nt, int nsnap, float **vx, float **vy, float **sxx,
......
......@@ -19,8 +19,8 @@ int NX, NY, NT, QUELLART,QUELLART_SH, QUELLTYP, SNAP, SNAP_FORMAT, REC_ARRAY,
int L, BOUNDARY, DC, DRX, NXG, NYG, IDX, IDY, FDORDER, MAXRELERROR;
char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE], SIGNAL_FILE_SH[STRING_SIZE];
char MFILE[STRING_SIZE], REC_FILE[STRING_SIZE];
char SEIS_FILE_VX[STRING_SIZE], SEIS_FILE_VY[STRING_SIZE], SEIS_FILE_VZ[STRING_SIZE], LOG_FILE[STRING_SIZE];
char SEIS_FILE_CURL[STRING_SIZE], SEIS_FILE_DIV[STRING_SIZE], SEIS_FILE_P[STRING_SIZE];
char LOG_FILE[STRING_SIZE];
char SEIS_FILE[STRING_SIZE];
FILE *FP;
int VERBOSE;
......
......@@ -27,8 +27,7 @@ void inseis(FILE *fp, int comp, float **section, int ntr, int ns, int sws, int
/* declaration of extern variables */
extern int NDT, MYID;
extern char DATA_DIR[STRING_SIZE], SEIS_FILE_P[STRING_SIZE], SEIS_FILE_VX[STRING_SIZE];
extern char SEIS_FILE_VY[STRING_SIZE];
extern char DATA_DIR[STRING_SIZE];
extern float TIME, DH, DT, REFREC[4];
char data[STRING_SIZE];
const float xshift=800.0, yshift=800.0;
......@@ -42,22 +41,8 @@ void inseis(FILE *fp, int comp, float **section, int ntr, int ns, int sws, int
sprintf(data,"%s_y.su.shot%d",DATA_DIR,comp);
}
if(sws==3){ /* open forward modelled data vx*/
sprintf(data,"%s.shot%d.%d",SEIS_FILE_VX,comp,MYID);
}
if(sws==4){ /* open forward modelled data vy*/
sprintf(data,"%s.shot%d.%d",SEIS_FILE_VY,comp,MYID);
}
if(sws==5){ /* open old data residuals vx*/
sprintf(data,"%s.shot%d_it-1.%d",SEIS_FILE_VX,comp,MYID);
}
if(sws==6){ /* open old data residuals vy*/
sprintf(data,"%s.shot%d_it-1.%d",SEIS_FILE_VY,comp,MYID);
}
/* sws 3 -- 6 not used */
if(sws==7){ /* open convolved seismic data vx */
sprintf(data,"%s_x.su.conv.shot%d",DATA_DIR,comp);
}
......@@ -74,11 +59,12 @@ void inseis(FILE *fp, int comp, float **section, int ntr, int ns, int sws, int
sprintf(data,"%s_z.su.shot%d",DATA_DIR,comp);
}
/*printf("%s\n",data);*/
fpdata = fopen(data,"r");
if (fpdata==NULL) err(" Seismograms for inversion were not found ");
if (fpdata==NULL) {
if(MYID==0) printf(" Was not able to read %s",data);
err(" Seismograms for inversion were not found ");
}
/* declaration of local variables */
int i,j;
......
/*-----------------------------------------------------------------------------------------
* Copyright (C) 2016 For the list of authors, see file AUTHORS.
*
* This file is part of DENISE.
*
* DENISE 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, version 2.0 of the License only.
*
* DENISE 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 DENISE. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------
* Write seismograms to disk
* last update 19/01/02, T. Bohlen
* ----------------------------------------------------------------------*/
#include "fd.h"
#include "segy.h"
void outseis(FILE *fp, FILE *fpdata, int comp, float **section,
int **recpos, int **recpos_loc, int ntr, float ** srcpos,
int nsrc, int ns, int seis_form, int ishot, int sws){
/* declaration of extern variables */
extern int NDT;
extern float TIME, DH, DT, REFREC[4];
const float xshift=800.0, yshift=800.0;
/* declaration of local variables */
int i,j,ndt,ns2,nt,lsamp;
segy tr;
int tracl1 ;
float xr, yr, x, y;
float XS=0.0, YS=0.0;
nt=iround(TIME/DT);
if (sws==1){ /* parameter NDT is used */
ndt=NDT;
ns2=iround(nt/NDT);}
else{
ndt=1;
ns2=ns;}
/* source coordinates are written into trace header fields */
XS=srcpos[1][1];
YS=srcpos[2][1];
switch(seis_form){
case 1 :
for(tracl1=1;tracl1<=ntr;tracl1++){ /*SEGY (without file-header)*/
xr=recpos[1][recpos_loc[3][tracl1]]*DH;
yr=recpos[2][recpos_loc[3][tracl1]]*DH;
x=xr-REFREC[1];
y=yr-REFREC[2];
tr.tracl=(int)recpos_loc[3][tracl1];
tr.ep=comp;
tr.cdp=(int)recpos_loc[3][tracl1];
tr.trid=(short)1; /* trace identification code: 1=seismic*/
tr.offset=(signed int)iround(sqrt((XS-xr)*(XS-xr)
+(YS-yr)*(YS-yr))*1000.0);
tr.gelev=(signed int)iround(yr*1000.0);
tr.sdepth=(signed int)iround(YS*1000.0); /* source depth (positive) */
/* angle between receiver position and reference point
(sperical coordinate system: swdep=theta, gwdep=phi) */
tr.swdep=iround(((360.0/(2.0*PI))*atan2(x-xshift,y-yshift))*1000.0);
/*tr.scalel=(signed short)-3;*/
tr.scalel=(signed short)-1000;
/*tr.scalco=(signed short)-3;*/
tr.scalco=(signed short)-1000;
tr.sx=(signed int)iround(XS*1000.0); /* X source coordinate */
/* group coordinates */
tr.gx=(signed int)iround(xr*1000.0);
tr.ns=(unsigned short)ns2; /* number of samples in this trace */
tr.dt=(unsigned short)iround(((float)ndt*DT)*1.0e6); /* sample interval in micro-seconds */
/*tr.d1=(float)(TIME/ns);*/ /* sample spacing for non-seismic data */
tr.d1=(float)tr.dt*1.0e-6;
tr.tracr=0 ; /* trace sequence number within reel */
tr.fldr=0 ; /* field record number */
tr.tracf=0 ; /* trace number within field record */
tr.ep=0 ; /* energy source point number */
tr.cdpt=0 ; /* trace number within CDP ensemble */
tr.nvs=0 ; /* number of vertically summed traces (see vscode
in bhed structure) */
tr.nhs=0 ; /* number of horizontally summed traces (see vscode
in bhed structure) */
tr.duse=0 ; /* data use:
1 = production
2 = test */
tr.selev=0 ; /* source elevation from sea level
(above sea level is positive) */
tr.gdel=0 ; /* datum elevation at receiver group */
tr.sdel=0 ; /* datum elevation at source */
tr.gwdep=0 ; /* water depth at receiver group */
tr.sy= (signed int)iround(YS*1000.0) ; /* Y source coordinate */
tr.gy= (signed int)iround(yr*1000.0) ; /* Y group coordinate */
tr.counit=0 ; /* coordinate units code:
for previous four entries
1 = length (meters or feet)
2 = seconds of arc (in this case, the
X values are longitude and the Y values
are latitude, a positive value designates
the number of seconds east of Greenwich
or north of the equator */
tr.wevel=0 ; /* weathering velocity */
tr.swevel=0 ; /* subweathering velocity */
tr.sut=0 ; /* uphole time at source */
tr.gut=0 ; /* uphole time at receiver group */
tr.sstat=0 ; /* source static correction */
tr.gstat=0 ; /* group static correction */
tr.tstat=0 ; /* total static applied */
tr.laga=0 ; /* lag time A, time in ms between end of 240-
byte trace identification header and time
break, positive if time break occurs after
end of header, time break is defined as
the initiation pulse which maybe recorded
on an auxiliary trace or as otherwise
specified by the recording system */
tr.lagb=0 ; /* lag time B, time in ms between the time break
and the initiation time of the energy source,
may be positive or negative */
tr.delrt=0 ; /* delay recording time, time in ms between
initiation time of energy source and time
when recording of data samples begins
(for deep water work if recording does not
start at zero time) */
tr.muts=0 ; /* mute time--start */
tr.mute=0 ; /* mute time--end */
tr.gain=0 ; /* gain type of field instruments code:
1 = fixed
2 = binary
3 = floating point
4 ---- N = optional use */
tr.igc=0 ; /* instrument gain constant */
tr.igi=0 ; /* instrument early or initial gain */
tr.corr=0 ; /* correlated:
1 = no
2 = yes */
tr.sfs=0 ; /* sweep frequency at start */
tr.sfe=0 ; /* sweep frequency at end */
tr.slen=0 ; /* sweep length in ms */
tr.styp=0 ; /* sweep type code:
1 = linear
2 = cos-squared
3 = other */
tr.stas=0 ; /* sweep trace length at start in ms */
tr.stae=0 ; /* sweep trace length at end in ms */
tr.tatyp=0 ; /* taper type: 1=linear, 2=cos^2, 3=other */
tr.afilf=0 ; /* alias filter frequency if used */
tr.afils=0 ; /* alias filter slope */
tr.nofilf=0 ; /* notch filter frequency if used */
tr.nofils=0 ; /* notch filter slope */
tr.lcf=0 ; /* low cut frequency if used */
tr.hcf=0 ; /* high cut frequncy if used */
tr.lcs=0 ; /* low cut slope */
tr.hcs=0 ; /* high cut slope */
tr.year=0 ; /* year data recorded */
tr.day=0 ; /* day of year */
tr.hour=0 ; /* hour of day (24 hour clock) */
tr.minute=0 ; /* minute of hour */
tr.sec=0 ; /* second of minute */
tr.timbas=0 ; /* time basis code:
1 = local
2 = GMT
3 = other */
tr.trwf=0 ; /* trace weighting factor, defined as 1/2^N
volts for the least sigificant bit */
tr.grnors=0 ; /* geophone group number of roll switch
position one */
tr.grnofr=0 ; /* geophone group number of trace one within
original field record */
tr.grnlof=0 ; /* geophone group number of last trace within
original field record */
tr.gaps=0 ; /* gap size (total number of groups dropped) */
tr.otrav=0 ; /* overtravel taper code:
1 = down (or behind)
2 = up (or ahead) */
/* local assignments */
tr.f1=0.0; /* first sample location for non-seismic data */
tr.d2=0.0; /* sample spacing between traces */
tr.f2=0.0; /* first trace location */
tr.ungpow=0.0; /* negative of power used for dynamic
range compression */
tr.unscale=0.0; /* reciprocal of scaling factor to normalize
range */
tr.ntr=0 ; /* number of traces */
tr.mark=0 ;
if (sws==0){
for(j=1;j<=ns;j++) tr.data[j]=section[tracl1][j];}
else{
lsamp=0;
for(j=1;j<=ns2;j++){
lsamp +=NDT;
tr.data[j]=section[tracl1][lsamp];}
}
fwrite(&tr,240,1,fpdata);
fwrite(&tr.data[1],4,ns2,fpdata);
}
break;
case 2 :
for(i=1;i<=ntr;i++){ /*ASCII ONE COLUMN*/
if (sws==0){
for(j=1;j<=ns;j++) fprintf(fpdata,"%e\n", section[i][j]);}
else{
lsamp=0;
for(j=1;j<=ns2;j++){
lsamp+=NDT;
fprintf(fpdata,"%e\n", section[i][lsamp]);}
}
}
break;
case 3 : /*BINARY */
for(i=1;i<=ntr;i++){
if(sws==0){
for(j=1;j<=ns;j++){
fwrite(&section[i][j],sizeof(float),1,fpdata); }}
else{
lsamp=0;
for(j=1;j<=ns2;j++){
lsamp+=NDT;
fwrite(&section[i][lsamp],sizeof(float),1,fpdata); }}}
break;
default :
fprintf(fp," Don't know data format for seismograms !\n");
fprintf(fp," No output written. ");
}
fclose(fpdata);
}
......@@ -38,8 +38,7 @@ void read_par_json(FILE *fp, char *fileinp){
extern int SNAPSHOT_START,SNAPSHOT_END,SNAPSHOT_INCR;
extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE], SIGNAL_FILE_SH[STRING_SIZE], LOG_FILE[STRING_SIZE];
extern char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], REC_FILE[STRING_SIZE];
extern char SEIS_FILE_VX[STRING_SIZE], SEIS_FILE_VY[STRING_SIZE], SEIS_FILE_VZ[STRING_SIZE];
extern char SEIS_FILE_CURL[STRING_SIZE], SEIS_FILE_DIV[STRING_SIZE], SEIS_FILE_P[STRING_SIZE];
extern char SEIS_FILE[STRING_SIZE];
extern char JACOBIAN[STRING_SIZE],DATA_DIR[STRING_SIZE],FREQ_FILE[STRING_SIZE];
extern int NPROCX, NPROCY, MYID, IDX, IDY;
extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, INVMAT, QUELLTYPB;
......@@ -328,25 +327,8 @@ void read_par_json(FILE *fp, char *fileinp){
err("Variable SEISMO could not be retrieved from the json input file!");
else {
if (SEISMO>0){
if ((SEISMO==1) || (SEISMO==4) || (SEISMO==5)) {
if (get_string_from_objectlist("SEIS_FILE_VX",number_readobjects,SEIS_FILE_VX,varname_list, value_list))
err("Variable SEIS_FILE_VX could not be retrieved from the json input file!");
if (get_string_from_objectlist("SEIS_FILE_VY",number_readobjects,SEIS_FILE_VY,varname_list, value_list))
err("Variable SEIS_FILE_VY could not be retrieved from the json input file!");
if (get_string_from_objectlist("SEIS_FILE_VZ",number_readobjects,SEIS_FILE_VZ,varname_list, value_list)) {
if(WAVETYPE==2||WAVETYPE==3) err("Variable SEIS_FILE_VZ could not be retrieved from the json input file!");
}
}
if ((SEISMO==3) || (SEISMO==4)) {
if (get_string_from_objectlist("SEIS_FILE_DIV",number_readobjects,SEIS_FILE_DIV,varname_list, value_list))
err("Variable SEIS_FILE_DIV could not be retrieved from the json input file!");
if (get_string_from_objectlist("SEIS_FILE_CURL",number_readobjects,SEIS_FILE_CURL,varname_list, value_list))
err("Variable SEIS_FILE_CURL could not be retrieved from the json input file!");
}
if ((SEISMO==2) || (SEISMO==4) || (SEISMO==5)) {
if (get_string_from_objectlist("SEIS_FILE_P",number_readobjects,SEIS_FILE_P,varname_list, value_list))
err("Variable SEIS_FILE_P could not be retrieved from the json input file!");
}
if (get_string_from_objectlist("SEIS_FILE",number_readobjects,SEIS_FILE,varname_list, value_list))
err("Variable SEIS_FILE could not be retrieved from the json input file!");
if (get_int_from_objectlist("READREC",number_readobjects,&READREC,varname_list, value_list))
err("Variable READREC could not be retrieved from the json input file!");
......
/*-----------------------------------------------------------------------------------------
* Copyright (C) 2016 For the list of authors, see file AUTHORS.