aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-06-05 10:19:52 +0200
committerThomas White <taw@bitwiz.org.uk>2010-06-05 10:19:52 +0200
commitea369696428af621a3acfd53791d9c98d4402584 (patch)
treeb1a30c1765a31fde97ee01dc15d17963bb56e4c0 /src/peaks.c
parent3f4cf9279f0ff766448e3308d49e5cae58b6ef61 (diff)
parent765e6971f3c278374c32c89f63308b70915709ab (diff)
Merge branch 'master' of git.bitwiz.org.uk:crystfel
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;