diff options
author | Thomas White <taw@physics.org> | 2010-06-29 09:54:13 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:51 +0100 |
commit | 5e049788c7e2e8177ecbf4eb64f65f314dce783b (patch) | |
tree | e2cc0df79cbfbd694d940bbd59cf4755a3368b65 /src/hdf5-file.c | |
parent | 2f791a23fdf76b0116d3f1b506d9adf696f98f7f (diff) |
debodge_saturation(): Just assume the peaks are there
This makes the saturation correction do something which looks sensible.
Diffstat (limited to 'src/hdf5-file.c')
-rw-r--r-- | src/hdf5-file.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c index 71ab0354..cbd9bfa2 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -290,31 +290,17 @@ static void debodge_saturation(struct hdfile *f, struct image *image) unsigned int x, y; float val; - int v1, v2, v3, v4, v5; x = buf[3*i+0]; y = buf[3*i+1]; val = buf[3*i+2]; - /* Find the cross */ - v1 = (int)image->data[x+image->width*y]; - v2 = (int)image->data[x+1+image->width*y]; - v3 = (int)image->data[x-1+image->width*y]; - v4 = (int)image->data[x+image->width*(y+1)]; - v5 = (int)image->data[x+image->width*(y-1)]; - if ( (v1 != 32767) || (v2 != 32767) || (v3 != 32767) || - (v4 != 32767) || (v5 != 32767) ) { - STATUS("Cross not found for saturation %i,%i\n", x, y); - STATUS("%i %i %i %i %i -> %f\n", v1, v2, v3, v4, v5, val); - } else { - float v = val / 5; - image->data[x+image->width*y] = v; - image->data[x+1+image->width*y] = v; - image->data[x-1+image->width*y] = v; - image->data[x+image->width*(y+1)] = v; - image->data[x+image->width*(y-1)] = v; - n++; - } + image->data[x+image->width*y] = val / 5.0; + image->data[x+1+image->width*y] = val / 5.0; + image->data[x-1+image->width*y] = val / 5.0; + image->data[x+image->width*(y+1)] = val / 5.0; + image->data[x+image->width*(y-1)] = val / 5.0; + n++; } STATUS("Corrected %i saturation values, %i failed.\n", |