aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Kirian <rkirian@asu.edu>2010-12-08 17:05:13 -0700
committerThomas White <taw@physics.org>2012-02-22 15:27:08 +0100
commit14b6838d6d71ed104365d157553cc475687eef8e (patch)
tree6f42ff32159ae0d628b976e1c2f879d3ab6037d3 /src
parentc12133dbbf9b4e6db743512d67b7f67810f4ccd3 (diff)
write mosflm spot files (almost)
Diffstat (limited to 'src')
-rw-r--r--src/index.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c
index 3e0a09b1..9b72128a 100644
--- a/src/index.c
+++ b/src/index.c
@@ -109,6 +109,45 @@ static void write_drx(struct image *image)
}
+static void write_mosflm(struct image *image)
+{
+ FILE *fh;
+ int i;
+ char filename[1024];
+ double cl=100; /* fake camera length in mm */
+ double pix=0;
+ double height=0;
+ double sigma=0;
+
+ snprintf(filename, 1023, "xfel-%i.spt", image->id);
+
+ fh = fopen(filename, "w");
+ if ( !fh ) {
+ ERROR("Couldn't open temporary file xfel.spt\n");
+ return;
+ }
+
+ fprintf(fh, "%10d %10d %10.8f %10.6f %10.6f\n", 1, 1, 1, 1, 0);
+ fprintf(fh, "%10d %10d\n", 1, 1);
+ fprintf(fh, "%10.5f %10.5f", 0, 0);
+
+ for ( i=0; i<image_feature_count(image->features); i++ ) {
+
+ struct imagefeature *f;
+
+ f = image_get_feature(image->features, i);
+ if ( f == NULL ) continue;
+
+ fprintf(fh, "%10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
+ f->x, f->y, 0, 0, height, sigma);
+
+ }
+ fprintf(fh,"%10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
+ -999,-999,-999,-999,-999,-999);
+ fclose(fh);
+}
+
+
void map_all_peaks(struct image *image)
{
int i;