示例#1
0
# Out[16]: (17, 23, 23)

# In [17]: refl[index[10000]].image_coord_px
# Out[17]: (788.1612634483189, 1969.9381446581392)

# In [18]: refl[index[10000]].frame_number
# Out[18]: 352.1425769902628

# In [19]: 2.688E+03
# Out[19]: 2688.0

from dials.model.serialize import load

sweep = load.sweep("/home/upc86896/Data/TRP_M1S3_2_/sweep.json")
crystal = load.crystal("/home/upc86896/Data/TRP_M1S3_2_/crystal.json")
reference = load.reference("/home/upc86896/Data/TRP_M1S3_2_/reference.pickle")
# from dials.algorithms.integration import ReflectionExtractor

# extract = ReflectionExtractor(3)
# refl = extract(sweep, crystal)
# index = 104786
# print refl[index].miller_index

import pickle

# pickle.dump(refl[index], open('test_reflection', 'w'))
refl = pickle.load(open("test_reflection", "r"))

from dials.model.data import ReflectionList

ref_list = ReflectionList(1)
        row3 += lines[6][k] + space + lines[7][k] + space + lines[8][k] + "\n"

    text = row1 + "\n" + row2 + "\n" + row3 + "\n"

    return text


from matplotlib import pylab
from scitbx.array_family import flex
from dials.model.serialize import load
import numpy
import sys

numpy.set_printoptions(precision=3, suppress=True)

reference = load.reference(sys.argv[1])
outfile = open("profiles.txt", "w")

for nref in range(9):

    profile = reference.profile(nref).as_numpy_array()
    outfile.write("Profile {0}\n".format(nref))
    outfile.write(print_profile(profile))

    xcoord = int(reference.coord(nref)[0])
    ycoord = int(reference.coord(nref)[1])

    fig = pylab.figure(1, figsize=(6, 6))
    fig.text(
        0.5,
        0.95,
    row2 += lines[3][k] + space + lines[4][k] + space + lines[5][k] + "\n"
    row3 += lines[6][k] + space + lines[7][k] + space + lines[8][k] + "\n"

  text = row1 + "\n" + row2 + "\n" + row3 + "\n"

  return text

from matplotlib import pylab
from scitbx.array_family import flex
from dials.model.serialize import load
import numpy
import sys

numpy.set_printoptions(precision=3, suppress=True)

reference = load.reference(sys.argv[1])
outfile = open("profiles.txt", "w")

for nref in range(9):

  profile = reference.profile(nref).as_numpy_array()
  outfile.write("Profile {0}\n".format(nref))
  outfile.write(print_profile(profile))

  xcoord = int(reference.coord(nref)[0])
  ycoord = int(reference.coord(nref)[1])

  fig = pylab.figure(1, figsize=(6, 6))
  fig.text(.5, .95, "Position: {0}".format((xcoord, ycoord)), horizontalalignment='center')
  max_profile = flex.max(reference.profile(nref))
  for k in range(9):
示例#4
0
#In [16]: refl[index[10000]].miller_index
#Out[16]: (17, 23, 23)

#In [17]: refl[index[10000]].image_coord_px
#Out[17]: (788.1612634483189, 1969.9381446581392)

#In [18]: refl[index[10000]].frame_number
#Out[18]: 352.1425769902628

#In [19]: 2.688E+03
#Out[19]: 2688.0

from dials.model.serialize import load
sweep = load.sweep('/home/upc86896/Data/TRP_M1S3_2_/sweep.json')
crystal = load.crystal('/home/upc86896/Data/TRP_M1S3_2_/crystal.json')
reference= load.reference('/home/upc86896/Data/TRP_M1S3_2_/reference.pickle')
#from dials.algorithms.integration import ReflectionExtractor

#extract = ReflectionExtractor(3)
#refl = extract(sweep, crystal)
#index = 104786
#print refl[index].miller_index

import pickle
#pickle.dump(refl[index], open('test_reflection', 'w'))
refl = pickle.load(open('test_reflection', 'r'))

from dials.model.data import ReflectionList
ref_list = ReflectionList(1)
ref_list[0] = refl
示例#5
0
from __future__ import print_function

fullpath = "/home/upc86896/Data/TRP_M1S3_2_/reference.pickle"
small_template = "/home/upc86896/Data/TRP_M1S3_2_/reference%d.pickle"
smallpaths = [small_template % i for i in range(5)]

from dials.model.serialize import load

full_reference = load.reference(fullpath)
small_reference = [load.reference(path) for path in smallpaths]

profile1 = full_reference.profile(0)
profile2 = small_reference[0].profile(0)

from scitbx.array_family import flex

diff = flex.abs(profile1 - profile2)
print(list(diff))
assert diff.all_lt(1e-5)