diff -r -u 20110907/ccp4-6.2.0/configure 20110921/ccp4-6.2.0/configure
--- 20110907/ccp4-6.2.0/configure	2011-05-05 16:07:55.000000000 +0100
+++ 20110921/ccp4-6.2.0/configure	2011-09-08 15:01:01.000000000 +0100
@@ -4428,14 +4428,14 @@
   xopts="${xopts} --with-ccp4=${prefix}"
   if test "$non_shared" = yes; then
 #this is a bit of a cheat/fudge but that's life!
-      xopts="${xopts} cmaplocal_LDFLAGS=-static cmakereference_LDFLAGS=-static caniso_LDFLAGS=-static cecalc_LDFLAGS=-static cfft_LDFLAGS=-static chltofom_LDFLAGS=-static cinvfft_LDFLAGS=-static convert2mtz_LDFLAGS=-static cpatterson_LDFLAGS=-static cphasecombine_LDFLAGS=-static cphasematch_LDFLAGS=-static csfcalc_LDFLAGS=-static csigmaa_LDFLAGS=-static csymmatch_LDFLAGS=-static ctruncate_LDFLAGS=-static cpirate_LDFLAGS=-static cbuccaneer_LDFLAGS=-static csequins_LDFLAGS=-static cparrot_LDFLAGS=-static cmodeltoseq_LDFLAGS=-static cnsfrommodel_LDFLAGS=-static"
+      xopts="${xopts} cmaplocal_LDFLAGS=-static cmakereference_LDFLAGS=-static caniso_LDFLAGS=-static cecalc_LDFLAGS=-static cfft_LDFLAGS=-static chltofom_LDFLAGS=-static cinvfft_LDFLAGS=-static convert2mtz_LDFLAGS=-static cpatterson_LDFLAGS=-static cphasecombine_LDFLAGS=-static cphasematch_LDFLAGS=-static csfcalc_LDFLAGS=-static csigmaa_LDFLAGS=-static csymmatch_LDFLAGS=-static ctruncate_LDFLAGS=-static cpirate_LDFLAGS=-static cbuccaneer_LDFLAGS=-static csequins_LDFLAGS=-static cparrot_LDFLAGS=-static cmodeltoseq_LDFLAGS=-static cncsfrommodel_LDFLAGS=-static"
   fi
   if test "$static_libgcc" = yes; then
 #this is a bit of a cheat/fudge but that's life!
       if test "$shared_lib" = yes ; then
-      xopts="${xopts} cmaplocal_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cmakereference_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' caniso_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cecalc_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cfft_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' chltofom_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cinvfft_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' convert2mtz_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cpatterson_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cphasecombine_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cphasematch_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csfcalc_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csigmaa_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csymmatch_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc'  ctruncate_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cpirate_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cbuccaneer_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csequins_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cparrot_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cmodeltoseq_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cnsfrommodel_LDFLAGS='-Wl,-rpath\\\$\$ORIGIN/../lib -z origin -static-libgcc'"
+      xopts="${xopts} cmaplocal_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cmakereference_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' caniso_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cecalc_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cfft_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' chltofom_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cinvfft_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' convert2mtz_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cpatterson_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cphasecombine_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cphasematch_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csfcalc_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csigmaa_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csymmatch_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc'  ctruncate_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cpirate_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cbuccaneer_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' csequins_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cparrot_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cmodeltoseq_LDFLAGS='-Wl,-rpath,\\\$\$ORIGIN/../lib -z origin -static-libgcc' cncsfrommodel_LDFLAGS='-Wl,-rpath\\\$\$ORIGIN/../lib -z origin -static-libgcc'"
       else
-      xopts="${xopts} cmaplocal_LDFLAGS=-static-libgcc cmakereference_LDFLAGS=-static-libgcc caniso_LDFLAGS=-static-libgcc cecalc_LDFLAGS=-static-libgcc cfft_LDFLAGS=-static-libgcc chltofom_LDFLAGS=-static-libgcc cinvfft_LDFLAGS=-static-libgcc convert2mtz_LDFLAGS=-static-libgcc cpatterson_LDFLAGS=-static-libgcc cphasecombine_LDFLAGS=-static-libgcc cphasematch_LDFLAGS=-static-libgcc csfcalc_LDFLAGS=-static-libgcc csigmaa_LDFLAGS=-static-libgcc csymmatch_LDFLAGS=-static-libgcc ctruncate_LDFLAGS=-static-libgcc cpirate_LDFLAGS=-static-libgcc cbuccaneer_LDFLAGS=-static-libgcc csequins_LDFLAGS=-static-libgcc cparrot_LDFLAGS=-static-libgcc cmodeltoseq_LDFLAGS=-static-libgcc cnsfrommodel_LDFLAGS=-static-libgcc"
+      xopts="${xopts} cmaplocal_LDFLAGS=-static-libgcc cmakereference_LDFLAGS=-static-libgcc caniso_LDFLAGS=-static-libgcc cecalc_LDFLAGS=-static-libgcc cfft_LDFLAGS=-static-libgcc chltofom_LDFLAGS=-static-libgcc cinvfft_LDFLAGS=-static-libgcc convert2mtz_LDFLAGS=-static-libgcc cpatterson_LDFLAGS=-static-libgcc cphasecombine_LDFLAGS=-static-libgcc cphasematch_LDFLAGS=-static-libgcc csfcalc_LDFLAGS=-static-libgcc csigmaa_LDFLAGS=-static-libgcc csymmatch_LDFLAGS=-static-libgcc ctruncate_LDFLAGS=-static-libgcc cpirate_LDFLAGS=-static-libgcc cbuccaneer_LDFLAGS=-static-libgcc csequins_LDFLAGS=-static-libgcc cparrot_LDFLAGS=-static-libgcc cmodeltoseq_LDFLAGS=-static-libgcc cncsfrommodel_LDFLAGS=-static-libgcc"
       fi
   fi
   if test -z "$onlylibs" ; then
diff -r -u 20110907/ccp4-6.2.0/share/BALBES/Package/bin_py/UtilitiesClasses.py 20110921/ccp4-6.2.0/share/BALBES/Package/bin_py/UtilitiesClasses.py
--- 20110907/ccp4-6.2.0/share/BALBES/Package/bin_py/UtilitiesClasses.py	2010-12-16 16:05:04.000000000 +0000
+++ 20110921/ccp4-6.2.0/share/BALBES/Package/bin_py/UtilitiesClasses.py	2011-09-09 12:55:30.000000000 +0100
@@ -63,7 +63,13 @@
         # use local disk at the node for 
         # (1) scratch dir (molrep, refmac both write frequently to scratch)
         # (2) maybe database searching and MR template model building (that needs local database) ? 
-        self['local']            = os.environ['TMPDIR']
+        try:
+            self['local']            = os.environ['CCP4_SCR']
+        except:
+            try:
+                self['local']            = os.environ['TMPDIR']
+            except:
+                self['local']            = '/tmp'
         self['local_pdb_path']   = "/data2/fei/Database_BALBES/All_pdb/All"
        
         self['start_time'] = time.ctime(time.time() )
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/Makefile.in	2010-11-18 13:11:38.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/Makefile.in	2011-09-08 15:02:56.000000000 +0100
@@ -162,7 +162,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/configure 20110921/ccp4-6.2.0/src/clipper_progs/configure
--- 20110907/ccp4-6.2.0/src/clipper_progs/configure	2010-11-18 13:10:02.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/configure	2011-09-08 15:02:04.000000000 +0100
@@ -716,7 +716,7 @@
 cmaplocal_LDFLAGS
 cmakereference_LDFLAGS
 cmodeltoseq_LDFLAGS
-cnsfrommodel_LDFLAGS
+cncsfrommodel_LDFLAGS
 csloop_LDFLAGS
 LIBOBJS
 LTLIBOBJS'
@@ -7137,7 +7137,7 @@
 cmaplocal_LDFLAGS!$cmaplocal_LDFLAGS$ac_delim
 cmakereference_LDFLAGS!$cmakereference_LDFLAGS$ac_delim
 cmodeltoseq_LDFLAGS!$cmodeltoseq_LDFLAGS$ac_delim
-cnsfrommodel_LDFLAGS!$cnsfrommodel_LDFLAGS$ac_delim
+cncsfrommodel_LDFLAGS!$cncsfrommodel_LDFLAGS$ac_delim
 csloop_LDFLAGS!$csloop_LDFLAGS$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/configure.ac 20110921/ccp4-6.2.0/src/clipper_progs/configure.ac
--- 20110907/ccp4-6.2.0/src/clipper_progs/configure.ac	2010-11-18 13:08:29.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/configure.ac	2011-09-08 15:02:46.000000000 +0100
@@ -158,7 +158,7 @@
 AC_SUBST(cmaplocal_LDFLAGS)
 AC_SUBST(cmakereference_LDFLAGS)
 AC_SUBST(cmodeltoseq_LDFLAGS)
