aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-07-10 15:12:23 +0200
committerThomas White <taw@physics.org>2020-07-29 18:53:45 +0200
commit6c3b71214cbce3de1d12c4cd2f12d68a96bccfab (patch)
tree83ec9880718d389f534d3a5a3f6bf7c39ae4b050 /src
parent465f36e8fa43e371142ee6861c56403f13e7d12d (diff)
partialator/process_hkl: Use geometry
Diffstat (limited to 'src')
-rw-r--r--src/partialator.c19
-rw-r--r--src/process_hkl.c25
2 files changed, 38 insertions, 6 deletions
diff --git a/src/partialator.c b/src/partialator.c
index a9930d9e..1f87e6b8 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -945,6 +945,8 @@ int main(int argc, char *argv[])
PartialityModel pmodel = PMODEL_XSPHERE;
int min_measurements = 2;
char *rval;
+ const char *geom_str;
+ DataTemplate *dtempl;
struct polarisation polarisation = {.fraction = 1.0,
.angle = 0.0,
.disable = 0};
@@ -1217,6 +1219,19 @@ int main(int argc, char *argv[])
return 1;
}
+ geom_str = stream_geometry_file(st);
+ if ( geom_str == NULL ) {
+ ERROR("No geometry file\n");
+ stream_close(st);
+ return 1;
+ }
+
+ dtempl = data_template_new_from_string(geom_str);
+ if ( dtempl == NULL ) {
+ stream_close(st);
+ return 1;
+ }
+
if ( outfile == NULL ) {
outfile = strdup("partialator.hkl");
}
@@ -1375,8 +1390,8 @@ int main(int argc, char *argv[])
RefList *as;
int i;
- image = stream_read_chunk(st, NULL, STREAM_REFLECTIONS
- | STREAM_UNITCELL);
+ image = stream_read_chunk(st, dtempl, STREAM_REFLECTIONS
+ | STREAM_UNITCELL);
if ( image == NULL ) break;
if ( isnan(image->div) || isnan(image->bw) ) {
diff --git a/src/process_hkl.c b/src/process_hkl.c
index 4fe1dbeb..b840f4ce 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -395,7 +395,8 @@ static void display_progress(int n_images, int n_crystals, int n_crystals_used)
}
-static int merge_all(Stream *st, RefList *model, RefList *reference,
+static int merge_all(Stream *st, DataTemplate *dtempl,
+ RefList *model, RefList *reference,
const SymOpList *sym,
double **hist_vals, signed int hist_h,
signed int hist_k, signed int hist_l,
@@ -428,7 +429,7 @@ static int merge_all(Stream *st, RefList *model, RefList *reference,
int i;
/* Get data from next chunk */
- image = stream_read_chunk(st, NULL,
+ image = stream_read_chunk(st, dtempl,
STREAM_REFLECTIONS
| STREAM_UNITCELL);
if ( image == NULL ) break;
@@ -514,6 +515,8 @@ int main(int argc, char *argv[])
int hist_i;
int space_for_hist = 0;
char *histo_params = NULL;
+ const char *geom_str;
+ DataTemplate *dtempl;
struct polarisation polarisation = {.fraction = 1.0,
.angle = 0.0,
.disable = 0};
@@ -723,6 +726,19 @@ int main(int argc, char *argv[])
return 1;
}
+ geom_str = stream_geometry_file(st);
+ if ( geom_str == NULL ) {
+ ERROR("No geometry file found in stream\n");
+ stream_close(st);
+ return 1;
+ }
+
+ dtempl = data_template_new_from_string(geom_str);
+ if ( dtempl == NULL ) {
+ stream_close(st);
+ return 1;
+ }
+
model = reflist_new();
if ( histo != NULL ) {
@@ -779,7 +795,8 @@ int main(int argc, char *argv[])
if ( config_scale ) twopass = 1;
hist_i = 0;
- r = merge_all(st, model, NULL, sym, &hist_vals, hist_h, hist_k, hist_l,
+ r = merge_all(st, dtempl, model, NULL, sym,
+ &hist_vals, hist_h, hist_k, hist_l,
&hist_i, polarisation, min_measurements, min_snr,
max_adu, start_after, stop_after, min_res, push_res,
min_cc, config_scale, flag_even_odd, stat_output);
@@ -813,7 +830,7 @@ int main(int argc, char *argv[])
hist_i = 0;
}
- r = merge_all(st, model, reference, sym, &hist_vals,
+ r = merge_all(st, dtempl, model, reference, sym, &hist_vals,
hist_h, hist_k, hist_l, &hist_i,
polarisation, min_measurements, min_snr,
max_adu, start_after, stop_after, min_res,