Commit d9dd0cef authored by Thomas White's avatar Thomas White Committed by Thomas White
Browse files

indexamajig: Make saturation correction optional and default to off

parent 6ef48812
......@@ -175,7 +175,7 @@ static void *process_image(void *pargsv)
return NULL;
}
hdf5_read(hdfile, &image);
hdf5_read(hdfile, &image, 1);
if ( pargs->config_cmfilter ) {
filter_cm(&image);
......
......@@ -326,7 +326,7 @@ static void debodge_saturation(struct hdfile *f, struct image *image)
}
int hdf5_read(struct hdfile *f, struct image *image)
int hdf5_read(struct hdfile *f, struct image *image, int satcorr)
{
herr_t r;
float *buf;
......@@ -379,7 +379,7 @@ int hdf5_read(struct hdfile *f, struct image *image)
image->f0_available = 1;
}
debodge_saturation(f, image);
if ( satcorr ) debodge_saturation(f, image);
return 0;
}
......
......@@ -27,7 +27,7 @@ struct hdfile;
extern int hdf5_write(const char *filename, const void *data,
int width, int height, int type);
extern int hdf5_read(struct hdfile *f, struct image *image);
extern int hdf5_read(struct hdfile *f, struct image *image, int satcorr);
extern struct hdfile *hdfile_open(const char *filename);
extern int hdfile_set_image(struct hdfile *f, const char *path);
......
......@@ -59,6 +59,7 @@ struct process_args
int config_nomatch;
int config_unpolar;
int config_sanity;
int config_satcorr;
struct detector *det;
IndexingMethod indm;
const double *intensities;
......@@ -126,6 +127,8 @@ static void show_help(const char *s)
" --unpolarized Don't correct for the polarisation of the X-rays.\n"
" --check-sanity Check that indexed locations approximately correspond\n"
" with detected peaks.\n"
" --sat-corr Correct values of saturated peaks using a table\n"
" included in the HDF5 file.\n"
"\n\nOptions for greater performance or verbosity:\n\n"
" --verbose Be verbose about indexing.\n"
" --gpu Use the GPU to speed up the simulation.\n"
......@@ -288,7 +291,7 @@ static void *process_image(void *pargsv)
return result;
}
hdf5_read(hdfile, &image);
hdf5_read(hdfile, &image, pargs->config_satcorr);
if ( config_cmfilter ) {
filter_cm(&image);
......@@ -409,6 +412,7 @@ int main(int argc, char *argv[])
int config_alternate = 0;
int config_unpolar = 0;
int config_sanity = 0;
int config_satcorr = 0;
struct detector *det;
char *geometry = NULL;
IndexingMethod indm;
......@@ -449,6 +453,7 @@ int main(int argc, char *argv[])
{"prefix", 1, NULL, 'x'},
{"unpolarized", 0, &config_unpolar, 1},
{"check-sanity", 0, &config_sanity, 1},
{"sat-corr", 0, &config_satcorr, 1},
{0, 0, NULL, 0}
};
......@@ -609,6 +614,7 @@ int main(int argc, char *argv[])
pargs->config_nomatch = config_nomatch;
pargs->config_unpolar = config_unpolar;
pargs->config_sanity = config_sanity;
pargs->config_satcorr = config_satcorr;
pargs->cell = cell;
pargs->det = det;
pargs->indm = indm;
......
......@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
hdfile = hdfile_open(filename);
hdfile_set_image(hdfile, "/data/data");
hdf5_read(hdfile, &image);
hdf5_read(hdfile, &image, 1);
for ( x=0; x<image.width; x++ ) {
for ( y=0; y<image.height; y++ ) {
......
......@@ -77,7 +77,7 @@ float *render_get_image_binned(DisplayWindow *dw, int binning, float *max)
image->features = NULL;
image->data = NULL;
hdf5_read(dw->hdfile, image);
hdf5_read(dw->hdfile, image, 1);
dw->image_dirty = 0;
if ( dw->cmfilter ) filter_cm(image);
if ( dw->noisefilter ) filter_noise(image, NULL);
......@@ -482,7 +482,7 @@ int render_tiff_fp(DisplayWindow *dw, const char *filename)
if ( image == NULL ) return 1;
image->features = NULL;
image->data = NULL;
hdf5_read(dw->hdfile, image);
hdf5_read(dw->hdfile, image, 1);
if ( dw->cmfilter ) filter_cm(image);
if ( dw->noisefilter ) filter_noise(image, NULL);
......@@ -527,7 +527,7 @@ int render_tiff_int16(DisplayWindow *dw, const char *filename)
if ( image == NULL ) return 1;
image->features = NULL;
image->data = NULL;
hdf5_read(dw->hdfile, image);
hdf5_read(dw->hdfile, image, 1);
if ( dw->cmfilter ) filter_cm(image);
if ( dw->noisefilter ) filter_noise(image, NULL);
......
Supports Markdown
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