path = "/home/upc86896/Data/Data/i04-BAG-training/dials_processed/"

    experiment_list_filename = join(path, "experiments.json")

    if len(sys.argv) > 1:
        nproc = int(sys.argv[1])
    else:
        nproc = 1

    print("Reading Experiments")
    from math import pi

    experiments = ExperimentListFactory.from_json_file(
        experiment_list_filename)

    profile_model = ProfileModelList()
    profile_model.append(
        ProfileModel(n_sigma=3,
                     sigma_b=0.024 * pi / 180,
                     sigma_m=0.044 * pi / 180))

    print("Predicting Reflections")
    rlist = flex.reflection_table.from_predictions(experiments[0])
    rlist["id"] = flex.int(len(rlist), 0)
    rlist.compute_bbox(experiments, profile_model)
    rlist.compute_zeta_multi(experiments)
    rlist.compute_d(experiments)
    print("")

    print("Creating params")
    from dials.algorithms.integration.integrator import IntegratorFactory
  from os.path import join
  # path = '/home/upc86896/Projects/cctbx/sources/dials_regression/centroid_test_data'
  path = '/home/upc86896/Data/Data/i04-BAG-training/dials_processed/'

  experiment_list_filename = join(path, "experiments.json")

  if len(sys.argv) > 1:
    nproc = int(sys.argv[1])
  else:
    nproc = 1

  print "Reading Experiments"
  from math import pi
  experiments = ExperimentListFactory.from_json_file(experiment_list_filename)

  profile_model = ProfileModelList()
  profile_model.append(ProfileModel(
    n_sigma=3,
    sigma_b=0.024*pi/180,
    sigma_m=0.044*pi/180))


  print "Predicting Reflections"
  rlist = flex.reflection_table.from_predictions(experiments[0])
  rlist['id'] = flex.int(len(rlist), 0)
  rlist.compute_bbox(experiments, profile_model)
  rlist.compute_zeta_multi(experiments)
  rlist.compute_d(experiments)
  print ""

  print "Creating params"
    dials_regression = libtbx.env.dist_path('dials_regression')
  except KeyError, e:
    print 'FAIL: dials_regression not configured'
    exit(0)
  path = join(dials_regression, "centroid_test_data")
  import sys
  assert(len(sys.argv) == 1)
  sys.argv.append(join(path, "experiments.json"))
  sys.argv.append(join(path, "profile.phil"))

  parser = OptionParser(phil=phil_scope)
  params, options, args = parser.parse_args()
  assert(len(args) == 1)

  exlist = ExperimentListFactory.from_json_file(args[0])
  assert(len(exlist) == 1)


  profile_model = ProfileModelList.load(params)

  rlist = flex.reflection_table.from_predictions_multi(exlist)
  rlist.compute_bbox(exlist, profile_model)
  rlist['shoebox'] = flex.shoebox(rlist['panel'], rlist['bbox'])
  rlist['shoebox'].allocate()

  rlist.extract_shoeboxes(exlist[0].imageset)

  show_reflection(rlist[len(rlist)//2])
  #show_reflection(rlist[len(rlist)//2], orient = "porTrait")
  #show_reflection(rlist[len(rlist)//2], orient = "lanDscape")
Example #4
0
        dials_regression = libtbx.env.dist_path("dials_regression")
    except KeyError as e:
        print("FAIL: dials_regression not configured")
        exit(0)
    path = join(dials_regression, "centroid_test_data")
    import sys

    assert len(sys.argv) == 1
    sys.argv.append(join(path, "experiments.json"))
    sys.argv.append(join(path, "profile.phil"))

    parser = OptionParser(phil=phil_scope)
    params, options, args = parser.parse_args()
    assert len(args) == 1

    exlist = ExperimentListFactory.from_json_file(args[0])
    assert len(exlist) == 1

    profile_model = ProfileModelList.load(params)

    rlist = flex.reflection_table.from_predictions_multi(exlist)
    rlist.compute_bbox(exlist, profile_model)
    rlist["shoebox"] = flex.shoebox(rlist["panel"], rlist["bbox"])
    rlist["shoebox"].allocate()

    rlist.extract_shoeboxes(exlist[0].imageset)

    show_reflection(rlist[len(rlist) // 2])
    # show_reflection(rlist[len(rlist)//2], orient = "porTrait")
    # show_reflection(rlist[len(rlist)//2], orient = "lanDscape")