aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-05 10:16:58 +0200
committerThomas White <taw@physics.org>2010-06-05 10:16:58 +0200
commit765e6971f3c278374c32c89f63308b70915709ab (patch)
tree842694bd65c21887de449bba5edf634ce131ef15 /src/peaks.c
parent31aa8ae2709740dab5ab6ec7a8e28dcd8709b72e (diff)
Bring pattern_sim up to date
Diffstat (limited to 'src/peaks.c')
-rw-r--r--src/peaks.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/peaks.c b/src/peaks.c
index c6b79d25..68482e94 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -167,6 +167,9 @@ static int integrate_peak(struct image *image, int xp, int yp,
}
p = find_panel(&image->det, x+xp, y+yp);
+ if ( p == NULL ) {
+ return 1;
+ }
/* Area of one pixel */
pix_area = pow(1.0/p->res, 2.0);
@@ -396,7 +399,7 @@ void dump_peaks(struct image *image, pthread_mutex_t *mutex)
}
-static int find_projected_peaks(struct image *image, UnitCell *cell)
+int find_projected_peaks(struct image *image, UnitCell *cell)
{
int x, y;
double ax, ay, az;
@@ -561,8 +564,13 @@ void output_intensities(struct image *image, UnitCell *cell,
struct imagefeature *f;
/* Wait.. is there a really close feature which was detected? */
- f = image_feature_closest(image->features, hits[i].x, hits[i].y,
- &d, &idx);
+ if ( image->features != NULL ) {
+ f = image_feature_closest(image->features,
+ hits[i].x, hits[i].y,
+ &d, &idx);
+ } else {
+ f = NULL;
+ }
if ( (f != NULL) && (d < PEAK_REALLY_CLOSE) ) {
int r;