コード例 #1
0
def main():
    print('foo')
    profile = False
    if len(sys.argv) > 1 and sys.argv[1] == '-p':
        print('profiling')
        profile = True
        from PYME.mProfile import mProfile
        mProfile.profileOn(
            ['taskServerMP.py', 'HDFTaskQueue.py', 'TaskQueue.py'])

    Pyro.config.PYRO_MOBILE_CODE = 0
    Pyro.core.initServer()
    ns = Pyro.naming.NameServerLocator().getNS()
    daemon = Pyro.core.Daemon()
    daemon.useNameServer(ns)  # useNameServer!

    #check to see if we've got the TaskQueues group
    if not 'TaskQueues' in [n[0] for n in ns.list('')]:
        ns.createGroup('TaskQueues')

    #get rid of any previous queue
    try:
        ns.unregister(taskQueueName)
    except Pyro.errors.NamingError:
        pass

    tq = TaskQueueSet()
    uri = daemon.connect(tq, taskQueueName)

    tw = TaskWatcher(tq)
    tw.start()
    try:
        print '> taskServer start ...'
        daemon.requestLoop(tq.isAlive)
    finally:
        daemon.shutdown(True)
        tw.alive = False

        if profile:
            mProfile.report()

        print '> taskServer shutdown'
コード例 #2
0
ファイル: taskServerMP.py プロジェクト: RuralCat/CLipPYME
def main():
    print('foo')
    profile = False
    if len(sys.argv) > 1 and sys.argv[1] == '-p':
        print('profiling')
        profile = True
        from PYME.mProfile import mProfile
        mProfile.profileOn(['taskServerMP.py', 'HDFTaskQueue.py', 'TaskQueue.py'])

    Pyro.config.PYRO_MOBILE_CODE = 0
    Pyro.core.initServer()
    ns=Pyro.naming.NameServerLocator().getNS()
    daemon=Pyro.core.Daemon()
    daemon.useNameServer(ns)        # useNameServer!

    #check to see if we've got the TaskQueues group
    if not 'TaskQueues' in [n[0] for n in ns.list('')]:
        ns.createGroup('TaskQueues')

    #get rid of any previous queue
    try:
        ns.unregister(taskQueueName)
    except Pyro.errors.NamingError:
        pass

    tq = TaskQueueSet()
    uri=daemon.connect(tq,taskQueueName)

    tw = TaskWatcher(tq)
    tw.start()
    try:
        print '> taskServer start ...'
        daemon.requestLoop(tq.isAlive)
    finally:
        daemon.shutdown(True)
        tw.alive = False
        
        if profile:
            mProfile.report()
        
        print '> taskServer shutdown'
コード例 #3
0
ファイル: PYMEAcquire.py プロジェクト: RuralCat/CLipPYME
class BoaApp(wx.App):
    def __init__(self, options, *args):
        self.options = options
        wx.App.__init__(self, *args)
        
        
    def OnInit(self):
        wx.InitAllImageHandlers()
        self.main = acquiremainframe.create(None, self.options)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True


def main():
    from optparse import OptionParser

    parser = OptionParser()
    parser.add_option("-i", "--init-file", dest="initFile", help="Read initialisation from file [defaults to init.py]", metavar="FILE")
        
    (options, args) = parser.parse_args()
    
    application = BoaApp(options, 0)
    application.MainLoop()

if __name__ == '__main__':
    from PYME import mProfile
    mProfile.profileOn(['previewacquisator.py'])
    main()
    mProfile.report()
コード例 #4
0
ファイル: test_block_dec.py プロジェクト: RuralCat/CLipPYME
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#
################
__test__ = False
if __name__ == '__main__':
    from PYME import mProfile
    mProfile.profileOn(['tq_block_dec.py', 'dec.py'])
    
    from PYME.DSView import View3D, ViewIm3D
    from PYME.DSView.image import ImageStack
    
    image = ImageStack(filename = '/data/zar_cropped.tif')
    
    data = image.data[:,:,:]
    psf, vs = np.load('/home/david/Desktop/id.psf')
    import Pyro.core
    import os
    tq = Pyro.core.getProxyForURI('PYRONAME://' + os.environ['PYME_TASKQUEUENAME'])
    from PYME.Deconv import tq_block_dec
    bd = tq_block_dec.blocking_deconv(tq, data, psf, 'foo', blocksize={'y': 128, 'x': 128, 'z': 256}, blockoverlap={'y': 10, 'x': 10, 'z': 50})
    bd.go()
    #bd.push_deconv_tasks()
コード例 #5
0
    def OnInit(self):
        wx.InitAllImageHandlers()
        self.main = acquiremainframe.create(None, self.options)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True


def main():
    from optparse import OptionParser

    parser = OptionParser()
    parser.add_option(
        "-i",
        "--init-file",
        dest="initFile",
        help="Read initialisation from file [defaults to init.py]",
        metavar="FILE")

    (options, args) = parser.parse_args()

    application = BoaApp(options, 0)
    application.MainLoop()


if __name__ == '__main__':
    from PYME import mProfile
    mProfile.profileOn(['previewacquisator.py'])
    main()
    mProfile.report()