Beispiel #1
0
EDFactoryPluginStatic.loadModule("EDPluginExecMeasureOffsetv1_0")
EDFactoryPluginStatic.loadModule("EDPluginExecShiftImagev1_0")
EDFactoryPluginStatic.loadModule("EDPluginHDF5StackImagesv10")
from EDPluginHDF5 import EDPluginHDF5

################################################################################
# AutoBuilder for Numpy, PIL and Fabio
################################################################################
architecture = EDUtilsPlatform.architecture
fabioPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "FabIO-0.0.7",
                         architecture)
imagingPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                           "20091115-PIL-1.1.7", architecture)
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                         "20090405-Numpy-1.3", architecture)
Image = EDFactoryPluginStatic.preImport("Image", imagingPath)
numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath)
fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath)

EDVerbose.setTestOff()


class EDPluginControlAlignStackv1_0(EDPluginControl):
    """
    This control plugin aligns a stack on images in a single HDF5 3D-structure 
    """
    __iRefFrame = None
    __dictRelShift = {
    }  #key=frame number N, value= 2-tuple of shift relative to frame N-1
    __dictAbsShift = {
    }  #key=frame number N, value= 2-tuple of shift relative to frame iRefFrame
Beispiel #2
0
from EDUtilsPath import EDUtilsPath
from EDUtilsPlatform import EDUtilsPlatform
from EDUtilsArray import EDUtilsArray
edFactoryPlugin.loadModule("XSDataBioSaxsv1_0")
edFactoryPlugin.loadModule("XSDataSAS")
edFactoryPlugin.loadModule("XSDataWaitFilev1_0")
edFactoryPlugin.loadModule("XSDataExecCommandLine")
from XSDataBioSaxsv1_0 import XSDataInputBioSaxsToSASv1_0, XSDataResultBioSaxsToSASv1_0
from XSDataSAS import XSDataInputSolutionScattering
from XSDataWaitFilev1_0 import XSDataInputWaitFile
from XSDataExecCommandLine import XSDataInputRsync
from XSDataCommon import XSDataInteger, XSDataDouble, XSDataString, XSDataFile, XSPluginItem
architecture = EDUtilsPlatform.architecture
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                         "20090405-Numpy-1.3", architecture)
numpy = edFactoryPlugin.preImport("numpy", numpyPath)


class EDPluginBioSaxsToSASv1_0(EDPluginControl):
    """
	This is basically just a wrapper for Irakli's SAS pipeline, but with parameters optimized for ESRF
    """
    CONF_MAX_THREAD = "maxThreads"
    CONF_FILE_SIZE = "fileSize"
    size = None
    maxThreads = None

    __strControlledPluginWait = "EDPluginWaitFile"
    __strControlledPluginSAS = "EDPluginControlSolutionScatteringv0_4"
    __strControlledPluginRsync = "EDPluginExecRsync"
from EDUtilsPath        import EDUtilsPath
from EDThreading import Semaphore
from XSDataShiftv1_0    import XSDataInputShiftImage, XSDataResultShiftImage
from XSDataCommon       import XSDataImageExt, XSDataString, XSPluginItem
from EDShare import EDShare

################################################################################
# AutoBuilder for Numpy, PIL and Fabio
################################################################################
architecture = EDUtilsPlatform.architecture
fabioPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "FabIO-0.0.7", architecture)
imagingPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20091115-PIL-1.1.7", architecture)
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090405-Numpy-1.3", architecture)
scipyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090711-SciPy-0.7.1", architecture)

numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath)
scipy = EDFactoryPluginStatic.preImport("scipy", scipyPath)
EDFactoryPluginStatic.preImport("Image", imagingPath)
fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath)


try:
    from fabio.edfimage import edfimage
    import  scipy.ndimage
except Exception:
    EDVerbose.ERROR("Error in loading numpy, Scipy, PIL or Fabio,\n\
    Please re-run the test suite for EDTestSuitePluginExecShift \
    to ensure that all modules are compiled for you computer as they don't seem to be installed")


class EDPluginExecShiftImagev1_1(EDPluginExec):
from EDConfiguration        import EDConfiguration
from EDUtilsPath            import EDUtilsPath
from EDUtilsPlatform        import EDUtilsPlatform
from EDUtilsArray           import EDUtilsArray
edFactoryPlugin.loadModule("XSDataBioSaxsv1_0")
edFactoryPlugin.loadModule("XSDataSAS")
edFactoryPlugin.loadModule("XSDataWaitFilev1_0")
edFactoryPlugin.loadModule("XSDataExecCommandLine")
from XSDataBioSaxsv1_0      import XSDataInputBioSaxsToSASv1_0, XSDataResultBioSaxsToSASv1_0
from XSDataSAS              import XSDataInputSolutionScattering
from XSDataWaitFilev1_0     import XSDataInputWaitFile
from XSDataExecCommandLine  import XSDataInputRsync
from XSDataCommon           import XSDataInteger, XSDataDouble, XSDataString, XSDataFile, XSPluginItem
architecture = EDUtilsPlatform.architecture
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090405-Numpy-1.3", architecture)
numpy = edFactoryPlugin.preImport("numpy", numpyPath)



class EDPluginBioSaxsToSASv1_0(EDPluginControl):
    """
	This is basically just a wrapper for Irakli's SAS pipeline, but with parameters optimized for ESRF
    """
    CONF_MAX_THREAD = "maxThreads"
    CONF_FILE_SIZE = "fileSize"
    size = None
    maxThreads = None

    __strControlledPluginWait = "EDPluginWaitFile"
    __strControlledPluginSAS = "EDPluginControlSolutionScatteringv0_4"
    __strControlledPluginRsync = "EDPluginExecRsync"
