aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-11-22 23:47:15 -0800
committerThomas White <taw@physics.org>2013-11-23 02:52:52 -0800
commit6647299adac4cf4fa4ebda5c9bd00773efab18e3 (patch)
treefd151b2af3ec11cbcbf3726f4f9ade20693a3a48
parent431c44e9a64add4becfbb6b407effba0411eb5b9 (diff)
Add --int-diag=negative
-rw-r--r--doc/man/indexamajig.12
-rw-r--r--libcrystfel/src/integration.c21
-rw-r--r--libcrystfel/src/integration.h3
-rw-r--r--src/indexamajig.c4
4 files changed, 17 insertions, 13 deletions
diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1
index 351a2e45..25bc1cd6 100644
--- a/doc/man/indexamajig.1
+++ b/doc/man/indexamajig.1
@@ -330,7 +330,7 @@ Do not record integrated reflections in the stream. The resulting output won't
.PD 0
.IP \fB--int-diag=\fIcondition\fR\fR
.PD
-Show detailed information about reflection integration when \fIcondition\fR is met. The \fIcondition\fR can be \fBall\fR, \fBnone\fR, a set of Miller indices separated by commas, or \fBrandom\fR. The default is \fB--int-diag=none\fR, and \fBrandom\fR means to show information about a random 1% of the peaks.
+Show detailed information about reflection integration when \fIcondition\fR is met. The \fIcondition\fR can be \fBall\fR, \fBnone\fR, a set of Miller indices separated by commas, \fBrandom\fR or \fBnegative\fR. \fBrandom\fR means to show information about a random 1% of the peaks. \fBnegative\fR means to show peaks with intensities which are negative my more than 3 sigma. The default is \fB--int-diag=none\fR.
.SH BUGS
ReAx indexing is experimental. It works very nicely for some people, and crashes for others. In a future version, it will be improved and fully supported.
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 63495c43..3746d3a8 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -223,8 +223,6 @@ struct peak_box
int rp; /* Reference profile number */
Reflection *refl;
-
- int verbose;
};
@@ -598,7 +596,6 @@ static struct peak_box *add_box(struct intcontext *ic)
ic->boxes[idx].J = 0.0;
ic->boxes[idx].rp = -1;
ic->boxes[idx].refl = NULL;
- ic->boxes[idx].verbose = 0;
ic->boxes[idx].bgm = gsl_matrix_calloc(3, 3);
if ( ic->boxes[idx].bgm == NULL ) {
@@ -1295,6 +1292,13 @@ static int get_int_diag(struct intcontext *ic, Reflection *refl)
return random() < RAND_MAX/100;
}
+ if ( ic->int_diag == INTDIAG_NEGATIVE ) {
+ double i, sigi;
+ i = get_intensity(refl);
+ sigi = get_esd_intensity(refl);
+ return i < -3.0*sigi;
+ }
+
if ( ic->int_diag == INTDIAG_INDICES ) {
signed int h, k, l;
get_indices(refl, &h, &k, &l);
@@ -1349,7 +1353,6 @@ static void integrate_prof2d(IntegrationMethod meth, Crystal *cr,
refl = next_refl(refl, iter) )
{
double pfs, pss;
- signed int h, k, l;
struct peak_box *bx;
int pn;
struct panel *p;
@@ -1384,9 +1387,6 @@ static void integrate_prof2d(IntegrationMethod meth, Crystal *cr,
bx->p = p;
bx->pn = pn;
- get_indices(refl, &h, &k, &l);
- bx->verbose = get_int_diag(&ic, refl);
-
/* Which reference profile? */
bx->rp = 0;//bx->pn;
@@ -1462,7 +1462,7 @@ static void integrate_prof2d(IntegrationMethod meth, Crystal *cr,
pss += bx->offs_ss;
set_detector_pos(bx->refl, 0.0, pfs, pss);
- if ( bx->verbose ) show_peak_box(&ic, bx);
+ if ( get_int_diag(&ic, refl) ) show_peak_box(&ic, bx);
}
@@ -1520,8 +1520,6 @@ static void integrate_rings_once(Reflection *refl, struct image *image,
bx->css = css;
bx->p = p;
bx->pn = pn;
- get_indices(refl, &h, &k, &l);
- bx->verbose = get_int_diag(ic, refl);
if ( ic->meth & INTEGRATION_CENTER ) {
r = center_and_check_box(ic, bx, &saturated);
@@ -1579,6 +1577,7 @@ static void integrate_rings_once(Reflection *refl, struct image *image,
set_esd_intensity(refl, sigma);
set_redundancy(refl, 1);
+ get_indices(refl, &h, &k, &l);
one_over_d = resolution(cell, h, k, l);
if ( one_over_d > ic->limit ) ic->limit = one_over_d;
@@ -1587,7 +1586,7 @@ static void integrate_rings_once(Reflection *refl, struct image *image,
pss += bx->offs_ss;
set_detector_pos(refl, 0.0, pfs, pss);
- if ( bx->verbose ) show_peak_box(ic, bx);
+ if ( get_int_diag(ic, refl) ) show_peak_box(ic, bx);
}
diff --git a/libcrystfel/src/integration.h b/libcrystfel/src/integration.h
index 68ce91ec..38cb8163 100644
--- a/libcrystfel/src/integration.h
+++ b/libcrystfel/src/integration.h
@@ -39,7 +39,8 @@ typedef enum {
INTDIAG_NONE,
INTDIAG_RANDOM,
INTDIAG_ALL,
- INTDIAG_INDICES
+ INTDIAG_INDICES,
+ INTDIAG_NEGATIVE
} IntDiag;
diff --git a/src/indexamajig.c b/src/indexamajig.c
index c450fd83..b769d303 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -548,6 +548,10 @@ int main(int argc, char *argv[])
iargs.int_diag = INTDIAG_ALL;
}
+ if ( strcmp(int_diag, "negative") == 0 ) {
+ iargs.int_diag = INTDIAG_NEGATIVE;
+ }
+
r = sscanf(int_diag, "%i,%i,%i", &h, &k, &l);
if ( r == 3 ) {
iargs.int_diag = INTDIAG_INDICES;