aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-06-02 16:56:50 +0200
committerThomas White <taw@physics.org>2014-06-02 16:56:50 +0200
commitd33093b793df13b9fc6bcf4b9569caaeb0431fff (patch)
treee9c7a5549e4303494ecfcd400cf4eaabe1a3260e /src
parent108ef182aae36252a8d37ddf443d05156b6161e5 (diff)
partialator: Remove --reference
It's not a good idea, and PR works well enough now that we no longer need this for testing
Diffstat (limited to 'src')
-rw-r--r--src/hrs-scaling.c30
-rw-r--r--src/hrs-scaling.h3
-rw-r--r--src/partialator.c38
3 files changed, 13 insertions, 58 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 9602836b..cba21b74 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -480,7 +480,7 @@ static int test_convergence(double *old_osfs, int n, Crystal **crystals)
/* Scale the stack of images */
-RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
+RefList *scale_intensities(Crystal **crystals, int n,
int n_threads, int noscale, PartialityModel pmodel,
int min_redundancy)
{
@@ -501,10 +501,8 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
return full;
}
- /* No reference -> create an initial list to refine against */
- if ( gref == NULL ) {
- full = lsq_intensities(crystals, n, n_threads, pmodel);
- }
+ /* Create an initial list to refine against */
+ full = lsq_intensities(crystals, n, n_threads, pmodel);
old_osfs = malloc(n*sizeof(double));
if ( old_osfs == NULL ) return NULL;
@@ -513,7 +511,6 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
i = 0;
do {
- RefList *reference;
double total_sf = 0.0;
int n_sf = 0;
double norm_sf;
@@ -524,14 +521,7 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
crystal_set_user_flag(crystals[j], 0);
}
- /* Refine against reference or current "full" estimates */
- if ( gref != NULL ) {
- reference = gref;
- } else {
- reference = full;
- }
-
- iterate_scale(crystals, n, reference, n_threads, pmodel);
+ iterate_scale(crystals, n, full, n_threads, pmodel);
/* Normalise the scale factors */
for ( j=0; j<n; j++ ) {
@@ -550,11 +540,9 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
reject_outliers(old_osfs, n, crystals);
done = test_convergence(old_osfs, n, crystals);
- /* No reference -> generate list for next iteration */
- if ( gref == NULL ) {
- reflist_free(full);
- full = lsq_intensities(crystals, n, n_threads, pmodel);
- }
+ /* Generate list for next iteration */
+ reflist_free(full);
+ full = lsq_intensities(crystals, n, n_threads, pmodel);
i++;
@@ -564,10 +552,6 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
ERROR("Warning: Scaling did not converge.\n");
}
- if ( gref != NULL ) {
- full = lsq_intensities(crystals, n, n_threads, pmodel);
- } /* else we already did it */
-
calculate_esds(crystals, n, full, n_threads, min_redundancy, pmodel);
free(old_osfs);
diff --git a/src/hrs-scaling.h b/src/hrs-scaling.h
index 0979bb98..16368b79 100644
--- a/src/hrs-scaling.h
+++ b/src/hrs-scaling.h
@@ -39,8 +39,7 @@
#include "reflist.h"
#include "geometry.h"
-extern RefList *scale_intensities(Crystal **crystals, int n,
- RefList *reference, int n_threads,
+extern RefList *scale_intensities(Crystal **crystals, int n, int n_threads,
int noscale, PartialityModel pmodel,
int min_redundancy);
diff --git a/src/partialator.c b/src/partialator.c
index 10290fd6..8823990f 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -71,7 +71,6 @@ static void show_help(const char *s)
" -y, --symmetry=<sym> Merge according to symmetry <sym>.\n"
" -n, --iterations=<n> Run <n> cycles of scaling and post-refinement.\n"
" --no-scale Fix all the scaling factors at unity.\n"
-" -r, --reference=<file> Refine images against reflections in <file>,\n"
" -m, --model=<model> Specify partiality model.\n"
" --min-measurements=<n> Minimum number of measurements to require.\n"
" --no-polarisation Disable polarisation correction.\n"
@@ -206,8 +205,6 @@ int main(int argc, char *argv[])
RefList *full;
int n_images = 0;
int n_crystals = 0;
- char *reference_file = NULL;
- RefList *reference = NULL;
char cmdline[1024];
SRContext *sr;
int noscale = 0;
@@ -250,7 +247,7 @@ int main(int argc, char *argv[])
}
/* Short options */
- while ((c = getopt_long(argc, argv, "hi:o:g:b:y:n:r:j:m:",
+ while ((c = getopt_long(argc, argv, "hi:o:g:b:y:n:j:m:",
longopts, NULL)) != -1)
{
@@ -289,10 +286,6 @@ int main(int argc, char *argv[])
pmodel_str = strdup(optarg);
break;
- case 'r' :
- reference_file = strdup(optarg);
- break;
-
case 2 :
errno = 0;
min_measurements = strtod(optarg, &rval);
@@ -353,21 +346,6 @@ int main(int argc, char *argv[])
}
}
- if ( reference_file != NULL ) {
-
- RefList *list;
-
- list = read_reflections(reference_file);
- if ( list == NULL ) {
- ERROR("Failed to read '%s'\n", reference_file);
- return 1;
- }
- free(reference_file);
- reference = asymmetric_indices(list, sym);
- reflist_free(list);
-
- }
-
gsl_set_error_handler_off();
/* Fill in what we know about the images so far */
@@ -477,7 +455,7 @@ int main(int argc, char *argv[])
/* Make initial estimates */
STATUS("Performing initial scaling.\n");
if ( noscale ) STATUS("Scale factors fixed at 1.\n");
- full = scale_intensities(crystals, n_crystals, reference,
+ full = scale_intensities(crystals, n_crystals,
nthreads, noscale, pmodel, min_measurements);
srdata.crystals = crystals;
@@ -497,15 +475,13 @@ int main(int argc, char *argv[])
int n_lost = 0;
int n_dud = 0;
int j;
- RefList *comp;
STATUS("Post refinement cycle %i of %i\n", i+1, n_iter);
srdata.n_filtered = 0;
/* Refine the geometry of all patterns to get the best fit */
- comp = (reference == NULL) ? full : reference;
- refine_all(crystals, n_crystals, comp, nthreads, pmodel,
+ refine_all(crystals, n_crystals, full, nthreads, pmodel,
&srdata);
for ( j=0; j<n_crystals; j++ ) {
@@ -533,9 +509,8 @@ int main(int argc, char *argv[])
}
/* Re-estimate all the full intensities */
reflist_free(full);
- full = scale_intensities(crystals, n_crystals,
- reference, nthreads, noscale, pmodel,
- min_measurements);
+ full = scale_intensities(crystals, n_crystals, nthreads,
+ noscale, pmodel, min_measurements);
srdata.full = full;
@@ -572,9 +547,6 @@ int main(int argc, char *argv[])
free(sym);
free(outfile);
free(crystals);
- if ( reference != NULL ) {
- reflist_free(reference);
- }
for ( i=0; i<n_images; i++ ) {
free(images[i].filename);
}