Exemple #1
0
    P.init.Nabc = SIM.crystal.Ncells_abc

if "detz_shift" in args.perturb:
    P.init.detz_shift = 1
else:
    P.init.detz_shift = 0

if "eta" in args.perturb:
    P.init.eta_abc = [0.12, 0.13, 0.14]
    P.simulator.crystal.num_mosaicity_samples = 250  # in practive, the number of mosaic domains we model should be smaller than whats in the crystal .. .
    P.simulator.crystal.has_isotropic_mosaicity = False
    P.fix.eta_abc = False

E.detector = SIM.detector
E.beam = SIM.D.beam
E.imageset = make_imageset([img], E.beam, E.detector)
#refls = utils.refls_from_sims([img], E.detector, E.beam, thresh=18)
refls = utils.refls_from_sims([spots], E.detector, E.beam, thresh=18)
print("%d REFLS" % len(refls))
utils.refls_to_q(refls, E.detector, E.beam, update_table=True)
utils.refls_to_hkl(refls, E.detector, E.beam, E.crystal, update_table=True)

P.roi.shoebox_size = 20
P.relative_tilt = False
P.roi.fit_tilt = False
P.roi.pad_shoebox_for_background_estimation = 10
P.roi.reject_edge_reflections = False
P.refiner.sigma_r = SIM.D.readout_noise_adu
P.refiner.adu_per_photon = SIM.D.quantum_gain
P.simulator.init_scale = 1  #SIM.D.spot_scale
P.simulator.beam.size_mm = SIM.beam.size_mm
Exemple #2
0
for i in range(N):
    iset = isets[i]
    path = iset.get_path(0)
    d = df2_filt0.query("imgpaths=='%s'" % path)
    if has_master:
        master_index = iset.indices()[0]
        d = d.query("master_indices==%d" % master_index)
    if len(d) != 1:
        continue
    A = d.Amats.values[0]
    #break
    C = deepcopy(crystals[i])
    #C.set_A(A)
    Ex = Experiment()
    Ex.crystal = C
    Ex.imageset = iset
    Ex.beam = beams[i]
    Ex.detector = D
    El2.append(Ex)

    Rsel = R.select(R['id']==i)
    nref = len(Rsel)
    Rsel['id'] = flex.int(nref, new_id)
    R2.extend(Rsel)
    new_id += 1
    print (new_id)

el_file = "%s.expt" % args.tag
R_file = "%s.refl" % args.tag
El2.as_file(el_file)
print("Saved experiment %s" % el_file )