From 73236236920006b0b8eeb9ddadfd47c1cddf26a5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 31 Jul 2020 14:22:45 +0200 Subject: Set bandwidth in image structure --- libcrystfel/src/datatemplate.c | 8 ++++---- libcrystfel/src/datatemplate_priv.h | 4 ++-- libcrystfel/src/image.c | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'libcrystfel') 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 *)); -- cgit v1.2.3