Exemplo n.º 1
0
    def AI_func():
        from pyFAI.detectors import Pilatus2M
        from pyFAI import AzimuthalIntegrator, units

        return AzimuthalIntegrator(
            0.283, 5.24e-3, 4.085e-3, 0, 0, 0, 1.72e-4, 1.72e-4, detector=Pilatus2M(), wavelength=1.23984e-10
        )
Exemplo n.º 2
0
def test_SAXSWorkflow():
    # create processes
    thresholdmask = ThresholdMaskPlugin()
    qintegrate = QIntegratePlugin()

    # set values
    AI = AzimuthalIntegrator(.283,
                             5.24e-3,
                             4.085e-3,
                             0,
                             0,
                             0,
                             1.72e-4,
                             1.72e-4,
                             detector=Pilatus2M(),
                             wavelength=1.23984e-10)
    thresholdmask.data.value = fabio.open(
        '/Users/hari/Downloads/AGB_5S_USE_2_2m.edf').data

    def AI_func():
        from pyFAI.detectors import Pilatus2M
        from pyFAI import AzimuthalIntegrator, units
        return AzimuthalIntegrator(.283,
                                   5.24e-3,
                                   4.085e-3,
                                   0,
                                   0,
                                   0,
                                   1.72e-4,
                                   1.72e-4,
                                   detector=Pilatus2M(),
                                   wavelength=1.23984e-10)

    qintegrate.integrator.value = AI_func
    qintegrate.npt.value = 1000
    thresholdmask.minimum.value = 30
    thresholdmask.maximum.value = 1e12

    qintegrate.data.value = fabio.open(
        '/Users/hari/Downloads/AGB_5S_USE_2_2m.edf').data
    thresholdmask.neighborhood.value = 1
    qintegrate.normalization_factor.value = 0.5
    qintegrate.method.value = "numpy"

    # connect processes
    thresholdmask.mask.connect(qintegrate.mask)

    # add processes to workflow
    wf = Workflow('QIntegrate')
    wf.addProcess(thresholdmask)
    wf.addProcess(qintegrate)

    dsk = DaskExecutor()
    result = dsk.execute(wf)
    print(result)
Exemplo n.º 3
0
def test_autoconnect():
    # create processes
    thresholdmask = ThresholdMaskPlugin()
    qintegrate = QIntegratePlugin()

    # set values
    AI = AzimuthalIntegrator(
        0.283, 5.24e-3, 4.085e-3, 0, 0, 0, 1.72e-4, 1.72e-4, detector=Pilatus2M(), wavelength=1.23984e-10
    )
    thresholdmask.data.value = fabio.open("/Users/hari/Downloads/AGB_5S_USE_2_2m.edf").data
    qintegrate.integrator.value = AI
    qintegrate.npt.value = 1000
    thresholdmask.minimum.value = 30
    thresholdmask.maximum.value = 1e12
Exemplo n.º 4
0
def test_Detector_pickle():
    import cloudpickle
    import numpy as np
    from pyFAI.detectors import Pilatus2M
    det = Pilatus2M()

    print(det, type(det))

    # print(det.__reduce__())
    # print(det.__getnewargs_ex__())
    # print(det.__getstate__())

    assert dumps(det)
    assert loads(dumps(det))
    assert loads(dumps(det)).shape == (1679, 1475)