From ed0bcf1cc4be9af77eb993f1406dc991c10345d3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 6 Mar 2012 17:34:58 +0100 Subject: Add "err" to get_tt() --- libcrystfel/src/detector.c | 8 +++++++- libcrystfel/src/detector.h | 2 +- libcrystfel/src/peaks.c | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index bbb65c9a..ee09eb73 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -277,13 +277,19 @@ int in_bad_region(struct detector *det, double fs, double ss) } -double get_tt(struct image *image, double fs, double ss) +double get_tt(struct image *image, double fs, double ss, int *err) { double r, rx, ry; struct panel *p; double xs, ys; + *err = 0; + p = find_panel(image->det, fs, ss); + if ( p == NULL ) { + *err = 1; + return 0.0; + } /* Convert xs and ys, which are in fast scan/slow scan coordinates, * to x and y */ diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h index a285be8d..53aca93d 100644 --- a/libcrystfel/src/detector.h +++ b/libcrystfel/src/detector.h @@ -110,7 +110,7 @@ extern struct rvec get_q(struct image *image, double fs, double ss, extern struct rvec get_q_for_panel(struct panel *p, double fs, double ss, double *ttp, double k); -extern double get_tt(struct image *image, double xs, double ys); +extern double get_tt(struct image *image, double xs, double ys, int *err); extern int in_bad_region(struct detector *det, double fs, double ss); diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 3c383855..d0183371 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -229,7 +229,9 @@ int integrate_peak(struct image *image, int cfs, int css, if ( do_polar ) { - tt = get_tt(image, fs+cfs, ss+css); + int err; + + tt = get_tt(image, fs+cfs, ss+css, &err); phi = atan2(ss+css, fs+cfs); pa = pow(sin(phi)*sin(tt), 2.0); -- cgit v1.2.3