From 5c92f43ff2fe510abbf24669cbcc724ef9f3fcc2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 26 Jan 2012 17:25:02 -0800 Subject: Fix peak height going into MOSFLM, fix bug in array bounds --- libcrystfel/src/mosflm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c index 886fbd56..f9638c75 100644 --- a/libcrystfel/src/mosflm.c +++ b/libcrystfel/src/mosflm.c @@ -178,9 +178,7 @@ static void write_spt(struct image *image, const char *filename) double fclen = 67.8; /* fake camera length in mm */ double fpix = 0.075; /* fake pixel size in mm */ double pix; - double height = 100.0; - double sigma = 1.0; - int nPeaks = image_feature_count(image->features); + int n, nPeaks; struct sptline *sptlines; fh = fopen(filename, "w"); @@ -193,9 +191,11 @@ static void write_spt(struct image *image, const char *filename) fprintf(fh, "%10d %10d\n", 1, 1); fprintf(fh, "%10.5f %10.5f\n", 0.0, 0.0); - sptlines = malloc(sizeof(struct sptline)*nPeaks); + n = image_feature_count(image->features); + sptlines = malloc(sizeof(struct sptline)*n); /* Max possible size */ - for ( i=0; ires; /* pixel size in mm */ - height = f->intensity; xs = (f->fs-p->min_fs)*p->fsx + (f->ss-p->min_ss)*p->ssx; ys = (f->fs-p->min_fs)*p->fsy + (f->ss-p->min_ss)*p->ssy; @@ -217,8 +216,10 @@ static void write_spt(struct image *image, const char *filename) sptlines[i].x = ry*pix*fclen/p->clen/1000.0; sptlines[i].y = -rx*pix*fclen/p->clen/1000.0; - sptlines[i].h = height; - sptlines[i].s = sigma/1000.0; + sptlines[i].h = 1000.0; + sptlines[i].s = 10.0; + + nPeaks++; } -- cgit v1.2.3