-AC_SUBST(cnsfrommodel_LDFLAGS)
+AC_SUBST(cncsfrommodel_LDFLAGS)
 AC_SUBST(csloop_LDFLAGS)
 
 AC_CONFIG_FILES([Makefile
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/html/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/html/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/html/Makefile.in	2010-10-22 14:29:51.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/clipper_progs/html/Makefile.in	2011-09-08 15:03:08.000000000 +0100
@@ -146,7 +146,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/src/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/src/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/src/Makefile.in	2010-11-18 13:13:19.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/src/Makefile.in	2011-09-08 15:04:12.000000000 +0100
@@ -260,7 +260,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/src/buccaneer/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/src/buccaneer/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/src/buccaneer/Makefile.in	2010-11-18 13:13:22.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/src/buccaneer/Makefile.in	2011-09-08 15:03:22.000000000 +0100
@@ -177,7 +177,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/src/parrot/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/src/parrot/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/src/parrot/Makefile.in	2010-11-18 13:13:26.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/src/parrot/Makefile.in	2011-09-08 15:03:33.000000000 +0100
@@ -163,7 +163,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/src/pirate/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/src/pirate/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/src/pirate/Makefile.in	2010-11-18 13:13:28.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/src/pirate/Makefile.in	2011-09-08 15:03:46.000000000 +0100
@@ -168,7 +168,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/clipper_progs/src/sloop/Makefile.in 20110921/ccp4-6.2.0/src/clipper_progs/src/sloop/Makefile.in
--- 20110907/ccp4-6.2.0/src/clipper_progs/src/sloop/Makefile.in	2010-11-24 10:14:42.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/clipper_progs/src/sloop/Makefile.in	2011-09-08 15:04:01.000000000 +0100
@@ -170,7 +170,7 @@
 cmakereference_LDFLAGS = @cmakereference_LDFLAGS@
 cmaplocal_LDFLAGS = @cmaplocal_LDFLAGS@
 cmodeltoseq_LDFLAGS = @cmodeltoseq_LDFLAGS@
-cnsfrommodel_LDFLAGS = @cnsfrommodel_LDFLAGS@
+cncsfrommodel_LDFLAGS = @cncsfrommodel_LDFLAGS@
 convert2mtz_LDFLAGS = @convert2mtz_LDFLAGS@
 cparrot_LDFLAGS = @cparrot_LDFLAGS@
 cpatterson_LDFLAGS = @cpatterson_LDFLAGS@
diff -r -u 20110907/ccp4-6.2.0/src/pointless/ChangeLog 20110921/ccp4-6.2.0/src/pointless/ChangeLog
--- 20110907/ccp4-6.2.0/src/pointless/ChangeLog	2011-05-16 16:00:09.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/ChangeLog	2011-09-06 17:49:04.000000000 +0100
@@ -1,5 +1,25 @@
 Release notes
 
+1.6.4
+ - Reindexing merged files now deals properly with phase and ABCD columns,
+eg for I2<->C2 or P2 21 21 <-> P21 21 2 conversions
+Improved/fixed detection of new space group after reindexing
+
+1.6.3
+ - Trap "*****" fields from format overflow in XDS headers, just to give a sensible error message
+
+1.6.2
+ - XDS XSCALE now puts [U] = [I] to evade bug in Reindex, used in Xia2. Also restored the History record in the MTZ header (lost at some previous point)
+
+1.6.1
+ - fixed serious bug present in all 1.5.x versions. If an MTZ file
+input is in the highest point group of the higher symmetry group,
+specifically 422, 622, R32 or 432, and the final output file is in the
+same point group, then the symmetry operators were scrambled relative
+to the ISYM flags on the observations, leading to wrong original hkl
+being genereated in Scala/Aimless: this then affects the secondary beam
+calculation and hence the absorption correction
+
 1.5.22
  - WILDFILE option
 
diff -r -u 20110907/ccp4-6.2.0/src/pointless/configure 20110921/ccp4-6.2.0/src/pointless/configure
--- 20110907/ccp4-6.2.0/src/pointless/configure	2011-06-18 21:59:50.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/configure	2011-08-03 11:11:25.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for pointless 1.5.22.
+# Generated by GNU Autoconf 2.61 for pointless 1.6.2.
 #
 # Report bugs to <pre@lmb-mrc.ac.uk>.
 #
@@ -574,8 +574,8 @@
 # Identity of this package.
 PACKAGE_NAME='pointless'
 PACKAGE_TARNAME='pointless'
-PACKAGE_VERSION='1.5.22'
-PACKAGE_STRING='pointless 1.5.22'
+PACKAGE_VERSION='1.6.2'
+PACKAGE_STRING='pointless 1.6.2'
 PACKAGE_BUGREPORT='pre@lmb-mrc.ac.uk'
 
 ac_unique_file="pointless.cpp"
@@ -1223,7 +1223,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pointless 1.5.22 to adapt to many kinds of systems.
+\`configure' configures pointless 1.6.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1294,7 +1294,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pointless 1.5.22:";;
+     short | recursive ) echo "Configuration of pointless 1.6.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1399,7 +1399,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pointless configure 1.5.22
+pointless configure 1.6.2
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1413,7 +1413,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pointless $as_me 1.5.22, which was
+It was created by pointless $as_me 1.6.2, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2231,7 +2231,7 @@
 
 # Define the identity of the package.
  PACKAGE=pointless
- VERSION=1.5.22
+ VERSION=1.6.2
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5725,6 +5725,7 @@
 include/ccp4
 lib
 lib/src
+lib/libccp4/ccp4
 lib/ccif'
 for ac_dir in $ac_ccp4_dirs; do
   if test -r "$ccp4_prefix/$ac_dir/ccp4_errno.h"; then
@@ -5856,7 +5857,7 @@
 echo "$as_me: WARNING: assuming library $CCP4_LIBS headers $CCP4_CXXFLAGS" >&2;}
         have_ccp4=yes
       else
-        CCP4_CXXFLAGS="-I$ccp4_prefix/lib/src"
+        CCP4_CXXFLAGS="-I$ccp4_prefix/lib/src -I$ccp4_prefix/lib/libccp4/ccp4"
         CCP4_LIBS="-L$ccp4_prefix/lib/src -L$ccp4_prefix/lib -lccp4f -lccp4c -lccif -lmmdb"
         { echo "$as_me:$LINENO: WARNING: assuming library $CCP4_LIBS headers $CCP4_CXXFLAGS" >&5
 echo "$as_me: WARNING: assuming library $CCP4_LIBS headers $CCP4_CXXFLAGS" >&2;}
@@ -5938,8 +5939,6 @@
  ac_CCTBX_LDOPTS="-lcctbx"
 fi
 
-
-
 # Check whether --enable-boost was given.
 if test "${enable_boost+set}" = set; then
   enableval=$enable_boost;
@@ -7362,7 +7361,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pointless $as_me 1.5.22, which was
+This file was extended by pointless $as_me 1.6.2, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7409,7 +7408,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-pointless config.status 1.5.22
+pointless config.status 1.5.1
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -r -u 20110907/ccp4-6.2.0/src/pointless/configure.ac 20110921/ccp4-6.2.0/src/pointless/configure.ac
--- 20110907/ccp4-6.2.0/src/pointless/configure.ac	2011-06-18 21:59:52.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/configure.ac	2011-09-07 12:12:30.000000000 +0100
@@ -2,13 +2,13 @@
 # Process this file with autoconf to produce a configure script.
 
 dnl package-name version-number bugs-to:
-AC_INIT(pointless, 1.5.22, pre@lmb-mrc.ac.uk) 
+AC_INIT(pointless, 1.6.2, pre@lmb-mrc.ac.uk) 
 
 AC_CANONICAL_TARGET
 
 dnl package-name version-number, the gzip'd tar file is named
 dnl package-version.tar.gz.  
-AM_INIT_AUTOMAKE(pointless, 1.5.22)
+AM_INIT_AUTOMAKE(pointless, 1.6.2)
 
 AC_CONFIG_SRCDIR([pointless.cpp])
 
@@ -51,7 +51,7 @@
         AC_MSG_WARN([assuming library $CCP4_LIBS headers $CCP4_CXXFLAGS])
         have_ccp4=yes
       else
-        CCP4_CXXFLAGS="-I$ccp4_prefix/lib/src"
+        CCP4_CXXFLAGS="-I$ccp4_prefix/lib/src -I$ccp4_prefix/lib/libccp4/ccp4"
         CCP4_LIBS="-L$ccp4_prefix/lib/src -L$ccp4_prefix/lib -lccp4f -lccp4c -lccif -lmmdb"
         AC_MSG_WARN([assuming library $CCP4_LIBS headers $CCP4_CXXFLAGS])
         have_ccp4=yes
diff -r -u 20110907/ccp4-6.2.0/src/pointless/controls.cpp 20110921/ccp4-6.2.0/src/pointless/controls.cpp
--- 20110907/ccp4-6.2.0/src/pointless/controls.cpp	2011-05-09 10:24:49.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/controls.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -103,9 +103,15 @@
   // Set up observation_part class (static method) with current flags
   // conditional on Ipr present or absent (col_Ipr == 0 absent)
   {
-    if (col_Ipr <= 0) SelectIcolFlag = 0;
+    if (col_Ipr <= 0) {
+      SelectIcolFlag = 0;
+      prfpresent = false;
+    } else {
+      prfpresent = true; // both profile-fitted and summation intensities
+    }
     int Iflag = SelectIcolFlag;
     SelectI::SetIcolFlag(Iflag, imid, IpowerComb);
+    SelectI::SetIprPresent(prfpresent);
   }
   //------------------------------------------------------------
   std::string RejectFlags::formatReject2Policy() const
@@ -196,7 +202,8 @@
     ncycles = 10;
     converge = 0.3;
     iovsdmin = -3.0;
-    e2min = 1.0;
+    e2min = 0.8;
+    e2max = 5.0;
   }
   //------------------------------------------------------------
 }
diff -r -u 20110907/ccp4-6.2.0/src/pointless/controls.hh 20110921/ccp4-6.2.0/src/pointless/controls.hh
--- 20110907/ccp4-6.2.0/src/pointless/controls.hh	2011-06-18 21:59:53.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/controls.hh	2011-09-06 17:49:04.000000000 +0100
@@ -122,7 +122,7 @@
 //  (a) profile-fitted or integrated intensity column
 {
 public:
-  col_controls() : SelectIcolFlag(-1), imid(-1.0) {}
+  col_controls() : prfpresent(false), SelectIcolFlag(0), IpowerComb(3), imid(-1.0) {}
 
   // Set column selection flags
   // see class observation_part (hkl_unmerge.hh) for implementation
@@ -135,7 +135,17 @@
   // conditional on Ipr present or absent (col_Ipr == 0 absent)
   void SetupColSelection(const int col_Ipr=1);
 
+  // Return selection flag
+  int IcolFlag() const {return SelectIcolFlag;}
+
+  //! return true if Imid was set from command input
+  bool IsImidSet() const {return (imid > 0.1);}
+
+  //! return true if file contains both profile-fitted and summation Is
+  bool BothIpresent() const {return prfpresent;}
+
 private:
+  bool prfpresent;     // true if file contains both profile-fitted and summation Is
   int SelectIcolFlag;
   int IpowerComb;
   double imid;
@@ -151,10 +161,11 @@
   AnalysisControls() : nresobins(10), nibins(10) {}
   AnalysisControls(const int& Nresobins, const int& Nibins, const double& Coneangle,
 		   const double& MinimumHalfdatasetCC,
-		   const double& MinimumIoverSigma, const double& MinimumBatchIoverSigma)
+		   const double& MinimumIoverSigma, const double& MinimumBatchIoverSigma,
+		   const int& Nbatchsmooth=1)
     : nresobins(Nresobins), nibins(Nibins), coneangledegrees(Coneangle),
       minimumhalfdatasetcc(MinimumHalfdatasetCC), minimumioversigma(MinimumIoverSigma),
-      minimumbatchioversigma(MinimumBatchIoverSigma)
+      minimumbatchioversigma(MinimumBatchIoverSigma), nbatchsmooth(Nbatchsmooth)
 {}
 
   int NresoBins() const {return nresobins;}
@@ -163,14 +174,17 @@
   double MinimumHalfdatasetCC() const {return minimumhalfdatasetcc;}
   double MinimumIoverSigma() const {return minimumioversigma;}
   double MinimumBatchIoverSigma() const {return minimumbatchioversigma;}
+  int NbatchSmooth() const {return nbatchsmooth;}
+  void SetNbatchSmooth(const int& Nbatchsmooth) {nbatchsmooth = Nbatchsmooth;}
 
 private:
-  int nresobins;   // number of resolution bins
-  int nibins;      // number of intensity bins
+  int nresobins;    // number of resolution bins
+  int nibins;       // number of intensity bins
   double coneangledegrees;  // cone angle 
   double minimumhalfdatasetcc;
   double minimumioversigma;
   double minimumbatchioversigma;
+  int nbatchsmooth; // number of batches over which to smooth statistics
 };
 //------------------------------------------------------------
 class RejectFlags {
@@ -248,6 +262,9 @@
     float& E2min() {return e2min;}
     float E2min() const {return e2min;}
 
+    float& E2max() {return e2max;}
+    float E2max() const {return e2max;}
+
   private:
     bool bfgs;           // or Fox-Holmes if false
     int  ncyc1;          // number of 1st stage cycles
@@ -255,6 +272,7 @@
     float converge;      // convergence limit (multiplier of sd)
     float iovsdmin;      // <I>/sd'(<I>) limit for 1st pass scaling
     float e2min;         // |E^2| limit for 2nd pass scaling
+    float e2max;         // |E^2| maximum limit for 2nd pass scaling
   };
 //=================================================================
 class DatasetControl
diff -r -u 20110907/ccp4-6.2.0/src/pointless/copymergedmtz.cpp 20110921/ccp4-6.2.0/src/pointless/copymergedmtz.cpp
--- 20110907/ccp4-6.2.0/src/pointless/copymergedmtz.cpp	2011-05-09 10:24:50.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/copymergedmtz.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -33,7 +33,6 @@
 		     const std::string& filename_out,
 		     const std::string& SpaceGroupName,
 		     const scala::ReindexOp& reindex,
-		     const bool& reindexedTestData,
 		     const bool& reduce,
 		     const bool& verbose,
 		     phaser_io::Output& output)
@@ -70,33 +69,26 @@
 		      "\nReflections are not reduced to asymmetric unit\n");
       }
     }
-    
-    char history[MTZRECORDLENGTH];
-    char date[11];
-    char time[9];
-    CCP4::ccp4_utils_date(date);
-    CCP4::ccp4_utils_time(time);
-    std::string text = "POINTLESS, "+std::string(date)+" "+
-      std::string(time)+
-      " reindexed "+reindex.as_hkl();
-    if (SpaceGroupName != "" && SpaceGroupName != "HKLIN")
-      {text += " Space group "+SpaceGroupName;}
-    strcpy(history, text.c_str()); 
 
-    //    int Nhist = MtzAddHistory(mtzin, &history, 1);
+    // New symmetry
+    std::string spacegroupname = SpaceGroupName; // local copy
+    bool sgnamegiven = true;
+    if (spacegroupname == "" || spacegroupname == "HKLIN") {
+      spacegroupname = std::string(mtzin->mtzsymm.spcgrpname);
+      sgnamegiven = false; // space group name not specified explicitly
+      //^      std::cout << "MTZ sgname: " << spacegroupname << "\n";
+    }
+
+    bool reindexed = !reindex.IsIdentity();  // true if reindex op is not h,k,l
+    bool translation = reindex.IsTranslation(); // true if translation component
 
-    // vectors of pointers to interesting columns
-    std::vector<CMtz::MTZCOL*> DanoCol;
-    //  ... and pairs
-    std::vector<MtzColPair> PairCol;
+    scala::hkl_symmetry NewSymm= scala::hkl_symmetry(spacegroupname);
 
-    // Symmetry
-    scala::hkl_symmetry NewSymm= scala::hkl_symmetry(SpaceGroupName);
-    if (SpaceGroupName == "" || SpaceGroupName == "HKLIN") {
+    if (!sgnamegiven) { // space group name not given, so derive from MTZ name + reindex
       NewSymm.ChangeBasis(reindex);
       if (verbose) {
 	output.logTabPrintf(1,LOGFILE,
-			    "Reindexed space group : %s\n",
+			    "Reindexed space group : %s\n\n",
 			    NewSymm.symbol_xHM().c_str());
       }
     } else {
@@ -106,14 +98,41 @@
 			    NewSymm.symbol_xHM().c_str());
       }
     }
-    bool reindexed = !reindex.IsIdentity();  // true if reindex op is not h,k,l
     
+    char history[MTZRECORDLENGTH];
+    char date[11];
+    char time[9];
+    CCP4::ccp4_utils_date(date);
+    CCP4::ccp4_utils_time(time);
+    std::string text = "POINTLESS, "+std::string(date)+" "+std::string(time);
+    if (reindexed) {
+      text += " reindexed "+reindex.as_hkl();
+    }
+    text += " Space group "+spacegroupname;
+    strcpy(history, text.c_str()); 
+
+    int Nhist = MtzAddHistory(mtzin, &history, 1);
+
+    // vectors of pointers to interesting columns
+    std::vector<CMtz::MTZCOL*> DanoCol;
+    //  ... and pairs
+    std::vector<MtzColPair> PairCol;
+    //  ... phase columns
+    std::vector<CMtz::MTZCOL*> PhaseCol;
+    //  ... ABCD columns (1st of set)
+    std::vector<CMtz::MTZCOL*> ABCDCol;
+
+    SpaceGroup newspacegroup =  NewSymm.GetSpaceGroup();
+
     // for cell constraints
-    CCtbxSym::CellGroup CG(NewSymm.GetSpaceGroup());
+    CCtbxSym::CellGroup CG(newspacegroup);
 
     // Process all crystals, changing cells by reindex
     // Loop crystals
     scala::Scell newcell;
+    if (verbose) {
+      output.logTab(0,LOGFILE, "Unit Cells: ");
+    }
     for (int x=0; x < CMtz::MtzNxtal(mtzin); x++) {
       CMtz::MTZXTAL* xtl = CMtz::MtzIxtal(mtzin,x);
       newcell = CG.constrain(scala::Scell(xtl->cell).change_basis(reindex));
@@ -129,33 +148,55 @@
 	// Loop columns
 	int Ncol = pset->ncol;
 	std::vector<bool> ColFree(Ncol,true);
-	for (int col=0;col<Ncol;col++) {
-	  if (ColFree[col]) {
+	for (int col=0;col<Ncol;col++) {  // loop columns
+	  if (ColFree[col]) { // column not yet assigned
 	    CMtz::MTZCOL* pcol = pset->col[col];
+	    char ctype = pcol->type[0]; // column type
+
 	    // Check for any phase columns (type P)
 	    // or phase coefficient columns (type A)
-	    // These cannot be reindexed by this routine
-	    char ctype = pcol->type[0];
-	    if (reindexed && (ctype == 'P' || ctype == 'A')) {
+	    // These cannot be reindexed by this routine if there is a translation
+	    if (translation && (ctype == 'P' || ctype == 'A')) {
 	      PrintError
-		("**** Can't reindex file containing Phase or Phase Coefficient column ****",
+  ("**** Can't apply translation reindex to Phase or Phase Coefficient column ****",
 		 output);
 	      output.logTabPrintf(0,LOGFILE,"   Column label %s Type %c\n\n",
 				  pcol->label, pcol->type[0]);
 	      
 	      return false;
 	    }
+
 	    if (reduce) {
-	      // Check for anomalous difference columns
-	      if (ctype == 'D') {
+	      // mark phase & ABCD columns for later processing
+	      if  (ctype == 'P') { // phase column
+		PhaseCol.push_back(pcol);
+	      } else if (ctype == 'A') {
+		// Check for 4 columns of type A
+		bool found = true;
+		if (col <= Ncol-4) {
+		  for (int col2=col+1;col2<col+4;col2++) {
+		    if (pset->col[col2]->type[0] == ctype) { // OK type A
+		      ColFree[col2] = false; // mark as used
+		    } else {
+		      found = false; // wrong type
+		    }
+		  }
+		}
+ 		if (!found) {
+		  Message::message(Message_fatal
+				   ("CopyMergedMTZ: incomplet ABCD set"+
+				    std::string(pcol->label)+" type"+ctype));
+		}
+		ABCDCol.push_back(pcol); // OK
+	      } else if (ctype == 'D') { // Check for anomalous difference columns
 		DanoCol.push_back(pcol);
 	      }
 	      // Check for columns of type F+, F- (G, sigma L),
 	      // or I+, I- (K, sigma M)
 	      else if (ctype == 'G' || ctype == 'L' || ctype == 'K' || ctype == 'M') {
 		// Search forward for a matching column
+		bool found = false;
 		if (col < Ncol-1) {
-		  bool found = false;
 		  for (int col2=col+1;col2<Ncol;col2++)	{
 		    if (pset->col[col2]->type[0] == ctype) {
 		      // xtl/set/col & col2 are a matched pair to be swapped
@@ -165,16 +206,15 @@
 		      break;
 		    }
 		  }
-		  if (!found) {
-		    Message::message(Message_fatal
-				     ("CopyMergedMTZ: unmatched anomalous column"+
-				      std::string(pcol->label)+" type"+ctype));
-		    
-		  }
 		}
-	      }
-	    }
-	  }
+		if (!found) {
+		  Message::message(Message_fatal
+				   ("CopyMergedMTZ: unmatched anomalous column"+
+				    std::string(pcol->label)+" type"+ctype));		  
+		}
+	      } // end F/I+- check
+	    } // end reduce
+	  }  // end column not yet assigned
 	}  // end column loop
       }  // end dataset loop
     }  // end crystal loop
@@ -213,8 +253,31 @@
 			      PairCol[i].second->label, ctype);
 	}
 	output.logTab(0,LOGFILE,"\n");
+      } // end paircol
+      if (PhaseCol.size() > 0) {
+	output.logTabPrintf(0,LOGFILE,
+	  "\nPhases may be changed if indices hkl are changed in reducing to asymmetric unit\n");
+	output.logTabPrintf(0,LOGFILE,
+			    "\n   Phase column labels: ");
+	for (size_t i=0;i<PhaseCol.size();i++) {
+	  output.logTabPrintf(0,LOGFILE," %s",PhaseCol[i]->label);
+	}
+	output.logTab(0,LOGFILE,"\n");
       }
-    } // verbose
+      if (ABCDCol.size() > 0) {
+	output.logTabPrintf(0,LOGFILE,
+	  "\nABCDs may be changed if indices hkl are changed in reducing to asymmetric unit\n");
+	output.logTabPrintf(0,LOGFILE,
+			    "\n   ABCD column labels: ");
+	for (size_t i=0;i<ABCDCol.size();i++) {
+	  output.logTabPrintf(0,LOGFILE," %s %s %s %s",
+			      ABCDCol[i]->label,(ABCDCol[i]+1)->label,
+			      (ABCDCol[i]+2)->label,(ABCDCol[i]+3)->label);
+	}
+	output.logTab(0,LOGFILE,"\n");
+      }
+
+    } // end verbose
     
     // Update file cell
     // ?? don't need to, first crystal cell is used
@@ -226,7 +289,7 @@
 	HorR = 'R';
       }}
 
-    mtzin->mtzsymm = spg_to_mtz(NewSymm.GetSpaceGroup(), HorR);
+    mtzin->mtzsymm = spg_to_mtz(newspacegroup, HorR);
 
     int Ncolumns = CMtz::MtzNcol(mtzin);
     // Column offsets ( = number-1) for H,K,L columns
@@ -239,6 +302,7 @@
     int isym;
     int Nneg = 0;
     int Nswap = 0;
+    int Nphasechange = 0;
     int Nref = 0;
     int NfractIdx = 0;
     std::vector<float> cols(Ncolumns);
@@ -250,13 +314,11 @@
       //    set up with the correct length
       CMtz::MtzRrefl(mtzin->filein, Ncolumns, &*cols.begin());
       
-      int h = Nint(cols[mtzH]);
-      int k = Nint(cols[mtzK]);
-      int l = Nint(cols[mtzL]);
+      scala::Hkl oldhkl(Nint(cols[mtzH]), Nint(cols[mtzK]), Nint(cols[mtzL]));
       // Reindex
       scala::Hkl newhkl;
       // returns false if non-integral indices
-      bool HklOK = scala::Hkl(h,k,l).change_basis(newhkl, reindex);
+      bool HklOK = oldhkl.change_basis(newhkl, reindex);
       if (!HklOK) {
 	NfractIdx++;
 	continue;
@@ -264,14 +326,15 @@
 	
       if (reduce) {
 	// Reduce to asymmetric unit
-	newhkl = NewSymm.put_in_asu(newhkl, isym);
+	oldhkl = newhkl;
+	newhkl = NewSymm.put_in_asu(oldhkl, isym);
+	bool hklprint = true;
 	// If hand has changed (isym even), do any necessary swaps
 	if (isym%2 == 0 && !NewSymm.is_centric(newhkl)) {
 	  // Anomalous difference swaps, acentric reflections only
 	  //  NB Data has to be swapped as there is no reliable way just to
 	  //  change the column names
-	  bool hklprint = true;
-	  if (DanoCol.size() > 0) {
+	  if (DanoCol.size() > 0) {  // DANO column
 	    for (size_t i=0;i<DanoCol.size();i++) {
 	      // Dano, negate
 	      int j = DanoCol[i]->source - 1;
@@ -292,8 +355,8 @@
 	      output.logTab(0,LOGFILE, "   ... more negated");
 	    }
 	    Nneg++;
-	  }
-	  if (PairCol.size() > 0) {
+	  } // end DANO column
+	  if (PairCol.size() > 0) { // Paired +/- column
 	    for (size_t i=0;i<PairCol.size();i++) {
 	      int j = PairCol[i].first->source - 1;
 	      int k = PairCol[i].second->source - 1;
@@ -317,9 +380,53 @@
 	      output.logTab(0,LOGFILE, "   ... more swapped");
 	    }
 	    Nswap++;
+	  } // end paired column
+	} // end swap
+	// --- 
+	if (PhaseCol.size() > 0 || ABCDCol.size() > 0) { // Phase columns
+	  // Phase shift for +hkl, degrees
+	  double phaseshift = oldhkl.HKL().sym_phase_shift(newspacegroup.SymopFromIsym(isym));
+	  if (verbose) {
+	    if (std::abs(phaseshift) > 0.001) {
+	      if (Nphasechange < 20) {
+		if (hklprint) {
+		  output.logTab(0,LOGFILE,newhkl.format());
+		  hklprint = false;
+		}
+		std::string s = "Phase shift "+clipper::String(clipper::Util::rad2d(phaseshift));
+		if (isym%2 == 0) s += " negated";
+		output.logTab(0,LOGFILE, s);
+		Nphasechange++;
+	      }
+	    }
 	  }
-	}
-      }
+	  if (PhaseCol.size() > 0) { // phase columns
+	    for (size_t i=0;i<PhaseCol.size();i++) {
+	      // Phase column, shift
+	      int j = PhaseCol[i]->source - 1;
+	      cols[j] = cols[j] + clipper::Util::rad2d(phaseshift);
+	      if (isym%2 == 0) { // change of hand, negate phase
+		cols[j] = -cols[j];
+	      }
+	    }
+	  }  // end phase columns
+	  
+	  if (ABCDCol.size() > 0) { // ABCD columns
+	    for (size_t i=0;i<ABCDCol.size();i++) {
+	      // ABCD column, shift
+	      int j = ABCDCol[i]->source - 1;
+	      // Make ABCD object
+	      clipper::datatypes::ABCD<float> HL(cols[j], cols[j+1], cols[j+2], cols[j+3]); 
+	      HL.shift_phase(phaseshift);  // shift phase
+	      if (isym%2 == 0) {HL.friedel();} // Friedel symmetry if required
+	      cols[j]   = HL.a();
+	      cols[j+1] = HL.b();
+	      cols[j+2] = HL.c();
+	      cols[j+3] = HL.d();
+	    }
+	  } // end ABCD
+	} // end phase columns
+      }  // end reduce
       
       cols[mtzH] = newhkl[0];
       cols[mtzK] = newhkl[1];
@@ -327,7 +434,7 @@
       
       CMtz::MtzWrefl(mtzin->fileout, Ncolumns, &*cols.begin());
       Nref++;
-    }
+    } // end loop reflections
     
     // Reset global resolution limits
     float minres, maxres;
diff -r -u 20110907/ccp4-6.2.0/src/pointless/copymergedmtz.hh 20110921/ccp4-6.2.0/src/pointless/copymergedmtz.hh
--- 20110907/ccp4-6.2.0/src/pointless/copymergedmtz.hh	2007-11-12 10:28:20.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/pointless/copymergedmtz.hh	2011-09-06 17:49:04.000000000 +0100
@@ -28,7 +28,6 @@
 		     const std::string& filename_out,
 		     const std::string& SpaceGroup,
 		     const scala::ReindexOp& reindex,
-		     const bool& reindexedTestData,
 		     const bool& reduce,
 		     const bool& verbose,
 		     phaser_io::Output& output);
diff -r -u 20110907/ccp4-6.2.0/src/pointless/fix_merged_scores.cpp 20110921/ccp4-6.2.0/src/pointless/fix_merged_scores.cpp
--- 20110907/ccp4-6.2.0/src/pointless/fix_merged_scores.cpp	2011-05-09 10:24:52.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/fix_merged_scores.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -35,9 +35,6 @@
   {
     ASSERT (latticeSymm.Nelement() == int(scores.size()));
     ASSERT (scores.size() == CCsig.size());  // sanity checks
-    hkl_symmetry fileSymmtoLat = fileSymm;
-    // reindex file symmetry to current lattice symmetry if necessary
-    if (!latticereindex.IsIdentity()) fileSymmtoLat.ChangeBasis(latticereindex);
     RefListType IsMerged = hklinListType;
     //
     if (IsMerged == MERGED) {
@@ -47,14 +44,13 @@
       //      std::cout << "\nLattice symmetry: " << latticeSymm.symbol_xHM() <<"\n";
       //      latticeSymm.print_elements();
       //^-
-
       // We have now decided that the file is merged, reset scores for symmetry elements
-      // previously merged, ie in fileSymmtoLat
+      // previously merged, ie in fileSymm reindexed
       for (int islat=0;islat<latticeSymm.Nelement();++islat) {
 	//	std::cout << "\nLattice element: "
 	//		  << latticeSymm.format_element(islat) << "\n";  //^
 	// Is this lattice symmetry element in the merged group
-	if (ElementIsInGroup(latticeSymm, islat, fileSymmtoLat)) {
+	if (ElementIsInGroup(latticeSymm, islat, fileSymm, latticereindex)) {
 	  //	  std::cout << "   is in group\n"; //^
 	  scores[islat].SetScoresTrue(); // set CC=1.0, R=0.0
 	  CCsig[islat].SetScoresTrue();  // flag for likelihood = 1.0
@@ -65,8 +61,8 @@
   }
   //--------------------------------------------------------------
   bool ElementIsInGroup(const hkl_symmetry& latticeSymm, const int& islat,
-			const hkl_symmetry& mergeGroup)
-  // Return true if the islat'th symmetry element of latticeSymm is present in mergeGroup
+			const hkl_symmetry& mergeGroup, const ReindexOp& reindex)
+  // Return true if the islat'th symmetry element of latticeSymm is present in reindexed mergeGroup
   {
     // First element of lattice element
     clipper::Symop elementOps = latticeSymm.RotSymopsInElement(islat)[0];
@@ -74,7 +70,8 @@
     std::vector<clipper::Symop> mergeOps = mergeGroup.PrimRotSymops();
     const double tol = 0.001;
     for (size_t i=0;i<mergeOps.size();++i) {
-      if (mergeOps[i].equals(elementOps, tol)) { // only need to test first element op
+      clipper::Symop symop = reindex.Symop(mergeOps[i]);  // reindexed symop
+      if (symop.equals(elementOps, tol)) { // only need to test first element op
 	//^	std::cout << "symop in group " << mergeOps[i].format() << "\n";
 	return true;
       }
diff -r -u 20110907/ccp4-6.2.0/src/pointless/fix_merged_scores.hh 20110921/ccp4-6.2.0/src/pointless/fix_merged_scores.hh
--- 20110907/ccp4-6.2.0/src/pointless/fix_merged_scores.hh	2010-07-01 09:11:42.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/fix_merged_scores.hh	2011-09-06 17:49:04.000000000 +0100
@@ -45,10 +45,9 @@
   //  CCsig        for symmetry elements in fileSymm, likelihood = 1.0
 
   //--------------------------------------------------------------
-  // Return true if the islat'th symmetry element of latticeSymm is
-  // present in mergeGroup
+  // Return true if the islat'th symmetry element of latticeSymm is present in reindexed mergeGroup
   bool ElementIsInGroup(const hkl_symmetry& latticeSymm, const int& islat,
-			const hkl_symmetry& mergeGroup);
+			const hkl_symmetry& mergeGroup, const ReindexOp& reindex);
 
 } // namespace scala
 #endif
diff -r -u 20110907/ccp4-6.2.0/src/pointless/getsubgroups.cpp 20110921/ccp4-6.2.0/src/pointless/getsubgroups.cpp
--- 20110907/ccp4-6.2.0/src/pointless/getsubgroups.cpp	2011-05-09 10:24:53.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/getsubgroups.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -72,8 +72,8 @@
   }
   //--------------------------------------------------------------
   void RemoveImplicitSubgroups(std::vector<CCtbxSym::PointGroup>& subgroups,
-			       const hkl_symmetry& mergeSymm)
-  // mergeSymm reindexed into lattice frame
+			       const hkl_symmetry& mergeSymm, const ReindexOp& reindex)
+  // symops from mergeSymm can be reindexed into lattice frame by reindex
   {
     std::vector<bool> keepsubgroup(subgroups.size(), true); // flags to keep subgroup
     bool anyremoved = false;
@@ -83,7 +83,9 @@
       // loop symmetry elements in mergeSymm
       for (int iel=0;iel<mergeSymm.Nelement();++iel) {
 	// 1st op in element
-	std::vector<double> Rmatrix = mergeSymm.SymopInElement(0,iel);
+	clipper::Symop invsymop = mergeSymm.ClipperSymopInElement(0,iel);
+	invsymop = reindex.Symop(invsymop); // reindex to lattice cell
+	std::vector<double> Rmatrix =  MVutil::SetVMat33(invsymop.rot()); // ... as matrix
 	// Is this element in the subgroup?
 	if (!subgroups[igl].HasElement(Rmatrix)) {
 	  // fail, all elements must be present
diff -r -u 20110907/ccp4-6.2.0/src/pointless/getsubgroups.hh 20110921/ccp4-6.2.0/src/pointless/getsubgroups.hh
--- 20110907/ccp4-6.2.0/src/pointless/getsubgroups.hh	2009-10-14 16:14:36.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/getsubgroups.hh	2011-09-06 17:49:04.000000000 +0100
@@ -13,10 +13,10 @@
   // if forceI2 true, convert any C2/m setting to I 
   std::vector<CCtbxSym::PointGroup> GetSubGroups(const hkl_symmetry& symm);
   //--------------------------------------------------------------
-  // If file is merged, remove all subgroups wich are subgroups of original group
+  // If file is merged, remove all subgroups which are subgroups of original group
   //  since these are implicit
   void RemoveImplicitSubgroups(std::vector<CCtbxSym::PointGroup>& subgroups,
-			       const hkl_symmetry& OrigSymm);
+			       const hkl_symmetry& OrigSymm, const ReindexOp& reindex);
 
 } // scala
 
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_controls.cpp 20110921/ccp4-6.2.0/src/pointless/hkl_controls.cpp
--- 20110907/ccp4-6.2.0/src/pointless/hkl_controls.cpp	2010-11-24 12:39:48.000000000 +0000
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_controls.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -21,6 +21,8 @@
       range_sel = input.getRESO();
       // batch exclusions
       batchexclude = input.BatchExclusions();
+      //P      // batch inclusions from explicit RUN specification
+      //P      batchinclude = input.RunBatches();
       // Check that fileSeries specified on selection commands match
       // specified files. Fail here if not
       batchexclude.CheckSeries(NumFileSeries); 
@@ -55,7 +57,15 @@
   //  any renumbering (fileSeriesList == 0), no test will be done
   //  (ie always returns true) unless fileSeries == 0
   {
-    return !(batchexclude.InSelection(batch_number, fileSeries));
+    bool accept = true;
+    if (!batchinclude.Null()) {
+      // We have inclusions from specified RUNs
+      //  accept if within selection
+      accept = batchinclude.InSelection(batch_number, fileSeries);
+    }
+    if (batchexclude.InSelection(batch_number, fileSeries)) {
+      accept = false;
+    }
+    return accept;
   }
-
 }
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_controls.hh 20110921/ccp4-6.2.0/src/pointless/hkl_controls.hh
--- 20110907/ccp4-6.2.0/src/pointless/hkl_controls.hh	2010-05-17 16:24:30.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_controls.hh	2011-09-06 17:49:04.000000000 +0100
@@ -68,6 +68,7 @@
     int nrej_mflag, nrej_reso;
     ResoRange range_sel;
     BatchSelection batchexclude;  // List/ranges of batches to exclude
+    BatchSelection batchinclude;  // List/ranges of batches to include (from RUN)
     float inputscale;             // scale factor to apply on input
     // fraction of maximum resolution to use in test for blank batches
     float nullResolutionfraction;
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_datatypes.cpp 20110921/ccp4-6.2.0/src/pointless/hkl_datatypes.cpp
--- 20110907/ccp4-6.2.0/src/pointless/hkl_datatypes.cpp	2011-06-18 21:59:54.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_datatypes.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -228,6 +228,16 @@
     //	      << symm.symop(kbest).rot().inverse().format() << "\n\n"; //^-
   }
   //--------------------------------------------------------------
+  //! change basis of symmetry operator
+  clipper::Symop ReindexOp::Symop(const clipper::Symop& symop) const
+  {
+    // S' = H^-1 S H
+    // t' = H^-1 t
+    clipper::Mat33<double> HR = rot();
+    clipper::RTop<double> Sp(HR.inverse()*symop.rot()*HR, HR.inverse() * symop.trn());
+    return clipper::Symop(Sp);
+  }
+  //--------------------------------------------------------------
   bool operator == (const ReindexOp& a,const ReindexOp& b)
   {
     return a.equals(b);
@@ -673,10 +683,9 @@
     Vec3<double> v = vh * reindex_op;
     Newhkl = Hkl(Nint(v[0]), Nint(v[1]), Nint(v[2]));
     bool OK = true;
-    for (int i=0;i<3;i++)
-      {
-	if (std::abs(v[i]-double(Newhkl[i])) > 0.05) OK = false;
-      }
+    for (int i=0;i<3;i++) {
+      if (std::abs(v[i]-double(Newhkl[i])) > 0.05) OK = false;
+    }
     return OK; 
   }
   //--------------------------------------------------------------
@@ -1248,10 +1257,10 @@
     std::vector<float> lims(2);
     std::vector<std::vector<float> > xylims(2);
     lims[0] = batchinfo.detlm[0][0][0]; // XDET
-    lims[1] = batchinfo.detlm[1][0][0];
+    lims[1] = batchinfo.detlm[0][0][1];
     xylims[0] = lims;
     lims[0] = batchinfo.detlm[0][1][0]; // YDET
-    lims[1] = batchinfo.detlm[1][1][0];
+    lims[1] = batchinfo.detlm[0][1][1];
     xylims[1] = lims;
     return xylims;
   }
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_datatypes.hh 20110921/ccp4-6.2.0/src/pointless/hkl_datatypes.hh
--- 20110907/ccp4-6.2.0/src/pointless/hkl_datatypes.hh	2011-06-18 21:59:55.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_datatypes.hh	2011-09-06 17:49:04.000000000 +0100
@@ -146,7 +146,13 @@
     //! returns true if determinant is positive (desirable!)
     bool Positive() const {
       return (rot().det() > 0.0);}
-    
+    //! Returns true if there is a translation component
+    bool IsTranslation() const {
+      return trn() != clipper::Vec3<double>(0.0,0.0,0.0);}
+
+    //! change basis of symmetry operator
+    clipper::Symop Symop(const clipper::Symop& symop) const;
+
     //! format as string [h,k,l]
     std::string as_hkl() const;
     //! format as matrix
@@ -680,6 +686,9 @@
     //! Return range of detector pixel coordinates
     std::vector<std::vector<float> > DetectorCoordinateRange() const;
 
+    //! return number of detectors
+    int Ndet() const {return batchinfo.ndet;}
+
     //! return MTZ batch: only use this for writing MTZ file
     /*! otherwise information retrieval should be through explicit calls */
     CMtz::MTZBAT batchdata() const {return batchinfo;}
@@ -769,7 +778,6 @@
     void AddRange(const int& batch1, const int& batch2,
 		  const int& fileSeriesList, const int& flag=-1);
 
-
     //! Return index in list if in selection, for given file series, else -1
     int FindInSelection(const int& batch,
 			const int& fileSeriesTest) const;
@@ -840,5 +848,4 @@
   };
 }  // namespace scala
 #endif
-
 // end  hkl_datatypes.hh
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_symmetry.cpp 20110921/ccp4-6.2.0/src/pointless/hkl_symmetry.cpp
--- 20110907/ccp4-6.2.0/src/pointless/hkl_symmetry.cpp	2011-05-09 10:24:57.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_symmetry.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -182,15 +182,15 @@
       rotsymops[i] = clipper::Symop(clipper::RTop<>(csymops[i].rot()));
       invrotsymops[i] = clipper::Symop(clipper::RTop<>(csymops[i].rot()).inverse());
     }
+    if (spacegroupname == "Unknown") {
+      spacegroupname = CCP4spaceGroupName();  // construct from csymops
+    }
     spacegroupname = symbol_hm();
     spacegroupnumber = spacegroup_number();
     CCP4spacegroupnumber = spacegroupnumber;
     // Sort out name if unknown
     //^    std::cout << "SpaceGroup: HM: " << symbol_hm()
     //^	      << "  Hall: " << symbol_hall() << "\n";
-    if (spacegroupname == "Unknown") {
-      spacegroupname = CCP4spaceGroupName();
-    }
     // Always consult CCP4 libraries for space group numbers
     CCP4spaceGroupNumber();
     SetLatType();
@@ -236,6 +236,14 @@
     else {return h;}
   }
   //--------------------------------------------------------------
+  //! return the symop corresponding to Isym from put_in_asu
+  clipper::Symop SpaceGroup::SymopFromIsym(const int& isym) const
+  {
+    if (isym < 1 || isym > 2*Nsymp) 
+      Message::message(Message_fatal("SymopFromIsym - ISYM out of range") );
+    return csymops[(isym-1)/2];
+  }
+  //--------------------------------------------------------------
   SpaceGroup  SpaceGroup::NewLatticePointGroup(const char& Lattype) const
   //! Return group with new lattice, keeping point group operators
   {
@@ -277,15 +285,18 @@
   // Change basis by reindex operator
   {
     for (size_t js=0;js<csymops.size();js++) {
+      //^      std::cout <<"ChangeBasis Symop in:  " << csymops[js].format() <<"\n";
       // If [H] is the reindex operator,
       //  [S'] = [H]^-1 [S] [H]
-      clipper::Mat33<double> HR = H.rot();
-      clipper::Mat33<double> S = csymops[js].rot();
-      clipper::Vec3<double>  t = csymops[js].trn();
-      clipper::RTop<double> Sp(HR.inverse()*S*HR, HR.inverse() * t);
-      csymops[js] = clipper::Symop(Sp);
+      csymops[js] = H.Symop(csymops[js]);
+      //      clipper::Mat33<double> S = csymops[js].rot();
+      //      clipper::Vec3<double>  t = csymops[js].trn();
+      //      clipper::RTop<double> Sp(HR.inverse()*S*HR, HR.inverse() * t);
+      //      csymops[js] = clipper::Symop(Sp);
+      //^      std::cout <<"ChangeBasis Symop out: " << csymops[js].format() <<"\n";
     }
-    init();
+    spacegroupname = "Unknown";  // force review of name
+    init(csymops);
   }
   //--------------------------------------------------------------
   bool SpaceGroup::IsSymopIdentity(const int& symN) const
@@ -392,15 +403,17 @@
   }
   //--------------------------------------------------------------
   std::string SpaceGroup::CCP4spaceGroupName() const
-  // Use CCP4 library routine to get name from operators
+  // Use CCP4 library routine to get name from operators csymops
   {
     int nsym = num_symops();
     std::vector<CSym::ccp4_symop> ccp4ops(nsym);
     for (int i=0;i<nsym;++i) {
-      ccp4ops[i] = MakeCCP4symop(symop(i));
+      //^      std::cout << "Symop " << csymops[i].format() <<"\n"; //^-
+      ccp4ops[i] = MakeCCP4symop(csymops[i]);
     }
     CSym::CCP4SPG* ccp4spg = CSym::ccp4_spgrp_reverse_lookup(nsym, &*ccp4ops.begin());
     if (ccp4spg == NULL) return "";
+    //^    std::cout << "CCP4 spgname: " << std::string(ccp4spg->symbol_xHM) <<"\n"; //^
     return std::string(ccp4spg->symbol_xHM);
   }
   //--------------------------------------------------------------
@@ -829,6 +842,23 @@
     return true;
   }
   //--------------------------------------------------------------
+  bool hkl_symmetry::equals_r_order(const hkl_symmetry& other) const
+    // true if spacegroup other is same ignoring translations
+    // with operators in the same order
+  {
+    if (Nsymp != other.Nsymp) return false;
+    if (LatType != other.LatType) return false;
+    // compare symcodes corresponding to rotation-only parts
+    // for all symops in same order
+    bool found = true;
+    for (int i=0; i < Nsymp; i++) {
+      if (inv_rot_symcodes[i] != other.inv_rot_symcodes[i]) {
+	found = false;
+      }
+    }
+    return found;
+  }
+  //--------------------------------------------------------------
   bool hkl_symmetry::equals_rt(const hkl_symmetry& other) const
   {
     if (Nsymp != other.Nsymp) return false;
@@ -853,12 +883,19 @@
   //--------------------------------------------------------------
   std::vector<double> hkl_symmetry::SymopInElement(const int& lsym,
 					      const int& kelement) const
-    // Return rotation part of lsym'th symmetry operator of
+    // Return rotation part of lsym'th inverse symmetry operator of
     // kelement'th symmetry element
   {
     return MVutil::SetVMat33(spaceGroup.InvRotSymop(elements[kelement].symops[lsym]).rot());
   }
   //--------------------------------------------------------------
+  clipper::Symop hkl_symmetry::ClipperSymopInElement(const int& lsym,
+					      const int& kelement) const
+  // Return lsym'th inverse symmetry operator of  kelement'th symmetry element
+  {
+    return spaceGroup.InvRotSymop(elements[kelement].symops[lsym]);
+  }
+  //--------------------------------------------------------------
   std::vector<clipper::Symop> hkl_symmetry::RotSymopsInElement(const int& kelement) const
   {
     std::vector<clipper::Symop> ops(elements.at(kelement).symops.size());
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_symmetry.hh 20110921/ccp4-6.2.0/src/pointless/hkl_symmetry.hh
--- 20110907/ccp4-6.2.0/src/pointless/hkl_symmetry.hh	2010-08-25 12:44:14.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_symmetry.hh	2011-09-06 17:49:04.000000000 +0100
@@ -55,6 +55,9 @@
     clipper::Symop InvRotSymop(const int& symN) const
     {return invrotsymops.at(symN);}  //!< return symN'th inverse symop
 
+    //! return the symop corresponding to Isym from put_in_asu
+    clipper::Symop SymopFromIsym(const int& isym) const;
+
     //! return symop codes for rotation symmetry operators
     clipper::Symop_code RotSymopCode(const int& symN) const
     {return clipper::Symop_code(rotsymops.at(symN));}
@@ -225,9 +228,14 @@
 
     //! return number of operators in kelement'th symmetry element
     int NopInElement(const int& kelement) const;
-    //! Return rotation part of j'th symmetry operator of kelement'th symmetry element
+    //! Return rotation part of j'th inverse symmetry operator of kelement'th symmetry element
     std::vector<double> SymopInElement(const int& j,
 				       const int& kelement) const;
+    //! Return lsym'th inverse symmetry operator of  kelement'th symmetry element
+    clipper::Symop ClipperSymopInElement(const int& lsym,
+					 const int& kelement) const;
+
+
     //! Return symmetry-element number (from 0->Nelement-1) relating observations with ISYM =  isym1,isym2
     /*! Isym = 2 * SymNumber + 1  for h+
      Isym = 2 * SymNumber + 2  for h-
@@ -269,6 +277,9 @@
     /*!  not equals_r & equals_rt test number of operators &  lattice type (centering) */
     bool equals_rt(const hkl_symmetry& other) const; //!< test all operators including translation
     bool equals_r(const hkl_symmetry& other) const; //!< test just rotation parts
+    // true if spacegroup other is same ignoring translations
+    // with operators in the same order
+    bool equals_r_order(const hkl_symmetry& other) const;
 
     //!  simple test, ignore translations
     bool operator==(const hkl_symmetry& other) const {return equals_r(other);}
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_unmerge.cpp 20110921/ccp4-6.2.0/src/pointless/hkl_unmerge.cpp
--- 20110907/ccp4-6.2.0/src/pointless/hkl_unmerge.cpp	2011-06-18 21:59:55.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_unmerge.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -83,9 +83,10 @@
   // ******************************************************************
   //--------------------------------------------------------------
   // Initialise static members
-  int SelectI::selecticolflag = -1; // Use Ipr (if present)
+  int SelectI::selecticolflag = 0;  // No Ipr
   int SelectI::ipowercomb = 3;      // Ipower =3
   double SelectI::imid = -1.0;         // unset
+  bool SelectI::iprpresent = false; // true if we have a second intensity Ipr stored
   //--------------------------------------------------------------
   void SelectI::SetIcolFlag(const int& IcolFlag, const double& Imid, const int Ipower)
   {
@@ -105,16 +106,31 @@
     }
   }
   //--------------------------------------------------------------
-  IsigI SelectI::GetCombinedI(const Rtype& Ic, const Rtype& varIc,
-				     const Rtype& Ipr, const Rtype& varIpr)
+  void SelectI::ResetAverageIntensity(const double& meanI)
+  // store imid = overall <I> if needed
+  {
+    if (selecticolflag > 0) {
+      imid = meanI;
+    }
+  }
+  //--------------------------------------------------------------
+  IsigI SelectI::GetCombinedI(const Rtype& Iraw, const Rtype& Ic, const Rtype& varIc,
+			      const Rtype& Ipr, const Rtype& varIpr)
   // Return combined I, sigI 
   {
     // COMBINE option, weighted mean of I & Ipr
-    double w = 1.0/(1.0 + pow((std::abs(Ic)/imid), ipowercomb));
+    double w = 1.0/(1.0 + pow((std::abs(Iraw)/imid), ipowercomb));
     return IsigI((w*Ipr+(1.0-w)*Ic),
 		 sqrt(w*varIpr + (1.0-w)*varIc));
   }
   //--------------------------------------------------------------
+  IsigI SelectI::GetCombinedI(const Rtype& Iraw, const IsigI& Isc, const IsigI& Ispr)
+  {
+    Rtype varIc  = Isc.sigI()*Isc.sigI();
+    Rtype varIpr = Ispr.sigI()*Ispr.sigI();
+    return GetCombinedI(Iraw, Isc.I(), varIc, Ispr.I(), varIpr);
+  }
+  //--------------------------------------------------------------
   std::string SelectI::format() 
   {
     std::string s;
@@ -123,10 +139,11 @@
     } else if (selecticolflag == 0) {
       s = "Summation-integration (or sole) intensities will be used";
     } else {
-      s = "Combined intensities will be used: weighted mean of profile-fitted & integrated intensities\n";
-      s += "    I = w * Ipr + (1-w) * Iint\n";
+      s = "Combined intensities will be used:\n";
+      s += "  weighted mean of profile-fitted (Ipr) & summation (Isum) intensities\n";
+      s += "    I = w * Ipr + (1-w) * Isum\n";
 
-      s += "    w = 1/(1+(I/"+
+      s += "    w = 1/(1+(Iraw/"+
 	StringUtil::Strip(StringUtil::ftos(imid,8,1))+
 	")^"+StringUtil::Strip(clipper::String(ipowercomb))+")";
     }
@@ -243,6 +260,118 @@
     }
     return std::pair<float,float>(Xd/float(Npart_),Yd/float(Npart_));
   }
+  //--------------------------------------------------------------
+  IsigI observation::IsigIsummation()
+  {
+    // Return "summation" integration I sigI, summed over partials if necessary
+    // This is also the sole intensity if there is only one 
+    // Also sets mean phi, time, LP
+    Rtype Itot = 0.0;
+    Rtype varItot = 0.0;
+    IsigI Is;
+    observation_part this_part;
+    // Stored values
+    phi_ = 0.0;
+    time_ = 0.0;
+    LP_ = 0.0;
+    
+    if (Npart_ == 1) {
+      // Full
+      Is = get_part(0).I_sigI();
+      phi_ = get_part(0).phi();
+      time_ = get_part(0).time();
+      LP_ = get_part(0).LP();
+      batch_ = get_part(0).batch();
+    } else {  // partial
+      Rtype max_bit = -1.0;
+      batch_ = 0;
+      for (int kpart = 0; kpart < Npart_; kpart++) { // loop parts
+	this_part = get_part(kpart);
+	Itot += this_part.Ic();
+	varItot += this_part.sigIc()*this_part.sigIc();
+	phi_  += this_part.phi();
+	time_  += this_part.time();
+	LP_ += this_part.LP();
+	// find biggest bit to mark as central batch
+	if (this_part.fraction_calc() > max_bit) {
+	  max_bit = this_part.fraction_calc();
+	  batch_ = this_part.batch();
+	}
+      } // end loop parts 
+      phi_ = phi_/Npart_;  // average phi over all parts
+      time_ = time_/Npart_;  // average time over all parts
+      LP_ = LP_/Npart_;
+      Rtype sigItot = sqrt(varItot);
+      if (part_flag == SCALE) {
+	Itot /= totalfraction;
+	sigItot /= totalfraction;
+      }
+      // Central batch
+      if (batch_ == 0) {
+	// Not set, use one in the middle
+	batch_ = get_part(Npart_/2).batch();
+      }
+      Is = IsigI(Itot, sigItot);
+    } // end if partial
+    return Is;
+  }
+  //--------------------------------------------------------------
+  IsigI observation::IsigIpr() const
+  {
+    // Return "profile" integration I sigI, summed over partials if necessary
+    Rtype Itot = 0.0;
+    Rtype varItot = 0.0;
+    IsigI Is;
+    observation_part this_part;
+      
+    if (Npart_ == 1) {
+      // Full
+      Is = get_part(0).I_sigIpr();
+    } else {  // partial
+      for (int kpart = 0; kpart < Npart_; kpart++) { // loop parts
+	this_part = get_part(kpart);
+	Itot += this_part.Ipr();
+	varItot += this_part.sigIpr()*this_part.sigIpr();
+      } // end loop parts 
+      Rtype sigItot = sqrt(varItot);
+      if (part_flag == SCALE) {
+	Itot /= totalfraction;
+	sigItot /= totalfraction;
+      }
+      Is = IsigI(Itot, sigItot);
+    } // end if partial
+    return Is;
+  }
+  //--------------------------------------------------------------
+  void observation::sum_partials()
+  {
+    // Sum (or scale) all partials for this observation
+    // Assumes that SelectI has been set up correctly to choose
+    // either summation, profile or combined intensity measurements
+    //
+    // Sets I_, sigI_, phi_, time_, LP_, batch_
+    // - - - -
+
+    // Get summation integration or sole intensity, sum parts, set phi, time, LP
+    IsigI Ic = IsigIsummation();
+    IsigI Ipr(0.0, 0.0);
+    if (SelectI::IsIprPresent()) {
+      // ... and for Ipr if present
+      Ipr = IsigIpr();
+    }
+    IsigI Isum;
+    if (SelectI::Combine()) {
+      Rtype Iraw = Ic.I();
+      if (LP_ > 0.0) Iraw /= LP_;  // raw intensity back-corrected for LP
+      Isum = SelectI::GetCombinedI(Iraw, Ic, Ipr);
+    } else if (SelectI::SelectIcolFlag() < 0) { // profile
+      Isum = Ipr;
+    } else {
+      Isum = Ic;
+    }
+    I_ = Isum.I();
+    sigI_ = Isum.sigI();
+  }
   // ****************** reflection   *******************
   reflection::reflection()  {}   // dummy
   // Normal constructor
@@ -306,103 +435,21 @@
     Npart = 0;
     Nscaled = 0;
     NvalidObs = 0; // counts valid and accepted
-    observation_part this_part;
-    Rtype sigItot;
 
     for (int lobs = 0; lobs < num_observations(); lobs++)  {
-      Rtype Itot = 0.0;
-      Rtype varItot = 0.0;
-      Rtype ItotPr = 0.0;
-      Rtype varItotPr = 0.0;
-      Rtype phi = 0.0;
-      Rtype time = 0.0;
-      Rtype LP = 0.0;
-      int Ntot = 0;
-      bool scaled = false;
-      int NpartObs = observations[lobs].num_parts();
-      
-      if (NpartObs == 1) {
-	// Full
-	if (SelectI::Combine()) {
-	  // For combination, we want both Ic & Ipr
-	  Itot = observations[lobs].get_part(0).Ic();
-	  varItot = observations[lobs].get_part(0).sigIc()*
-	    observations[lobs].get_part(0).sigIc();
-	  ItotPr = observations[lobs].get_part(0).Ipr();
-	  varItotPr = observations[lobs].get_part(0).sigIpr()*
-	    observations[lobs].get_part(0).sigIpr();
-	  IsigI Is = SelectI::GetCombinedI(Itot, varItot, ItotPr, varItotPr);
-	  Itot = Is.I();
-	  sigItot = Is.sigI();	      
-	} else {
-	  // Select either Ic or Ipr
-	  Itot = observations[lobs].get_part(0).Ic(SelectI::SelectIcolFlag());
-	  sigItot = observations[lobs].get_part(0).sigIc(SelectI::SelectIcolFlag());
-	}
-	phi = observations[lobs].get_part(0).phi();
-	time = observations[lobs].get_part(0).time();
-	LP = observations[lobs].get_part(0).LP();
-	// Can't be scaled
-	observations[lobs].set_IsigI_phi_time(Itot, sigItot, phi, time, LP);
-	observations[lobs].set_batch(observations[lobs].get_part(0).batch());
+      observations[lobs].sum_partials();
+      if (observations[lobs].IsFull()) {
 	if (observations[lobs].IsAccepted()) {NvalidObs++;}
 	Nfull++;
       } else {  // partial
-	Rtype max_bit = -1.0;
-	int central_batch = 0;
-	for (int kpart = 0; kpart < NpartObs; kpart++) {
-	  this_part = observations[lobs].get_part(kpart);
-	  Ntot++;
-	  if (SelectI::Combine()) {
-	    // For combination, we want both Ic & Ipr
-	    Itot += this_part.Ic();
-	    varItot += this_part.sigIc()*
-	      this_part.sigIc();
-	    ItotPr += this_part.Ipr();
-	    varItotPr += this_part.sigIpr()*
-	      this_part.sigIpr();
-	  } else {
-	    // Select either Ic or Ipr
-	    Itot += this_part.Ic(SelectI::SelectIcolFlag());
-	    varItot += this_part.sigIc(SelectI::SelectIcolFlag())*
-	      this_part.sigIc(SelectI::SelectIcolFlag());
-	  }
-	  phi  += this_part.phi();
-	  time  += this_part.time();
-	  LP += this_part.LP();
-	  // find biggest bit to mark as central batch
-	  if (this_part.fraction_calc() > max_bit) {
-	    max_bit = this_part.fraction_calc();
-	    central_batch = this_part.batch();
-	  }
-	}
-	phi = phi/Ntot;  // average phi over all parts
-	time = time/Ntot;  // average time over all parts
-	LP = LP/Ntot;
-	if (SelectI::Combine()) {
-	  IsigI Is = SelectI::GetCombinedI(Itot, varItot, ItotPr, varItotPr);
-	  Itot = Is.I();
-	  sigItot = Is.sigI();
-	} else {
-	  sigItot = sqrt(varItot);
-	}
-	// Store total
-	// scales incomplete partial if necessary
-	scaled = observations[lobs].set_IsigI_phi_time(Itot, sigItot, phi, time, LP);
-	if (scaled) Nscaled++;
-	// Central batch
-	if (central_batch == 0) {
-	  // Not set, use one in the middle
-	  central_batch = observations[lobs].get_part(NpartObs/2).batch();
-	}
-	observations[lobs].set_batch(central_batch);
+	if (observations[lobs].PartFlag() == SCALE) Nscaled++;
 	if (observations[lobs].IsAccepted()) {NvalidObs++;}
 	Npart++;
+      } // end if partial
+      if (observations[lobs].sigI() > 0.0) {
+	sdmin = Min(sdmin, observations[lobs].sigI());
       }
-      if (sigItot > 0.0) {
-	sdmin = Min(sdmin, sigItot);
-      }
-    }
+    } // end loop observations
     if (sdmin > sdmin0*0.9) sdmin = -1.0;  
     return sdmin;
   }
@@ -1687,13 +1734,14 @@
     return Nobservations;
   } // end partials
   //--------------------------------------------------------------
-  int hkl_unmerge_list::sum_partials()
-    //                   ^^^^^^^^^^^
-    // Sum partials within each observation for all reflections
-    // Returns number of valid partials
+  int hkl_unmerge_list::sum_partials(const bool& forcesum)
+  //                   ^^^^^^^^^^^
+  // Sum partials within each observation for all reflections
+  // If forcesum is true, sum them even if already summed
+  // Returns number of valid partials
   {
-    if (status == SUMMED) return Nobs_partial;
-    if (status != PREPARED) 
+    if (!forcesum && (status == SUMMED)) return Nobs_partial;
+    if (!(status == PREPARED) && (status != SUMMED)) 
       Message::message(Message_fatal("hkl_unmerge_list::sum_partials - not PREPARED") );
 
     sigmamin = +1000000.;
@@ -1704,21 +1752,19 @@
     Nobs_scaled = 0;
     int Nfull, Npart, Nscaled;
 
-    for (size_t j = 0; j < refl_list.size(); j++)  // loop all reflections
-      {
-	// Sum partials
-	//    reflection.sum_partials returns min sigma found
-	//    (excluding zeroes)
-	sm = refl_list[j].sum_partials(Nfull, Npart, Nscaled);
-        if (sm > 0.0) 
-	  {
-	    sigmamin = Min(sigmamin, sm);
-	    Nref_valid++;
-	    Nobs_full += Nfull;
-	    Nobs_partial += Npart;
-	    Nobs_scaled += Nscaled;
-	  }
+    for (size_t j = 0; j < refl_list.size(); j++) {  // loop all reflections
+      // Sum partials
+      //    reflection.sum_partials returns min sigma found
+      //    (excluding zeroes)
+      sm = refl_list[j].sum_partials(Nfull, Npart, Nscaled);
+      if (sm > 0.0) {
+	sigmamin = Min(sigmamin, sm);
+	Nref_valid++;
+	Nobs_full += Nfull;
+	Nobs_partial += Npart;
+	Nobs_scaled += Nscaled;
       }
+    }
     status = SUMMED;
     NextRefNum = 0;        // point to first reflection in list
     return Nobs_partial;
@@ -1867,6 +1913,30 @@
     return true;
   }
   //--------------------------------------------------------------
+  bool hkl_unmerge_list::acceptableReflection(const int& RefNum) const
+  // private method, no counting or other internal storage
+  {
+    // Accepted?
+    if (refl_list[RefNum].Status() != 0) {
+      return false;
+    }
+    // Reject if no observations
+    if (refl_list[RefNum].NvalidObservations() <= 0)
+      return false;
+    // Test resolution limits
+    Rtype s2 = refl_list[RefNum].invresolsq();
+    if (ResoLimRange.tbin(s2) < 0)
+      return false;
+    // Check ice rings: only "reject" rings are stored
+    if (Icerings.Nrings() > 0) {
+      int ir = Icerings.InRing(s2);
+      if (ir >= 0) {
+	return false; 
+      }
+    }
+    return true;
+  }
+  //--------------------------------------------------------------
   int hkl_unmerge_list::next_reflection(reflection& refl) const
   {
     if (status != SUMMED) 
@@ -1888,6 +1958,22 @@
     return NextRefNum;
   }
   //--------------------------------------------------------------
+  int hkl_unmerge_list::get_accepted_reflection(const int& jref, reflection& this_refl) const
+  //  Get reflection jref, if accepted, else next acceptable one
+  //  Return index of returned reflection, = -1 if end of list
+  // Thread safe, no change in mutable data
+  {
+    int jr = jref;
+    while (jr < Nref) { 
+      if (acceptableReflection(jr)) {
+	this_refl = refl_list[jr];
+	return jr;
+      }
+      jr++;
+    }
+    return -1;
+  }
+  //--------------------------------------------------------------
   reflection hkl_unmerge_list::get_reflection(const int& jref) const
   //  unconditional                  ^^^^^^^^^^^^
   {
@@ -2408,4 +2494,4 @@
     return *this; 
   }
 
-} // namespace scala
+} // namespace 
diff -r -u 20110907/ccp4-6.2.0/src/pointless/hkl_unmerge.hh 20110921/ccp4-6.2.0/src/pointless/hkl_unmerge.hh
--- 20110907/ccp4-6.2.0/src/pointless/hkl_unmerge.hh	2011-05-16 14:23:51.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/hkl_unmerge.hh	2011-09-06 17:49:04.000000000 +0100
@@ -21,8 +21,7 @@
 #include "hash.hh"
 #include "runthings.hh"
 
-namespace scala
-{
+namespace scala {
   //==============================================================
   class data_flags
   //! Data column flags to indicate which columns are present in the file
@@ -67,16 +66,26 @@
     static int& SelectIcolFlag() {return selecticolflag;}
     // store imid = overall <I> if needed and not set
     static void SetAverageIntensity(const double& meanI);
+    // store imid = overall <I> if needed
+    static void ResetAverageIntensity(const double& meanI);
 
-    static IsigI GetCombinedI(const Rtype& Ic, const Rtype& varIc,
+    static IsigI GetCombinedI(const Rtype& Iraw, const Rtype& Ic, const Rtype& varIc,
 			      const Rtype& Ipr, const Rtype& varIpr);
 
+    static IsigI GetCombinedI(const Rtype& Iraw, const IsigI& Isc, const IsigI& Ispr);
+
+    //! set true if we have a second intensity Ipr stored
+    static void SetIprPresent(const bool& Isiprpresent) {iprpresent = Isiprpresent;}
+    //! return true if we have a second intensity Ipr stored
+    static bool IsIprPresent() {return iprpresent;}
+
     static std::string format();
 
   private:
     static int selecticolflag;
     static int ipowercomb;
     static double imid;
+    static bool iprpresent; // true if we have a second intensity Ipr stored
   //===================================================================
   };  // SelectI
 
@@ -177,7 +186,6 @@
   //! An observation of a reflection, which may consist of one or more parts
   class observation
   {
-    // 
   public:
     observation();
     observation(const Hkl hkl_in,
@@ -199,6 +207,19 @@
     Rtype ksigI() const {return sigI_/gscale;} //!< return scaled sigI
     IsigI kI_sigI() const {return IsigI(I_/gscale,sigI_/gscale);}    //!< return scaled I, sigI
 
+    //! Return "summation" integration IsigI, summed over partials if necessary
+    // This is also the sole intensity if there is only one 
+    // Also sets mean phi, time, LP
+    IsigI IsigIsummation();
+
+    // Return "profile" integration I sigI, summed over partials if necessary
+    IsigI IsigIpr() const;
+
+    // Sum (or scale) all partials for this observation
+    // Assumes that SelectI has been set up correctly to choose
+    // either summation, profile or combined intensity measurements
+    // Sets I_, sigI_, phi_, time_, LP_, batch_
+    void sum_partials();
 
     Rtype phi() const {return phi_;}  //!< return rotation angle "phi"
     Rtype time() const {return time_;} //!< return "time"
@@ -429,7 +450,6 @@
     //! Copy operator throws exception unless object is EMPTY
     hkl_unmerge_list& operator= (const hkl_unmerge_list& List);
 
-
     // Set controls, limits, etc ----------
     void SetResoLimits(const float& LowReso, const float& HighReso); //!< set resolution
 
@@ -547,6 +567,11 @@
     //! replace current reflection with updated version
     void replace_reflection(const reflection& refl);
 
+    //!  Get reflection jref, if accepted, else next acceptable one
+    //!  Return index of returned reflection, = -1 if end of list
+    //! Thread safe, no change in mutable data
+    int get_accepted_reflection(const int& jref, reflection& this_refl) const;
+      
     //! replace lobs'th observation in current reflection with updated version
     void replace_observation(const observation& obs, const int& lobs);
 
@@ -575,7 +600,8 @@
     int prepare();
     //! Sum partials
     /*!  return number of partials */
-    int sum_partials();
+    /*! If forcesum is true, sum them even if already summed */
+    int sum_partials(const bool& forcesum=false);
 
     //! Calculate all secondary beam directions, in chosen frame
     /*! On entry:
@@ -760,7 +786,9 @@
     void set_run();   // set all runs in part list
 
     bool accept() const;    // true if reflection(NextRefNum) is acceptable
-                       // also counts ice ring
+                            // also counts ice ring
+    // private method, no counting or other internal storage
+    bool acceptableReflection(const int& RefNum) const;
 
     //! Set runs
     void SetUpRuns();
diff -r -u 20110907/ccp4-6.2.0/src/pointless/intensitystatistics.cpp 20110921/ccp4-6.2.0/src/pointless/intensitystatistics.cpp
--- 20110907/ccp4-6.2.0/src/pointless/intensitystatistics.cpp	2011-05-09 10:25:01.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/intensitystatistics.cpp	2011-09-06 17:50:02.000000000 +0100
@@ -89,8 +89,8 @@
     // Probability
     double mcent = 0.968;
     double macen = 0.736;
-    DM_2sqrt DMcentric(macen, mcent);
-    double pcentro = ProbBiassed(TotE2minus1, SD_E2m1, mcent, DMcentric);
+    DM_2sqrt *DMcentric = new DM_2sqrt(macen, mcent);
+    double pcentro = ProbBiassed(TotE2minus1, SD_E2m1, mcent, *DMcentric);
 
 
     //    double dc = Max(mcent - TotE2minus1, 0.0)/SD_E2m1;
diff -r -u 20110907/ccp4-6.2.0/src/pointless/outputunmergeddata.cpp 20110921/ccp4-6.2.0/src/pointless/outputunmergeddata.cpp
--- 20110907/ccp4-6.2.0/src/pointless/outputunmergeddata.cpp	2011-05-09 10:25:14.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/outputunmergeddata.cpp	2011-07-29 15:20:59.000000000 +0100
@@ -53,10 +53,11 @@
   //^-
 
   if (hklout_filename != "") {
-    // Only test rotational part of symmetry
+    // Only test rotational part of symmetry, but check for same order
     // don't bother to change symmetry just for translations
     //   but use correct space group in writing
-    if (SPGsymm != hkl_list.symmetry() || ! reindex.IsIdentity()) {
+    if (!SPGsymm.equals_r_order(hkl_list.symmetry()) ||
+	! reindex.IsIdentity()) {
       int NfractIdx = hkl_list.change_symmetry(SPGsymm, reindex, true);
       if (NfractIdx > 0) {
 	output.logTabPrintf(0,LOGFILE,
diff -r -u 20110907/ccp4-6.2.0/src/pointless/pgscore.cpp 20110921/ccp4-6.2.0/src/pointless/pgscore.cpp
--- 20110907/ccp4-6.2.0/src/pointless/pgscore.cpp	2011-05-09 10:25:15.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/pgscore.cpp	2011-09-06 17:50:02.000000000 +0100
@@ -112,19 +112,19 @@
     if (NAveragedZCCfor == 0 &&  NAveragedZCCagainst == 0) return;
 
     IntgrtProb IP1;
-    if (Close<double>(exponent, 2.0)) {
-      DM_2sqrt DM(0.0,CCTrueScore); // Model for CC- if true, most likely 0.0
+    if (Close<double>(exponent, 2.0)) {  
+      DM_2sqrt *DM = new DM_2sqrt(0.0,CCTrueScore); // Model for CC- if true, most likely 0.0
       //DM_2sqrt DM(0.0,1.0); // Model for CC- if true, most likely 0.0
       //    DM_lin  DM(0.0,CCTrueScore);
       //    DM_cubic  DM(0.0,CCTrueScore);
       //    DM_cubicsu  DM(0.0,CCTrueScore);
       //    DM_1minusmSq  DM(0.0,CCTrueScore);
       //    DM_1minusmCu  DM(0.0,CCTrueScore);
-      IP1.init(DM);
+      IP1.init(*DM);
     } else {
-      DM_power DM(0.0,CCTrueScore);
-      DM.SetPower(exponent);
-      IP1.init(DM);
+      DM_power *DM = new DM_power(0.0,CCTrueScore);
+      DM->SetPower(exponent);
+      IP1.init(*DM);
     }
 
     const bool DEBUG = false;
diff -r -u 20110907/ccp4-6.2.0/src/pointless/pointgroup.cpp 20110921/ccp4-6.2.0/src/pointless/pointgroup.cpp
--- 20110907/ccp4-6.2.0/src/pointless/pointgroup.cpp	2011-05-09 10:25:16.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/pointgroup.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -663,20 +663,28 @@
   //  only, no change otherwise
   // Return true if accepted
   {
+    // compare = -1 
     int compare = -1;
     if (CrysSys == ORTHORHOMBIC && sameGroup) {
       compare = best_cell.compare_orthorhombic(test_cell);
     } else if (CrysSys == MONOCLINIC) {
       compare = best_cell.compare_monoclinic
 	(test_cell, UniqueAxis, angular_tolerance);
+      // Accept new one anyway if beta >= 90 and old best had beta < 90
+      if (compare < 1) {
+	if (best_cell.parameters()[UniqueAxis+3] < 90.0 && test_cell.parameters()[UniqueAxis+3] >= 90.0) {
+	  compare = +1;
+	}}
     }
 
     if (compare > 0) {
       //^
-      //	std::cout << "Updating cell: " << CrysSys << " "
-      //		  << sameGroup << " " << angular_tolerance << "\n"
-      //		  << "Old best cell: " << UcellFormat(best_cell) <<"\n"
-      //		  << "New best cell: " << UcellFormat(test_cell) <<"\n";
+      //      std::cout << "Updating cell: " << CrysSys << " "
+      //		<< sameGroup << " " << angular_tolerance << "\n"
+      //		<< "Old best cell: " << UcellFormat(best_cell) <<"\n"
+      //		<< "New best cell: " << UcellFormat(test_cell) <<"\n";
+      //      for (int i=0;i<6;++i) {std::cout <<" "<<best_cell.parameters()[i];}
+      //      std::cout <<"\n";
       //-!
       best_cb_op = cb_op;
       best_cell = test_cell;
@@ -912,7 +920,7 @@
     if (ChBasisVec.size() > 0 && BestCell) ChBasisVec.resize(1);
 
     return ChBasisVec;
-  }
+  }  // GetAlterntiveBases
   //--------------------------------------------------------------
   std::vector<AlternativeBases>
   ChangeBasesList(const std::vector<AlternativeBases>& CBlist,
@@ -1139,7 +1147,7 @@
     uctbx::unit_cell uccell_chb = ChBasis.apply(uccell);
     //^
     //    std::cout << "\n>>> SetCell " << RefLGname() << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n";
-
+    //^-
     // Try to get "best" setting of cell and new reference
     //  cb_op_best transforms reference to "best"
     sgtbx::change_of_basis_op cb_op_best = GetBestCell(LaueGrp_ref, uccell_chb, AllowI2);
@@ -1147,14 +1155,14 @@
 
     //^
     //    std::cout << "Reindex original->constructor ChBasis_cell): "
-    //	      <<  ChangeBasisFormat_as_Reindex(ChBasis_cell) << "\n"
-    //	      << "Reindex original->reference ChBasis): "
-    //	      <<  ChangeBasisFormat_as_Reindex(ChBasis) << "\n"
-    //	      << "Reindex constructor->reference ChBasis_ref): "
-    //	      <<  ChangeBasisFormat_as_Reindex(ChBasis_ref) << "\n"
-    //	      << "CellIn:  " << UcellFormat(uccell) << "\n"
-    //	      << "CellChB: " << UcellFormat(uccell_chb) << "\n"
-    //	      << "CellRef: " << UcellFormat(uccell_ref) << "\n";
+    //    	      <<  ChangeBasisFormat_as_Reindex(ChBasis_cell) << "\n"
+    //    	      << "Reindex original->reference ChBasis): "
+    //    	      <<  ChangeBasisFormat_as_Reindex(ChBasis) << "\n"
+    //    	      << "Reindex constructor->reference ChBasis_ref): "
+    //    	      <<  ChangeBasisFormat_as_Reindex(ChBasis_ref) << "\n"
+    //    	      << "CellIn:  " << UcellFormat(uccell) << "\n"
+    //    	      << "CellChB: " << UcellFormat(uccell_chb) << "\n"
+    //    	      << "CellRef: " << UcellFormat(uccell_ref) << "\n";
     //-!
 
     // Test for change of symmetry, C2 to I2
@@ -1168,15 +1176,15 @@
       LaueGrp_ref_type = sgtbx::space_group_type(LaueGrp_ref);
       LatType = CentringSymbol(LaueGrp_ref);
       //^
-      //                        std::cout << "\n==== SetCell: updated groups " << LatType << " "
-      //                  		<< LaueGrp_ref_type.hall_symbol() << "\n";
-      //                        std::cout << "Cell_ref: " << UcellFormat(uccell_ref) << "\n";
-      //                        std::cout << "ChBasis:\n";
-      //                        PrintChBOp(ChBasis);
-      //                        std::cout << "ChBasis_ref:\n";
-      //                        PrintChBOp(ChBasis_ref);
-      //                        std::cout << "cb_op_best:\n";
-      //                        PrintChBOp(cb_op_best);
+      //      std::cout << "\n==== SetCell: updated groups " << LatType << " "
+      //		<< LaueGrp_ref_type.hall_symbol() << "\n";
+      //      std::cout << "Cell_ref: " << UcellFormat(uccell_ref) << "\n";
+      //      std::cout << "ChBasis:\n";
+      //      PrintChBOp(ChBasis);
+      //      std::cout << "ChBasis_ref:\n";
+      //      PrintChBOp(ChBasis_ref);
+      //      std::cout << "cb_op_best:\n";
+      //      PrintChBOp(cb_op_best);
       //^-
     }
     // ChBasis is operator for Original(cell) -> reference
@@ -1197,8 +1205,8 @@
     }
     //^
     //    std::cout << "End of SetCell:\n"
-    //	      << "  Reindex original->reference ChBasis): "
-    //	      <<  ChangeBasisFormat_as_Reindex(ChBasis) << "\n";
+    //    	      << "  Reindex original->reference ChBasis): "
+    //    	      <<  ChangeBasisFormat_as_Reindex(ChBasis) << "\n";
     //^-
     // Maximum angular deviation of cell from that
     // required by rotation group
diff -r -u 20110907/ccp4-6.2.0/src/pointless/pointgroup.hh 20110921/ccp4-6.2.0/src/pointless/pointgroup.hh
--- 20110907/ccp4-6.2.0/src/pointless/pointgroup.hh	2010-07-01 09:11:54.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/pointgroup.hh	2011-09-06 17:49:04.000000000 +0100
@@ -286,6 +286,9 @@
     // Constructor -> reference
     sgtbx::change_of_basis_op ChBasis_ref;
 
+    // Reference -> "best"
+    sgtbx::change_of_basis_op ChBasis_best;
+
     // Symmetry element list
     std::vector<int> ElementNums;
 
diff -r -u 20110907/ccp4-6.2.0/src/pointless/pointless.cpp 20110921/ccp4-6.2.0/src/pointless/pointless.cpp
--- 20110907/ccp4-6.2.0/src/pointless/pointless.cpp	2011-06-18 21:59:59.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/pointless.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -561,8 +561,7 @@
     // file is merged, remove all subgroups which are subgroups of original group
     //  since these are implicit
     hkl_symmetry mergeSymm = OrigSymm;
-    mergeSymm.ChangeBasis(reindex_op);
-    RemoveImplicitSubgroups(subgroups, mergeSymm);
+    RemoveImplicitSubgroups(subgroups, mergeSymm, reindex_op);
   }
   //^
   //  std::cout << "=== Subgroup size " <<subgroups.size()  <<"\n";
@@ -1895,7 +1894,7 @@
 	bool verbose = true;
 	MtzIO::CopyMergedMTZ(hklin_filename,
 			     AllFiles.Filename("HKLOUT"),
-			     SpaceGroup, ReindexOut, reindexedTestData, reduce,
+			     SpaceGroup, ReindexOut, reduce,
 			     verbose, output);
       }
       else {    // Unmerged
@@ -1970,7 +1969,7 @@
 			  PMexponent);
 
       output.logTabPrintf(0,LOGFILE,
-			  "Time for twinnning test %8.3f secs\n\n",cputime.Stop());
+			  "Time for twinning test %8.3f secs\n\n",cputime.Stop());
       output.logTab(0,LOGFILE,
        "======================================================================\n\n");
     }
@@ -2381,7 +2380,7 @@
   CCP4::ccp4fyp(argc, argv);
 
   CCP4::ccp4ProgramName (PROGRAM_NAME.c_str());
-  std::string rcsdate = "$Date: 2011/06/18 20:59:59 $";
+  std::string rcsdate = "$Date: 2011/09/06 16:49:04 $";
   CCP4::ccp4RCSDate     (rcsdate.c_str());
   CCP4::ccp4_prog_vers(PROGRAM_VERSION);
   CCP4::ccp4_banner();
diff -r -u 20110907/ccp4-6.2.0/src/pointless/pointless.html 20110921/ccp4-6.2.0/src/pointless/pointless.html
--- 20110907/ccp4-6.2.0/src/pointless/pointless.html	2011-06-18 22:00:01.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/pointless.html	2011-09-06 17:49:04.000000000 +0100
@@ -18,6 +18,12 @@
 
 
 
+
+
+
+
+
+
   <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title>CCP4 Program Suite: pointless</title>
   
   <meta name="GENERATOR" content="NeoOffice 2.2  (Unix)">
@@ -160,20 +166,22 @@
 HKLIN file is a merged file, then any anomalous difference columns
 will be negated, and F+/- I+/- columns swapped, if the hand of the
 index is changed by the reduction process. Note that in this case
-there is no check made that the reindexing operator is consistent
+there is no reliable check made that the reindexing operator is
+consistent
 with the space group: if a SPACEGROUP command is not given, the
 reindexed space group will be used if it is valid, otherwise you will
 have to specify the space group. Any reflections with non-integral
 indices after
 reindexing are discarded, so this may be used to select reflections
-corresponding to a sub-cell. Files containing phase columns cannot be
-reindexed.</p>
+corresponding to a sub-cell. Files containing phase columns can now be
+reindexed, as long as you are just changing the setting, not the space
+group (eg I2&lt;-&gt;C2, P2 21 21 &lt;-&gt; P21 21 2 etc).</p>
 <h3 style="margin-left: 2cm;">5. Converting XDS, Scalepack, SHELX or SAINT format to
 MTZ</h3>
 <p style="margin-left: 2cm;">The command line option "-copy"
 (or "-c") may be used just to convert an XDS, Scalepack or SHELX
 file to the MTZ format. The NAME keyword is required, and for
-SCALEPACK or SHELX input the CELL must be given. For SAINT input it is recommended to give a CELL (as it will be more accurate).</p>
+SCALEPACK or SHELX input the CELL must be given. For SAINT input it is recommended to give a CELL (as it may be more accurate).</p>
 <h3>Choice of solution for the output file</h3>
 <p style="margin-left: 2cm;">A “solution” is a space group (or
 point group) and a reindexing operator. In INDEX mode, the solution
@@ -948,8 +956,31 @@
 <p><br>
 </p>
 <h2><a name="release_notes"></a>Release notes</h2>
+<h3>1.6.4</h3>
+Reindexing merged files now deals properly with phase and ABCD columns,
+eg for I2&lt;-&gt;C2 or&nbsp; P2 21 21 &lt;-&gt; P21 21 2 conversions<br>
+Improved/fixed detection of new space group after reindexing<br>
+
+<h3>1.6.3</h3>Trap "*****" fields from format overflow in XDS headers, just to give a sensible error message<br>
+<h3>1.6.2</h3>
+
+<span style="font-weight: normal;">XDS XSCALE now puts [U] = [I] to
+evade bug in Reindex, used in Xia2. Also restored the History record in
+the MTZ header (lost at some previous point)</span> <br>
+<h3>1.6.1 <br>
+</h3>
+<h3>
+</h3>
+fixed serious bug present in all 1.5.x versions. If an MTZ file
+input is in the highest point group of the higher symmetry group,
+specifically 422, 622, R32 or 432, and the final output file is in the
+same point group, then the symmetry operators were scrambled relative
+to the ISYM flags on the observations, leading to wrong original hkl
+being genereated in Scala/Aimless: this then affects the secondary beam
+calculation and hence the absorption correction&nbsp; &nbsp; <br>
 <h3>1.5.22</h3>
 
+
 WILDFILE option<br>
 For enantiomorpic space groups, prefer to pick the one that matches the input file<br>
 Minor fix to reading XSCALE output files<br>
diff -r -u 20110907/ccp4-6.2.0/src/pointless/probfunctions.cpp 20110921/ccp4-6.2.0/src/pointless/probfunctions.cpp
--- 20110907/ccp4-6.2.0/src/pointless/probfunctions.cpp	2011-05-09 10:25:23.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/probfunctions.cpp	2011-09-06 17:50:02.000000000 +0100
@@ -12,6 +12,7 @@
   // Gaussian probability density function
   // returns p = (1/(sd*sqrt(twopi))) exp (-1/2 z^2)
   //   where z = (val-mean)/sd
+  //
 {
   if (sd <= 0.0)
     clipper::Message::message(clipper::Message_fatal
diff -r -u 20110907/ccp4-6.2.0/src/pointless/probfunctions.hh 20110921/ccp4-6.2.0/src/pointless/probfunctions.hh
--- 20110907/ccp4-6.2.0/src/pointless/probfunctions.hh	2011-05-09 10:25:23.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/probfunctions.hh	2011-09-06 17:50:02.000000000 +0100
@@ -153,6 +153,7 @@
   {
   public:
     IntgrtProb() : nd(10000) {}
+	~IntgrtProb() { delete DMeanModel; }
 
     // Note that this stores a pointer to the external function
     // which therefore must continue to exist while this class
diff -r -u 20110907/ccp4-6.2.0/src/pointless/scala_util.cpp 20110921/ccp4-6.2.0/src/pointless/scala_util.cpp
--- 20110907/ccp4-6.2.0/src/pointless/scala_util.cpp	2011-06-18 22:00:06.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/scala_util.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -49,7 +49,7 @@
 	  break;
 	}
       }
-      if (i < name.size()-1) {
+      if (dot && i < int(name.size())-1) {
 	return name.substr(i+1, name.size()-1-i);
       }
     }
diff -r -u 20110907/ccp4-6.2.0/src/pointless/scsignificance.cpp 20110921/ccp4-6.2.0/src/pointless/scsignificance.cpp
--- 20110907/ccp4-6.2.0/src/pointless/scsignificance.cpp	2011-05-09 10:25:30.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/scsignificance.cpp	2011-09-06 17:50:02.000000000 +0100
@@ -37,7 +37,7 @@
   //  P(S|score)/[P(S|score) + P(!S|score)]
   //  E(score|S) = TrueScore  (eg 1.0 for correlation coefficient)
   //  E(score|!S) is in range 0.0 to TrueScore
-  //
+  
   //  Returns = 0.0 if SDUnrelSC = 0.0
   //          = 1.0 if SDUnrelSC < 0
   {
@@ -47,18 +47,18 @@
     IntgrtProb IP;
 
     if (Close<double>(exponent, 2.0)) {
-      DM_2sqrt  DM(0.0,truescore); // Model for CC- if true, most likely 0.0
+      DM_2sqrt *DM = new DM_2sqrt(0.0,truescore); // Model for CC- if true, most likely 0.0
       //    DM_2sqrt  DM(0.0,1.0); // Model for CC- if true, most likely 0.0
       //    DM_lin  DM(0.0,1.0);
       //    DM_cubic  DM(0.0,1.0);
       //    DM_cubicsu  DM(0.0,1.0);
       //    DM_1minusmSq  DM(0.0,1.0);
       //    DM_1minusmCu  DM(0.0,1.0);
-      IP.init(DM);
+      IP.init(*DM);
     } else {
-      DM_power DM(0.0,truescore);
-      DM.SetPower(exponent);
-      IP.init(DM);
+      DM_power *DM = new DM_power(0.0,truescore);
+      DM->SetPower(exponent);
+      IP.init(*DM);
     }
 
     double PS, PnotS;
diff -r -u 20110907/ccp4-6.2.0/src/pointless/spacegroupreindex.cpp 20110921/ccp4-6.2.0/src/pointless/spacegroupreindex.cpp
--- 20110907/ccp4-6.2.0/src/pointless/spacegroupreindex.cpp	2010-06-17 10:02:38.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/spacegroupreindex.cpp	2011-09-06 17:49:04.000000000 +0100
@@ -19,7 +19,7 @@
   // in same crystal system
   // Mainly (only?) for C2<->I2 and H3<->R3
   // Throws a clipper::Message_warn exception if the space groups are
-  // not just alternative settings (ie have differnt reference groups)
+  // not just alternative settings (ie have different reference groups)
   {
     // from space group
     std::string frname = CCtbxSym::CCTBX_SGsymbol_HorR(from_SGname);
@@ -28,7 +28,7 @@
     // Change of basis to reference setting
     sgtbx::change_of_basis_op ChB_ref_from = from_SG.type().cb_op();
     sgtbx::space_group from_SG_ref = from_SG.change_basis(ChB_ref_from);
-    //^  CCtbxSym::PrintChBOp(ChB_ref_from);
+    //^    CCtbxSym::PrintChBOp(ChB_ref_from); //^
 
     // to space group
     sgtbx::space_group to_SG =
@@ -37,7 +37,7 @@
     // Change of basis to reference setting
     sgtbx::change_of_basis_op ChB_ref_to = to_SG.type().cb_op();
     sgtbx::space_group to_SG_ref = to_SG.change_basis(ChB_ref_to);
-    //^  CCtbxSym::PrintChBOp(ChB_ref_to);
+    //^    CCtbxSym::PrintChBOp(ChB_ref_to); //^
 
     // Reference groups should be the same
     if (from_SG_ref != to_SG_ref) {
@@ -64,12 +64,14 @@
   bool SpacegroupReindex(const GlobalControls& GC,
 			 const hkl_symmetry& HKLINsymm, const Scell& cell,
 			 ReindexOp& Reindex, phaser_io::Output& output)
-// If SPACEGROUP is specified but no REINDEX operator, generate appropriate reindexing
-// to convert from input HKLIN file HKLINsymm to desired spacegroup
-// Probably really only useful (or indeed valid) for C2 <-> I2 & H3<->R3
-//
-// Returns true if Reindex is set
-// fails if the symmetries do not belong to same lattice group
+  // If SPACEGROUP is specified but no REINDEX operator, generate appropriate reindexing
+  // to convert from input HKLIN file HKLINsymm to desired spacegroup
+  // Probably really only useful (or indeed valid) for C2 <-> I2 & H3<->R3, or P222 groups
+  //
+  // input cell corresponds to HKLINsymm
+  //
+  // Returns true if Reindex is set
+  // fails if the symmetries do not belong to same lattice group
 {
   if (GC.Spacegroup() == "" ||  GC.Spacegroup() == "HKLIN" || GC.IsReindexSet()) return false;
 
@@ -85,6 +87,7 @@
   }
 
   try {
+    // Get reindex operator
     Reindex = SpacegroupReindexOp(HKLIN_SGname, Input_SGname);
   }
   catch (Message_warn& warn) {
@@ -95,10 +98,14 @@
       Message::message(Message_fatal(message));
   }
 
-  CCtbxSym::PointGroup PG(Input_SGname);
-  PG.SetCell(cell.UnitCell(), Reindex, GC.AllowI2());
+  int AllowI2 =  GC.AllowI2();
+  if (NewSymm.lattice_type() != 'I') {
+    AllowI2 = 0;  // don't allow I lattice if we've asked for C2
+  }
 
-  Reindex = PG.RefSGreindex();
+  CCtbxSym::PointGroup PG(Input_SGname);
+  PG.SetCell(cell.UnitCell(), Reindex, AllowI2);
+  Reindex = PG.RefSGreindex(); // reindex cell -> best
 
   output.logTab(0,LOGFILE,
 		"Reindexing data with operator "+Reindex.as_hkl()+
diff -r -u 20110907/ccp4-6.2.0/src/pointless/version.hh 20110921/ccp4-6.2.0/src/pointless/version.hh
--- 20110907/ccp4-6.2.0/src/pointless/version.hh	2011-06-18 22:00:09.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/version.hh	2011-09-06 17:49:04.000000000 +0100
@@ -4,9 +4,9 @@
 #define PROGRAM_VERSION_HEADER
 
 #define PROGRAM_NAME     std::string("POINTLESS")
-#define PROGRAM_VERSION  "1.5.22"
-#define PROGRAM_DATE     "18th May 2011"
-#define PROGRAM_DATE2    "2011/05/18"
+#define PROGRAM_VERSION  "1.6.4"
+#define PROGRAM_DATE     "17th August 2011"
+#define PROGRAM_DATE2    "2011/08/17"
 #define PROGRAM_EXPIRES  bool(false)
 #define EXPIRE_DAY       int(1)
 #define EXPIRE_MONTH     int(1)
diff -r -u 20110907/ccp4-6.2.0/src/pointless/writeunmergedmtz.cpp 20110921/ccp4-6.2.0/src/pointless/writeunmergedmtz.cpp
--- 20110907/ccp4-6.2.0/src/pointless/writeunmergedmtz.cpp	2011-05-16 14:24:03.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/writeunmergedmtz.cpp	2011-08-03 11:11:26.000000000 +0100
@@ -26,6 +26,7 @@
 #include "openinputfile.hh"
 #include "observationflags.hh"
 #include "cellgroup.hh"
+#include "version.hh"
 
 using namespace CMtz;
 
@@ -155,10 +156,11 @@
     char time[9];
     CCP4::ccp4_utils_date(date);
     CCP4::ccp4_utils_time(time);
-    std::string text = "POINTLESS, "+std::string(date)+" "+
+    std::string text = "Pointless, version "+std::string(PROGRAM_VERSION)+
+      ", run on "+std::string(date)+" at "+
       std::string(time);
     strcpy(history, text.c_str()); 
-    //    int Nhist = MtzAddHistory(mtzout, &history, 1);
+    int Nhist = MtzAddHistory(mtzout, &history, 1);
 
     // Count observation parts in each batch
     std::vector<int> nobsbatch(hkl_list.num_batches(),0);
diff -r -u 20110907/ccp4-6.2.0/src/pointless/xds_unmerge.cpp 20110921/ccp4-6.2.0/src/pointless/xds_unmerge.cpp
--- 20110907/ccp4-6.2.0/src/pointless/xds_unmerge.cpp	2011-06-18 22:00:10.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/xds_unmerge.cpp	2011-09-06 17:31:31.000000000 +0100
@@ -193,6 +193,7 @@
     nxpix = 0;
     nypix = 0;
     Umat = Mat33<double>::identity();
+    mosaicrange = 0.0;
 
     if (verbose > 0) {
       output += FormatOutput::logTab(0,
@@ -222,12 +223,23 @@
 	// Header line
 	// echo to log file
 	if (verbose > 0) output += FormatOutput::logTab(0,  line);
-	
+
+	// Header lines should not contain "*" character
+	// This will occur if things are horribly wrong, format overflow
+	if (line.find("*") != std::string::npos) {
+	  Message::message(Message_fatal
+			   ("XDS: Header line corrupt:\n"+line));
+	}
+
+	// remove leading "!"
 	line = line.substr(1, line.length()-1);
 	//	    line = std::string(line, 1, line.length()-1);
 
+
 	std::vector<KeyValues> keyvalues = SSplit(line);
 	
+	  
+
 	for (size_t ik=0;ik<keyvalues.size();ik++) {
 	  status = ProcessKeyValues(keyvalues[ik], output);
 	  if (status < 0) {HeaderOK = false;}
@@ -463,6 +475,8 @@
 	  {c[i] = keyval.values[i].f64();}
 	cell = scala::Scell(c);
       }
+    else if (keyval.key == "REFLECTING_RANGE_E.S.D.=")
+      mosaicrange = keyval.values[0].f64();  // mosaicity
     else if (keyval.key == "NAME_TEMPLATE_OF_DATA_FRAMES=")
       {image_template = keyval.values[0];}
     else if (keyval.key == "DATA_RANGE=")
@@ -1015,8 +1029,8 @@
     if (!GeomInfo) { // No geometry information, set some indicators
       s0C = s0ideal;
       jumpax = 0;
-      float nullmat[] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
-      Umat = MVutil::SetCMat33(nullmat);
+      //      float nullmat[] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
+      //      Umat = MVutil::SetCMat33(nullmat);
     }
 
     CMtz::MTZBAT BHeader;   // header structure
@@ -1062,7 +1076,7 @@
       for (int j=0;j<3;j++) {
 	BHeader.phixyz[i][j] = 0.0;
       }}
-    BHeader.crydat[0] = 0.0;              /**< mosaicity */
+    BHeader.crydat[0] = mosaicrange;              /**< mosaicity */
     for (int i=1;i<12;i++) {BHeader.crydat[i] = 0.0;}
     /**< datum values of goniostat axes */
     for (int i=0;i<3;i++) {BHeader.datum[i] = 0.0;}
diff -r -u 20110907/ccp4-6.2.0/src/pointless/xds_unmerge.hh 20110921/ccp4-6.2.0/src/pointless/xds_unmerge.hh
--- 20110907/ccp4-6.2.0/src/pointless/xds_unmerge.hh	2011-06-18 22:00:11.000000000 +0100
+++ 20110921/ccp4-6.2.0/src/pointless/xds_unmerge.hh	2011-07-29 15:20:59.000000000 +0100
@@ -163,6 +163,8 @@
     int nxpix, nypix;
     // QX, QY    pixel size along detector x & y
     double qxpixsize, qypixsize;
+    // REFLECTING_RANGE_E.S.D.  (== mosaicity)
+    double mosaicrange;
     // NUMBER_OF_ITEMS_IN_EACH_DATA_RECORD
     int nitem_rec;
     int nitem;
