aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-03-06 16:10:53 +0100
committerThomas White <taw@physics.org>2012-03-06 16:10:53 +0100
commitd21f2eb608431cd11b93aa96de3c792713829b44 (patch)
tree4cd0cf3c4e7efd52d58ecad38b1a1b35b92d4508 /libcrystfel
parent3710defb709b7ab33ae7849873c4fb62de96e138 (diff)
Don't include 1/d in reflection lists, because it's pointless
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/reflist-utils.c37
-rw-r--r--libcrystfel/src/reflist-utils.h4
-rw-r--r--libcrystfel/src/stream.c3
3 files changed, 14 insertions, 30 deletions
diff --git a/libcrystfel/src/reflist-utils.c b/libcrystfel/src/reflist-utils.c
index 8f445ff4..f8d14d7a 100644
--- a/libcrystfel/src/reflist-utils.c
+++ b/libcrystfel/src/reflist-utils.c
@@ -152,23 +152,20 @@ int find_equiv_in_list(RefList *list, signed int h, signed int k,
* write_reflections_to_file:
* @fh: File handle to write to
* @list: The reflection list to write
- * @cell: Unit cell to use for generating 1/d values, or NULL.
*
- * This function writes the contents of @list to @fh, using @cell to generate
- * 1/d values to ease later processing. If @cell is NULL, 1/d values will not
- * be included ('-' will be written in their place).
+ * This function writes the contents of @list to @fh,
*
* Reflections which have a redundancy of zero will not be written.
*
* The resulting list can be read back with read_reflections_from_file().
**/
-void write_reflections_to_file(FILE *fh, RefList *list, UnitCell *cell)
+void write_reflections_to_file(FILE *fh, RefList *list)
{
Reflection *refl;
RefListIterator *iter;
fprintf(fh, " h k l I phase sigma(I) "
- " 1/d(nm^-1) counts fs/px ss/px\n");
+ " counts fs/px ss/px\n");
for ( refl = first_refl(list, &iter);
refl != NULL;
@@ -193,13 +190,6 @@ void write_reflections_to_file(FILE *fh, RefList *list, UnitCell *cell)
/* Reflections with redundancy = 0 are not written */
if ( red == 0 ) continue;
- if ( cell != NULL ) {
- s = 2.0 * resolution(cell, h, k, l);
- snprintf(res, 16, "%10.2f", s/1e9);
- } else {
- strcpy(res, " -");
- }
-
if ( have_phase ) {
snprintf(phs, 16, "%8.2f", rad2deg(ph));
} else {
@@ -207,9 +197,8 @@ void write_reflections_to_file(FILE *fh, RefList *list, UnitCell *cell)
}
fprintf(fh,
- "%3i %3i %3i %10.2f %s %10.2f %s %7i %6.1f %6.1f\n",
- h, k, l, intensity, phs, esd_i, res, red,
- fs, ss);
+ "%3i %3i %3i %10.2f %s %10.2f %7i %6.1f %6.1f\n",
+ h, k, l, intensity, phs, esd_i, red, fs, ss);
}
}
@@ -219,11 +208,8 @@ void write_reflections_to_file(FILE *fh, RefList *list, UnitCell *cell)
* write_reflist:
* @filename: Filename
* @list: The reflection list to write
- * @cell: Unit cell to use for generating 1/d values, or NULL.
*
- * This function writes the contents of @list to @file, using @cell to generate
- * 1/d values to ease later processing. If @cell is NULL, 1/d values will not
- * be included ('-' will be written in their place).
+ * This function writes the contents of @list to @file,
*
* Reflections which have a redundancy of zero will not be written.
*
@@ -235,7 +221,7 @@ void write_reflections_to_file(FILE *fh, RefList *list, UnitCell *cell)
*
* Returns: zero on success, non-zero on failure.
**/
-int write_reflist(const char *filename, RefList *list, UnitCell *cell)
+int write_reflist(const char *filename, RefList *list)
{
FILE *fh;
@@ -250,7 +236,7 @@ int write_reflist(const char *filename, RefList *list, UnitCell *cell)
return 1;
}
- write_reflections_to_file(fh, list, cell);
+ write_reflections_to_file(fh, list);
fprintf(fh, REFLECTION_END_MARKER"\n");
fclose(fh);
@@ -284,10 +270,9 @@ RefList *read_reflections_from_file(FILE *fh)
if ( strcmp(line, REFLECTION_END_MARKER) == 0 ) return out;
- r = sscanf(line, "%i %i %i %f %s %f %s %i %f %f",
- &h, &k, &l, &intensity, phs, &sigma, ress, &cts,
- &fs, &ss);
- if ( (r != 10) && (!first) ) {
+ r = sscanf(line, "%i %i %i %f %s %f %i %f %f",
+ &h, &k, &l, &intensity, phs, &sigma, &cts, &fs, &ss);
+ if ( (r != 9) && (!first) ) {
reflist_free(out);
return NULL;
}
diff --git a/libcrystfel/src/reflist-utils.h b/libcrystfel/src/reflist-utils.h
index f03be906..b12b8dfa 100644
--- a/libcrystfel/src/reflist-utils.h
+++ b/libcrystfel/src/reflist-utils.h
@@ -38,9 +38,9 @@
#define REFLECTION_END_MARKER "End of reflections"
-extern void write_reflections_to_file(FILE *fh, RefList *list, UnitCell *cell);
+extern void write_reflections_to_file(FILE *fh, RefList *list);
-extern int write_reflist(const char *filename, RefList *list, UnitCell *cell);
+extern int write_reflist(const char *filename, RefList *list);
extern RefList *read_reflections_from_file(FILE *fh);
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 7f2e341e..486049bf 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -285,8 +285,7 @@ void write_chunk(FILE *ofh, struct image *i, struct hdfile *hdfile, int f)
if ( i->reflections != NULL ) {
fprintf(ofh, REFLECTION_START_MARKER"\n");
- write_reflections_to_file(ofh, i->reflections,
- i->indexed_cell);
+ write_reflections_to_file(ofh, i->reflections);
fprintf(ofh, REFLECTION_END_MARKER"\n");
} else {