Commit fadfcc1b authored by niklas.thiel's avatar niklas.thiel

cleaned up pup.c file

parent 1e085c34
......@@ -50,14 +50,14 @@ void pup(float **data_p, float **data_vy, FILE *fp, int ntr_glob, int **recpos,
nx_pot *=2; /* double columns to avaoid filtering artefacts*/
/* test: write filter to file*/
sprintf(pf1,"%s_data_p_output.bin",SEIS_FILE);
sprintf(pf1,"%s_data_p_.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
file = fopen(pf1,"wb");
for (i=1;i<=ntr_glob;i++)
for (j=1;j<=ns;j++) fwrite(&data_p[i][j],sizeof(float),1,file);
fclose(file);
/* test: write filter to file*/
sprintf(pf1,"%s_data_vz_output.bin",SEIS_FILE);
sprintf(pf1,"%s_data_vz_.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
file = fopen(pf1,"wb");
for (i=1;i<=ntr_glob;i++)
for (j=1;j<=ns;j++) fwrite(&data_vy[i][j],sizeof(float),1,file);
......@@ -129,11 +129,13 @@ void pup(float **data_p, float **data_vy, FILE *fp, int ntr_glob, int **recpos,
}
/* test: write filter to file*/
sprintf(pf1,"%s_spectrum.filt.shot%i.it%i.bin",SEIS_FILE,ishot,iter);
if (iter==1 && ishot==1) {
sprintf(pf1,"%s_spectrum.filter.bin",SEIS_FILE);
file = fopen(pf1,"wb");
for (i=1;i<=nx_pot;i++)
for (j=1;j<=ny_pot;j++) fwrite(&filtwk_full[j][i],sizeof(float),1,file);
fclose(file);
}
/* copy data to temp array */
for(k=1;k<=ntr_glob;k++) {
......@@ -190,7 +192,7 @@ void pup(float **data_p, float **data_vy, FILE *fp, int ntr_glob, int **recpos,
fprintf(FP,"\n Write PUP data to file...\n ");
/* write spectrum to file */
sprintf(pf2,"%s_pup.hand.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
sprintf(pf2,"%s_data_pup.shot%i.it%i.bin",SEIS_FILE,ishot, iter);
file = fopen(pf2,"wb");
for (i=1;i<=nx_pot;i++)
for (j=1;j<=ny_pot;j++) fwrite(&data_pup[j][i],sizeof(float),1,file);
......
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