I wonder if anyone has noticed the behaviour that the creation of columns in an mtz object seems to suffer from a problem.

The script below creates an mtz object from three miller arrays of intensities, amplitudes and anomalous differences together with their sigmas on 5 reflections. The intention is that the mtz object should also consist of three pairs of columns ( I,SIGI and F,SIGF and DANO,SIGDANO).

However the script shows that if the miller array with anomalous differences is added as the last miller array then the resulting mtz object is messed up: It has grouped F,SIGF and DANO,SIGDANO together as 10 reflections instead of just 5.

Only if the miller array with anomalous differences is added as the second miller array after the intensities does the resulting mtz object contain the three distinct pairs of columns I,SIGI and F,SIGF and DANO,SIGDANO as intended each with 5 reflections.


from cctbx.xray import observation_types
from cctbx.array_family import flex
from cctbx import miller
from cctbx import crystal

xs = crystal.symmetry(unit_cell=(50,50,40, 90,90,120), space_group_symbol="P3 1")
mi = flex.miller_index([(1,-2,3), (0,0,-3), (1, 2, 3), (0, 1, 2), (1, 0, 2)])

ma1 = miller.array( miller.set(xs, mi),
  flex.double( [ 11.2, 6.3, 26.1, 14.9, 2.4 ] ),
  sigmas=flex.double( [ 13.6, 6.3, 24.9, 6.2, 11.1 ] )
)
ma2 = miller.array( miller.set(xs, mi),
  flex.double( [ 8.2, 26.3, 2.1, 4.9, 32.4 ] ),
  sigmas=flex.double( [ 3.6, 76.3, 2.9, 61.2, 1.1 ] )
)
ma3 = miller.array( miller.set(xs, mi),
  flex.double( [ 8.2, 26.3, 2.1, 4.9, 32.4 ] ),
  sigmas=flex.double( [ 3.6, 76.3, 2.9, 61.2, 1.1 ] )
)

mtz1 = ma1.as_mtz_dataset(column_root_label = "I", column_types = "JQ")
mtz1.add_miller_array(ma2, column_root_label = "F", column_types = "FQ")
mtz1.add_miller_array(ma3, column_root_label = "DANO", column_types = "DQ")

mtz1.mtz_object().as_miller_arrays()   # unexpected F,SIGF,DANO,SIGDANO array looks messed up

mtz2 = ma1.as_mtz_dataset(column_root_label = "I", column_types = "JQ")
mtz2.add_miller_array(ma3, column_root_label = "DANO", column_types = "DQ")
mtz2.add_miller_array(ma2, column_root_label = "F", column_types = "FQ")

mtz2.mtz_object().as_miller_arrays()   # looks correct

Is this a bug, a well known feature or am I simply doing something wrong?

Many thanks,

Rob

-- 
Robert Oeffner, Ph.D.
Research Associate, The Read Group
Department of Haematology,
Cambridge Institute for Medical Research
University of Cambridge
Cambridge Biomedical Campus
The Keith Peters Building
Hills Road
Cambridge CB2 0XY
www.cimr.cam.ac.uk/investigators/read/index.html
tel: +44(0)1223 763234

Virus-free. www.avg.com