aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-02-09 16:08:27 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:14 +0100
commitda51525409db6ac1ac41460d2ce5a4eea26775de (patch)
treec0dd4bbe931f614e395c28b07e18ce1273683eef /src
parent467009dbfad7d41231067baa5961e02f8e31d8d0 (diff)
The per-shot wavelength is needed for scaling and post refinement
Diffstat (limited to 'src')
-rw-r--r--src/cubeit.c3
-rw-r--r--src/estimate_background.c3
-rw-r--r--src/partialator.c8
-rw-r--r--src/peaks.c3
-rw-r--r--src/reintegrate.c3
-rw-r--r--src/stream.c6
-rw-r--r--src/stream.h2
7 files changed, 20 insertions, 8 deletions
diff --git a/src/cubeit.c b/src/cubeit.c
index 7b40f8e5..30deb724 100644
--- a/src/cubeit.c
+++ b/src/cubeit.c
@@ -392,9 +392,10 @@ static void *get_image(void *qp)
struct queue_args *qargs = qp;
UnitCell *cell;
char *filename;
+ double ph_ev;
/* Get the next filename */
- if ( find_chunk(qargs->fh, &cell, &filename) ) {
+ if ( find_chunk(qargs->fh, &cell, &filename, &ph_ev) ) {
return NULL;
}
diff --git a/src/estimate_background.c b/src/estimate_background.c
index 6dd1b3c6..1f956377 100644
--- a/src/estimate_background.c
+++ b/src/estimate_background.c
@@ -154,8 +154,9 @@ int main(int argc, char *argv[])
char *filename;
char line[1024];
int done = 0;
+ double ph_ev;
- rval = find_chunk(fh, &cell, &filename);
+ rval = find_chunk(fh, &cell, &filename, &ph_ev);
if ( rval != 0 ) break;
do {
diff --git a/src/partialator.c b/src/partialator.c
index 3251f7e8..71f2831a 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -277,10 +277,11 @@ int main(int argc, char *argv[])
RefList *transfer;
Reflection *refl;
RefListIterator *iter;
+ double ph_en;
- if ( find_chunk(fh, &cell, &filename) == 1 ) {
- ERROR("Couldn't get all of the filenames and cells"
- " from the input stream.\n");
+ if ( find_chunk(fh, &cell, &filename, &ph_en) == 1 ) {
+ ERROR("Couldn't get all of the filenames, cells and"
+ "wavelengths from the input stream.\n");
return 1;
}
@@ -294,6 +295,7 @@ int main(int argc, char *argv[])
images[i].osf = 1.0;
images[i].profile_radius = 0.005e9;
images[i].reflections = reflist_new();
+ images[i].lambda = ph_en_to_lambda(eV_to_J(ph_en));
/* Muppet proofing */
images[i].data = NULL;
diff --git a/src/peaks.c b/src/peaks.c
index 4ae0a70b..fa0d2843 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -657,6 +657,9 @@ static void output_header(FILE *ofh, UnitCell *cell, struct image *image)
fprintf(ofh, "f0 = invalid\n");
}
+ fprintf(ofh, "photon_energy_eV = %f\n",
+ J_to_eV(ph_lambda_to_en(image->lambda)));
+
}
diff --git a/src/reintegrate.c b/src/reintegrate.c
index 09634cd7..a3ee85c9 100644
--- a/src/reintegrate.c
+++ b/src/reintegrate.c
@@ -158,9 +158,10 @@ static void *get_image(void *qp)
struct queue_args *qargs = qp;
UnitCell *cell;
char *filename;
+ double ph_ev;
/* Get the next filename */
- if ( find_chunk(qargs->fh, &cell, &filename) ) {
+ if ( find_chunk(qargs->fh, &cell, &filename, &ph_ev) ) {
return NULL;
}
diff --git a/src/stream.c b/src/stream.c
index 950069fb..d6a91be9 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -147,7 +147,7 @@ static UnitCell *read_orientation_matrix_rick(FILE *fh)
}
-int find_chunk(FILE *fh, UnitCell **cell, char **filename)
+int find_chunk(FILE *fh, UnitCell **cell, char **filename, double *ev)
{
char line[1024];
char *rval = NULL;
@@ -159,6 +159,10 @@ int find_chunk(FILE *fh, UnitCell **cell, char **filename)
chomp(line);
+ if ( strncmp(line, "photon_energy_eV = ", 19) == 0 ) {
+ *ev = atof(line+19);
+ }
+
/* Look for the first line of a chunk */
if ( (strncmp(line, "Reflections from indexing", 25) != 0)
&& (strncmp(line, "## h5FilePath:", 14) != 0 ) ) {
diff --git a/src/stream.h b/src/stream.h
index b21b5e4d..5865aeca 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -18,7 +18,7 @@
extern int count_patterns(FILE *fh);
-extern int find_chunk(FILE *fh, UnitCell **cell, char **filename);
+extern int find_chunk(FILE *fh, UnitCell **cell, char **filename, double *ev);
#endif /* STREAM_H */