aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-07-31 14:22:45 +0200
committerThomas White <taw@physics.org>2020-07-31 14:22:45 +0200
commit73236236920006b0b8eeb9ddadfd47c1cddf26a5 (patch)
treeae73a0cd5d4547bb31c1db28c81dd2d1aba6ba25 /libcrystfel
parent98a00c7930744a3c4fe69b0de60a6f9a86cd4f17 (diff)
Set bandwidth in image structure
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/datatemplate.c8
-rw-r--r--libcrystfel/src/datatemplate_priv.h4
-rw-r--r--libcrystfel/src/image.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c
index 94522f2f..5941109e 100644
--- a/libcrystfel/src/datatemplate.c
+++ b/libcrystfel/src/datatemplate.c
@@ -780,14 +780,14 @@ static int parse_toplevel(DataTemplate *dt,
} else if ( strcmp(key, "peak_list") == 0 ) {
dt->peak_list = strdup(val);
- } else if ( strcmp(key, "photon_energy_bandwidth") == 0 ) {
+ } else if ( strcmp(key, "bandwidth") == 0 ) {
double v;
char *end;
v = strtod(val, &end);
if ( (val[0] != '\0') && (end[0] == '\0') ) {
- dt->photon_energy_bandwidth = v;
+ dt->bandwidth = v;
} else {
- ERROR("Invalid value for photon_energy_bandwidth\n");
+ ERROR("Invalid value for bandwidth\n");
}
} else if (strncmp(key, "rigid_group", 11) == 0
@@ -875,7 +875,7 @@ DataTemplate *data_template_new_from_string(const char *string_in)
dt->rigid_groups = NULL;
dt->n_rg_collections = 0;
dt->rigid_group_collections = NULL;
- dt->photon_energy_bandwidth = -1.0;
+ dt->bandwidth = 0.0;
dt->peak_list = NULL;
dt->shift_x_from = NULL;
dt->shift_y_from = NULL;
diff --git a/libcrystfel/src/datatemplate_priv.h b/libcrystfel/src/datatemplate_priv.h
index e9ce3ccb..15495cef 100644
--- a/libcrystfel/src/datatemplate_priv.h
+++ b/libcrystfel/src/datatemplate_priv.h
@@ -188,10 +188,10 @@ struct _datatemplate
int n_bad;
char *wavelength_from;
- double photon_energy_bandwidth; /* Eww */
-
enum wavelength_unit wavelength_unit;
+ double bandwidth;
+
unsigned int mask_bad;
unsigned int mask_good;
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index cf7f1331..bfb3d760 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -614,6 +614,8 @@ struct image *image_read(DataTemplate *dtempl,
dtempl->wavelength_from),
dtempl->wavelength_unit);
+ image->bw = dtempl->bandwidth;
+
create_detgeom(image, dtempl);
image->bad = malloc(dtempl->n_panels * sizeof(int *));