Commit 6b1d046a authored by myron's avatar myron

compiled

parent e0377f29
......@@ -6760,7 +6760,7 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
self->ffcorr,
&h5file_id,
&h5ds_id,
bptr_tmp
&(self->shared_h5DSid_current)
);
}// fine conico con H5
......
......@@ -403,7 +403,7 @@ void read_data_from_h5( char * filename,
herr_t status;
int rank ;
hid_t dataspace_current=1;
hid_t dataspace_current=-1;
assert(binning==1);
......@@ -494,7 +494,7 @@ void read_data_from_h5( char * filename,
int iz;
for(iz=0; iz < v_span; iz++) {
int k;
for( k=0; k< v_span*size0*size1 ; k++ ) {
for( k=0; k< size0*size1 ; k++ ) {
mytarget[k+iz*size0*size1] = (mytarget[k+iz*size0*size1] - bptr[k + pos0*size1 ]) ;
}
}
......@@ -505,7 +505,7 @@ void read_data_from_h5( char * filename,
hid_t dataspace_current = H5Dget_space(dataset_current);
hid_t memspace_current;
int myoffset = pos0 ;
int myoffset = nproj ;
int mycount = v_span;
float currents[v_span] ;
......@@ -573,7 +573,7 @@ void read_data_from_h5_eli( char * filename,
float *ffcorr,
hid_t *file,
hid_t *dataset,
float *bptr
hid_t *dataset_current
) {
assert(binning==1);
......@@ -600,6 +600,8 @@ void read_data_from_h5_eli( char * filename,
herr_t status;
int rank ;
float shift = nproj * DZPERPROJ;
int ishift = ((int) shift);
shift = shift-ishift; // si assume dzperproj sempre positivo
......@@ -624,11 +626,16 @@ void read_data_from_h5_eli( char * filename,
if(*file<0) {
*file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
*dataset = H5Dopen(*file, dsname);
*dataset_current = H5Dopen(*file, "current");
}
hid_t dataspace_current=-1;
dataspace = H5Dget_space(*dataset);
rank = H5Sget_simple_extent_ndims(dataspace);
assert(rank==3);
hsize_t dims_out[rank];
H5Sget_simple_extent_dims( dataspace , dims_out , NULL );
......@@ -716,6 +723,32 @@ void read_data_from_h5_eli( char * filename,
}
}
}
if(*dataset_current>=0) {
hid_t dataspace_current = H5Dget_space(*dataset_current);
hid_t memspace_current;
int myoffset = offset[0] ;
int mycount = v_span;
float currents[v_span] ;
status = H5Sselect_hyperslab (dataspace_current, H5S_SELECT_SET, &myoffset, NULL, &mycount, NULL);
memspace_current = H5Screate_simple (1, &mycount, NULL);
status = H5Sselect_hyperslab (memspace_current, H5S_SELECT_SET, &myoffset, NULL, &mycount, NULL);
status = H5Dread (*dataset_current, H5T_NATIVE_FLOAT , memspace_current, dataspace_current, H5P_DEFAULT, v_span);
status = H5Sclose (memspace_current);
status = H5Sclose (dataspace_current);
int iz ;
for(iz=0; iz<v_span; iz++) {
int k;
for( k=0; k< size0_clipped*size1 ; k++ ) {
mytarget[k+ iz*size0_clipped*size1] = mytarget[k+ iz*size0_clipped*size1] / currents[iz] ;
}
}
}
if(doubleffcorrection) {
if(takelog ) {
for(j=0; j<size0; j++) {
......@@ -868,7 +901,7 @@ void read_projSequence_from_h5( char * filename,
if(*dataset_current>=0) {
dataspace_current = H5Dget_space(*dataset_current);
int myoffset = pos0 ;
int myoffset = offset[0] ;
int mycount = v_span;
float currents[v_span] ;
......@@ -931,7 +964,7 @@ void read_data_from_edf( char * filename,
edffile = fopen( filename ,"r");
if(edffile==NULL) {
sem_post( semaforo_ptr );
sem_post( semaforo_ptr );
fprintf(stderr," error opening %s for reading \n", filename );
exit(1);
}
......
......@@ -159,7 +159,7 @@ void read_data_from_h5_eli( char * filename,
float *ffcorr,
hid_t *file,
hid_t *dataset,
float *bptr
hid_t *dataset_current
) ;
......
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