Commit 6c2ddf89 authored by myron's avatar myron

compila

corrected FF monofile reading

changed the control of GPU
parent dc39b91b
g
#/*##########################################################################
# Copyright (C) 2001-2013 European Synchrotron Radiation Facility
#
......@@ -5677,6 +5677,18 @@ void CCspace_InterleavedReadingPreProcessing_chunk(CCspace * self ,int sn,int
/* size1 = size_s[2*sn_nb +1] ; */
Rawptr = self-> rawdatatokens->datatokens[ntok] +npj_reshifted*Size0*Size1;
// {
// int i,j;
// double sum=0;
// for(i=0; i<Size0; i++) {
// for(j=0; j< Size1; j++) {
// sum+=(Rawptr[i*Size1 +j]);
// }
// }
// printf("SUSUM INIZIO di ff %e\n", sum ) ;
// }
if(self->params.DZPERPROJ==0) {
long int posff_a = (long int) self->reading_infos.ff_indexes_coefficients[ 6*npj+0 ];
long int posff_b = (long int) self->reading_infos.ff_indexes_coefficients[ 6*npj+1 ];
......@@ -5706,6 +5718,17 @@ void CCspace_InterleavedReadingPreProcessing_chunk(CCspace * self ,int sn,int
current = 1.0;
}
// {
// int i,j;
// double sum=0;
// for(i=0; i<Size0; i++) {
// for(j=0; j< Size1; j++) {
// sum+=(Rawptr[i*Size1 +j]);
// }
// }
// printf("SUSUM PRIMA DI BACK %e\n", sum ) ;
// }
if(self->params.SUBTRACT_BACKGROUND ) {
......@@ -5743,7 +5766,7 @@ void CCspace_InterleavedReadingPreProcessing_chunk(CCspace * self ,int sn,int
}
}
}
}
}
if(self->params.TAKE_LOGARITHM) {
......@@ -6457,8 +6480,6 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
}
} else if (strcmp(self->reading_infos.proj_reading_type , "h5")==0){
if(self->params.DZPERPROJ==0) {
read_data_from_h5( proj_file_list[ 0 ],
self->reading_infos.proj_h5_dsname,
my_proj_num_list[iread],
......@@ -6515,8 +6536,7 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
size_s_[2*sn_nb +0], size_s_[2*sn_nb +1],
rotation_vertical,
binning,
0, // multiplo
0.0, // threshold
self->params.DZPERPROJ,
Bptr,
self->params.CORRECT_FLATFIELD,
......@@ -6579,7 +6599,6 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
if( self->reading_infos.ff_file_list_lenght == 1 ) {
multiplo = 0 ;
}
read_data_from_h5(self->reading_infos.ff_file_list[ file_seq_pos ] ,
self->reading_infos.ff_h5_dsname,
posff - file_seq_pos ,
......@@ -7525,12 +7544,12 @@ void Paganin(CCspace * self, float * RawptrA,
if(self->params.DO_OUTPUT_PAGANIN) {
char output_name[1000];
sprintf(output_name, "%s_%04d.edf",self->params.OUTPUT_PAGANIN_FILE, (int) mystart + npj - pstart );
sprintf(output_name, "%s_%04ld.edf",self->params.OUTPUT_PAGANIN_FILE, (int) mystart + npj - pstart );
if (self->params.verbosity>0) printf(" writing projection on %s \n", output_name);
write_data_to_edf(Rawptr , Size0, Size1 , output_name);
if(npj+1 <= pend-1 ) {
char output_name[1000];
sprintf(output_name, "%s_%04d.edf",self->params.OUTPUT_PAGANIN_FILE, (int) mystart + npj+1 - pstart );
sprintf(output_name, "%s_%04ld.edf",self->params.OUTPUT_PAGANIN_FILE, (int) mystart + npj+1 - pstart );
if (self->params.verbosity>0) printf(" writing projection on %s \n", output_name);
write_data_to_edf(Rawptr + proj_step , Size0, Size1 , output_name);
}
......
......@@ -531,6 +531,14 @@ void read_data_from_h5_eli( char * filename,
assert(binning==1);
long int i, j ;
/* int dims[1],strides[1]; */
/* FILE *edffile; */
/* int res; */
for(i=0; i < size0; i++){
for(j=0; j < size1; j++){
target[i*size1+j]= NAN ;
......@@ -550,7 +558,7 @@ void read_data_from_h5_eli( char * filename,
int rank ;
float shift = iread * DZPERPROJ;
float shift = nproj * DZPERPROJ;
int ishift = ((int) shift);
shift = shift-ishift; // si assume dzperproj sempre positivo
pos0 = pos0 -ishift ;
......@@ -1164,7 +1172,27 @@ void read_data_from_edf_eli( char * filename,
/* memcpy( target_float, bufferF,size0*size1*sizeof(float) ); */
/* return; */
for(j=0; j<n1*binning; j++){
for(i=0; i< n2*binning; i++){
if((j+pos0_)>=0) {
if(Ddark) {
bufferF[j*n2*binning+i ] = (bufferF[j*n2*binning+i ] - Ddark[(j+pos0_)*Dim_1+i])/curr ;
} else {
bufferF[j*n2*binning+i ] = (bufferF[j*n2*binning+i ] )/ curr ;
}
if(correct_ff) {
float deno=1;
if(ff_infos[0]!=-1.0f) {
deno = FFs[0][ (j+pos0_)*Dim_1+i] ;
}
if(ff_infos[1]!=-1.0f) {
deno = FFs[1][ (j+pos0_)*Dim_1+i]*ff_infos[3] + ff_infos[2]*deno ;
}
bufferF[j*n2*binning+i ] /= deno;
}
}
}
}
if(doubleffcorrection) {
if(takelog ) {
......
......@@ -473,7 +473,6 @@ def get_proj_reading(preanalisi=0):
ff_file_list = []
ff_indexes_coefficients =[[-1 ,-1 , 0.0, 0.0,-1,-1]]*len(file_proj_num_list) # *len(my_proj_num_list)
## each proch irank will processes proj_mpi_numpjs[iproc] projections
# starting from Nproj = proj_mpi_offsets[irank]
......
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