aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-14 14:14:06 +0100
committerThomas White <taw@physics.org>2017-05-02 12:03:12 +0200
commit8fbfaf71b1efef4bfdb40ce85200e772e82e9773 (patch)
treeb1b7fab1e2a5d55c8d43d645e4214633991120e7 /libcrystfel
parent4227f0b190b08ecc50a49875e86dbb9b14714bdd (diff)
Initial CBF stuff
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image.c4
-rw-r--r--libcrystfel/src/image.h17
-rw-r--r--libcrystfel/src/stream.c6
-rw-r--r--libcrystfel/src/stream.h9
4 files changed, 27 insertions, 9 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 09f4958d..2cc0d792 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -3,12 +3,12 @@
*
* Handle images and image features
*
- * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
* 2014 Kenneth Beyerlein <kenneth.beyerlein@desy.de>
- * 2011-2016 Thomas White <taw@physics.org>
+ * 2011-2017 Thomas White <taw@physics.org>
*
* This file is part of CrystFEL.
*
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h
index 9fd9b495..2ed7140f 100644
--- a/libcrystfel/src/image.h
+++ b/libcrystfel/src/image.h
@@ -3,11 +3,11 @@
*
* Handle images and image features
*
- * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2009-2016 Thomas White <taw@physics.org>
+ * 2009-2017 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
*
*
@@ -44,6 +44,8 @@ struct detector;
struct imagefeature;
struct sample;
struct image;
+struct imagefile;
+struct imagefile_field_list;
#include "utils.h"
#include "cell.h"
@@ -51,6 +53,7 @@ struct image;
#include "reflist.h"
#include "crystal.h"
#include "index.h"
+#include "events.h"
/**
* SpectrumType:
@@ -233,6 +236,16 @@ extern void image_add_crystal(struct image *image, Crystal *cryst);
extern void remove_flagged_crystals(struct image *image);
extern void free_all_crystals(struct image *image);
+/* Image files */
+extern struct imagefile *imagefile_open(const char *filename);
+extern int imagefile_read(struct imagefile *imfile, struct image *image,
+ struct event *event);
+extern struct hdfile *imagefile_get_hdfile(struct imagefile *imfile);
+extern void imagefile_copy_fields(struct imagefile *imfile,
+ struct copy_hdf5_file *copyme, FILE *fh,
+ struct event *ev);
+extern void imagefile_close(struct imagefile *imfile);
+
#ifdef __cplusplus
}
#endif
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 17da74b2..fb4b0c70 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -806,8 +806,8 @@ static int write_crystal(Stream *st, Crystal *cr, int include_reflections)
}
-int write_chunk(Stream *st, struct image *i, struct hdfile *hdfile,
- int include_peaks, int include_reflections, struct event* ev)
+int write_chunk(Stream *st, struct image *i, struct imagefile *imfile,
+ int include_peaks, int include_reflections, struct event *ev)
{
int j;
char *indexer;
@@ -832,7 +832,7 @@ int write_chunk(Stream *st, struct image *i, struct hdfile *hdfile,
fprintf(st->fh, "beam_divergence = %.2e rad\n", i->div);
fprintf(st->fh, "beam_bandwidth = %.2e (fraction)\n", i->bw);
- copy_hdf5_fields(hdfile, i->copyme, st->fh, ev);
+ imagefile_copy_fields(imfile, i->copyme, st->fh, ev);
if ( i->det != NULL ) {
diff --git a/libcrystfel/src/stream.h b/libcrystfel/src/stream.h
index ff8628c0..a95c7df0 100644
--- a/libcrystfel/src/stream.h
+++ b/libcrystfel/src/stream.h
@@ -3,11 +3,11 @@
*
* Stream tools
*
- * Copyright © 2013-2014 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2013-2017 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2010-2014 Thomas White <taw@physics.org>
+ * 2010-2017 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
* 2011 Andrew Aquila
*
@@ -110,6 +110,11 @@ extern int write_chunk(Stream *st, struct image *image, struct hdfile *hdfile,
int include_peaks, int include_reflections,
struct event *ev);
+extern int write_chunk_2(Stream *st, struct image *image,
+ struct imagefile *imfile,
+ int include_peaks, int include_reflections,
+ struct event *ev);
+
extern void write_command(Stream *st, int argc, char *argv[]);
extern void write_geometry_file(Stream *st, const char *geom_filename);
extern int rewind_stream(Stream *st);