Beispiel #1
0
        data = data_[inds]

    # physics
    theta = 15
    psize = 55e-6
    distance = .320
    hc = 4.136e-15 * 3.000e8
    E = 10000.
    Q12 = psize * 2 * np.pi / distance / (hc / E) * data.shape[-1]
    Q3 = Q12 / 150 * 30 # first minimum is around 30 pixels across, so Nj=30 should give a 1:1 aspect ratio with the first minimum on the q3 edges
    dq3 = Q3 / Nj
    Dmax = 60e-9

    # do the assembly, plotting on each iteration
    data, rolls = pre_align_rolls(data, roll_center=CENTER)
    envelope = generate_envelope(Nj, data.shape[-1], Q=(Q3, Q12, Q12), Dmax=(Dmax, 1, 1), theta=theta)
    W = generate_initial(data, Nj)
    p = ProgressPlot()
    errors = []
    for i in range(60):
        print(i)
        W, Pjlk, timing = M(W, data, Nl=Nl, ml=ml, beta=fudge,
                            nproc=24,
                            roll_center=CENTER)
        [print(k, '%.3f'%v) for k, v in timing.items()]
        W, error = C(W, envelope)
        errors.append(error)
        p.update(np.log10(W), Pjlk, errors, vmax=1)

        # expand the resolution now and then
        if i and (Nj<Nj_max) and (i % increase_every) == 0:
Beispiel #2
0
    hc = 4.136e-15 * 3.000e8
    theta = np.arcsin(hc / (2 * d * E)) / np.pi * 180
    psize = 55e-6
    distance = .25
    # detector plane: dq = |k| * dtheta(pixel-pixel)
    Q12 = psize * 2 * np.pi / distance / (hc / E) * data.shape[-1]
    Q3 = Q12 / 128 * 25  # about the same Q range as the first in-plane minimum
    dq3 = Q3 / Nj
    Dmax = 60e-9
    print('%e %e' % (Q3, Q12))

    # do the assembly, plotting on each iteration
    data, rolls = pre_align_rolls(data, roll_center=None)
    envelope1 = generate_envelope(Nj,
                                  data.shape[-1],
                                  Q=(Q3, Q12, Q12),
                                  Dmax=(Dmax, 1, 1),
                                  theta=theta)
    envelope2 = generate_envelope(Nj, data.shape[-1], support=(1, .25, .25))
    W = generate_initial(data, Nj)
    p = ProgressPlot()
    errors = []
    for i in range(100):
        print(i)
        W, Pjlk, timing = M(W,
                            data,
                            Nl=Nl,
                            ml=ml,
                            beta=fudge,
                            force_continuity=(6 if i < 50 else 10),
                            nproc=24,