Beispiel #5
0
from EDVerbose                  import EDVerbose
from EDPlugin                   import EDPlugin
from EDUtilsPlatform            import EDUtilsPlatform
from EDConfiguration            import EDConfiguration
from EDFactoryPlugin            import edFactoryPlugin  as EDFactoryPluginStatic
from EDDecorator                import deprecated
from EDThreading                import Semaphore
from EDUtilsPath                import EDUtilsPath
architecture = EDUtilsPlatform.architecture
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090405-Numpy-1.3", architecture)
h5pyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "H5Py-1.3.0", architecture)
fabioPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "FabIO-0.0.7", architecture)
imagingPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20091115-PIL-1.1.7", architecture)

numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath, _strMethodVersion="__version__")
h5py = EDFactoryPluginStatic.preImport("h5py", h5pyPath, _strMethodVersion="version.api_version", _strForceVersion="1.8")
Image = EDFactoryPluginStatic.preImport("Image", imagingPath, _strMethodVersion="VERSION")
fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath, _strMethodVersion="version")

if h5py is None:
    EDVerbose.error("h5py is None ... please investigate why !!!")
    EDVerbose.writeErrorTrace()
#    raise ImportError("EDPluginHDF5 cannot work without h5py !!!")


if "EDNA_SITE" not in os.environ:
    os.environ["EDNA_SITE"] = "edna-site"


class EDPluginHDF5(EDPlugin):
Beispiel #6
0
import os
from StringIO import StringIO
from EDVerbose                 import EDVerbose
from EDUtilsFile               import EDUtilsFile
from EDPluginExecProcessScript import EDPluginExecProcessScript
from XSDataEdnaSaxs            import XSDataInputGnom, XSDataResultGnom
from XSDataCommon              import XSDataFile, XSDataString, XSDataDouble
from EDUtilsPlatform           import  EDUtilsPlatform
from EDUtilsPath               import EDUtilsPath
from EDUtilsArray import EDUtilsArray
from EDFactoryPlugin import edFactoryPlugin as EDFactoryPluginStatic
architecture = EDUtilsPlatform.architecture
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090405-Numpy-1.3", architecture)
matplotlibPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "Matplotlib-1.0.1", architecture)
numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath)
matplotlib = EDFactoryPluginStatic.preImport("matplotlib", matplotlibPath)
matplotlib.use('Agg')
pyplot = EDFactoryPluginStatic.preImport("matplotlib.pyplot", matplotlibPath)

class EDPluginExecGnomv0_2(EDPluginExecProcessScript):
    """
    Execution plugin for small  angle scattering data processing using GNOM
    """


    def __init__(self):
        """
        """
        EDPluginExecProcessScript.__init__(self)
        self.setXSDataInputClass(XSDataInputGnom)
Beispiel #7
0
from EDFactoryPlugin import edFactoryPlugin as EDFactoryPluginStatic
from EDDecorator import deprecated
from EDThreading import Semaphore
from EDUtilsPath import EDUtilsPath
architecture = EDUtilsPlatform.architecture
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                         "20090405-Numpy-1.3", architecture)
h5pyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "H5Py-1.3.0",
                        architecture)
fabioPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "FabIO-0.0.7",
                         architecture)
imagingPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                           "20091115-PIL-1.1.7", architecture)

numpy = EDFactoryPluginStatic.preImport("numpy",
                                        numpyPath,
                                        _strMethodVersion="__version__")
h5py = EDFactoryPluginStatic.preImport("h5py",
                                       h5pyPath,
                                       _strMethodVersion="version.api_version",
                                       _strForceVersion="1.8")
Image = EDFactoryPluginStatic.preImport("Image",
                                        imagingPath,
                                        _strMethodVersion="VERSION")
fabio = EDFactoryPluginStatic.preImport("fabio",
                                        fabioPath,
                                        _strMethodVersion="version")

if h5py is None:
    EDVerbose.error("h5py is None ... please investigate why !!!")
    EDVerbose.writeErrorTrace()
Beispiel #8
0
from StringIO import StringIO
from EDVerbose import EDVerbose
from EDUtilsFile import EDUtilsFile
from EDPluginExecProcessScript import EDPluginExecProcessScript
from XSDataEdnaSaxs import XSDataInputGnom, XSDataResultGnom
from XSDataCommon import XSDataFile, XSDataString, XSDataDouble
from EDUtilsPlatform import EDUtilsPlatform
from EDUtilsPath import EDUtilsPath
from EDFactoryPlugin import edFactoryPlugin as EDFactoryPluginStatic

architecture = EDUtilsPlatform.architecture
numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                         "20090405-Numpy-1.3", architecture)
matplotlibPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries",
                              "Matplotlib-1.0.1", architecture)
numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath)
matplotlib = EDFactoryPluginStatic.preImport("matplotlib", matplotlibPath)
matplotlib.use('Agg')
pyplot = EDFactoryPluginStatic.preImport("matplotlib.pyplot", matplotlibPath)


class EDPluginExecGnomv0_2(EDPluginExecProcessScript):
    """
    Execution plugin for small  angle scattering data processing using GNOM
    """
    def __init__(self):
        """
        """
        EDPluginExecProcessScript.__init__(self)
        self.setXSDataInputClass(XSDataInputGnom)
        self.fAngularScale = 1