当前位置: 首页>>代码示例>>Python>>正文


Python Instrument.Instrument类代码示例

本文整理汇总了Python中mcni.pyre_support.Instrument.Instrument的典型用法代码示例。如果您正苦于以下问题:Python Instrument类的具体用法?Python Instrument怎么用?Python Instrument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Instrument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _defaults

    def _defaults(self):
        base._defaults(self)
        # serial mode
        self.inventory.mode = 'worker'
        from mcni.pyre_support.LauncherSerial import LauncherSerial
        self.inventory.launcher = LauncherSerial()

        self.inventory.sequence = ['source', 'verifier']
        
        geometer = self.inventory.geometer
        self.inventory.geometer.inventory.source = (0,0,0), (0,0,0)
        self.inventory.geometer.inventory.verifier = (0,0,0), (0,0,0)

        storage = self.inventory.source
        #the path where neutrons were saved in the simulation
        #of Instrument1
        path = os.path.join(instrument1_outputpath, neutron_storage_path )
        storage.inventory.path = path
        return
开发者ID:mcvine,项目名称:mcvine,代码行数:19,代码来源:EventAreaMonitor_TestCase.py

示例2: _defaults

        def _defaults(self):
            base._defaults(self)

            self.inventory.overwrite_datafiles = True
            
            self.inventory.sequence = ['source', 'monitor']
            geometer = self.inventory.geometer
            geometer.inventory.monitor = (0,0,1), (0,0,0)

            source = self.inventory.source
            # dimension of source
            source.inventory.radius= 0.1
            # distance from source to target
            source.inventory.dist = 1. # should match monitor position
            # target dimension
            source.inventory.xw = 0.1 
            source.inventory.yh = 0.1
            # energy distibution
            # gaussian distibution
            source.inventory.gauss = 1
            source.inventory.E0 = source_E0
            source.inventory.dE = source_dE
            
            monitor = self.inventory.monitor
            # dimension
            monitor.inventory.xwidth = -0.1
            monitor.inventory.yheight = 0.1
            # 
            monitor.inventory.Emin = monitor_Emin
            monitor.inventory.Emax = monitor_Emax
            monitor.inventory.nchan = monitor_N
            
            return
开发者ID:mcvine,项目名称:resources-old,代码行数:33,代码来源:SourceMonitorInstrumentModel.py

示例3: _defaults

 def _defaults(self):
     base._defaults(self)
     self.inventory.mode = "worker"
     self.inventory.sequence = ["source", "verifier"]
     geometer = self.inventory.geometer
     self.inventory.geometer.inventory.verifier = (0, 0, 1), (0, 0, 90)
     return
开发者ID:mcvine,项目名称:mcvine,代码行数:7,代码来源:ConsoleNeutronTracer_TestCase.py

示例4: _defaults

 def _defaults(self):
     base._defaults(self)
     self.inventory.sequence = ['source', 'sample', 'monitor']
     geometer = self.inventory.geometer
     geometer.inventory.sample = (0,0,1), (0,0,0)
     geometer.inventory.monitor = (0,0,1), (0,0,0)
     return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:7,代码来源:vanadium_example.py

示例5: main

    def main(self):
        base.main(self)

        neutrons = {}
        
        #get neutrons from other nodes
        from mcni.neutron_storage import neutrons_from_npyarr as a2n, neutrons_as_npyarr as n2a, ndblsperneutron
        from mcni.utils.mpi import rank as mpirank, send, receive, world
        
        tag = 999
        if mpirank != 0:
            arr = n2a( self.inventory.recorder.neutrons )
            print "Node %s: sending array of shape %s" % (mpirank, arr.shape,)
            send(arr , 0, tag )
        else:
            for peer in range(1, world.size):
                arr = receive( peer, tag )
                arr.shape = -1, ndblsperneutron
                neutrons[ peer ] = a2n( arr )
                print "Node %s: received array of shape %s" % (mpirank, arr.shape)
                continue
            neutrons[ 0] = self.inventory.recorder.neutrons

        #compare
        if mpirank == 0:
            for peer in range(1, world.size):
                assert neutrons[0][0].state.velocity[2] != neutrons[peer][0].state.velocity[2]
                continue
        return
开发者ID:mcvine,项目名称:mcvine,代码行数:29,代码来源:parallel_simulation_demoapp.py

示例6: _defaults

 def _defaults(self):
     base._defaults(self)
     self.inventory.mode = 'worker'
     from mcni.pyre_support.LauncherSerial import LauncherSerial
     self.inventory.launcher = LauncherSerial()
     self.inventory.sequence = ['source', 'verifier']
     geometer = self.inventory.geometer
     self.inventory.geometer.inventory.verifier = (0,0,1), (0,0,90)
     return
开发者ID:mcvine,项目名称:mcvine,代码行数:9,代码来源:Instrument_TestCase.py

示例7: _defaults

    def _defaults(self):
        base._defaults(self)
        self.inventory.sequence = ['source', 'monitor']

        from mcstas2.pyre_support import componentfactory as factory
        self.inventory.source = factory('sources', 'Source_simple')('source')
        self.inventory.monitor = factory('monitors', 'E_monitor')('monitor')

        # print self.inventory.source
        
        geometer = self.inventory.geometer

        geometer.inventory.monitor = (0,0,1), (0,0,0)

        return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:15,代码来源:componentfactory_TestCase.py

示例8: _defaults

 def _defaults(self):
     base._defaults(self)
     self.inventory.mode = 'worker'
     from mcni.pyre_support.LauncherSerial import LauncherSerial
     self.inventory.launcher = LauncherSerial()
     self.inventory.sequence = ['source', 'counter']
     geometer = self.inventory.geometer
     self.inventory.geometer.inventory.source = (0,0,0), (0,0,0)
     
     self.inventory.multiple_scattering = 1
     self.inventory.buffer_size = ncount
     self.inventory.ncount = ncount
     
     self.inventory.overwrite_datafiles = True
     return
开发者ID:mcvine,项目名称:mcvine,代码行数:15,代码来源:multiple_scattering_Instrument_TestCase.py

示例9: _defaults

    def _defaults(self):
        base._defaults(self)
        self.inventory.sequence = [
            'source', 'validator1', 'monitor', 'validator2']
        self.inventory.outputdir = 'restore_neutrons_TestCase-out'
        self.inventory.ncount = 5
        self.inventory.buffer_size = 5
        self.inventory.overwrite_datafiles = 1

        geometer = self.inventory.geometer
        geometer.inventory.monitor = (0,0,1), (0,0,0)
        
        monitor = self.inventory.monitor
        monitor.inventory.restore_neutron = 1

        self.inventory.validator1 = Validator('validator1', 'validator')
        self.inventory.validator2 = Validator('validator2', 'validator')
        return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:18,代码来源:restore_neutrons_TestCase.py

示例10: _defaults

    def _defaults(self):
        base._defaults(self)
        self.inventory.sequence = ['source', 'detector']

        geometer = self.inventory.geometer
        geometer.inventory.source = (0,0,mod2sample), (0,0,0)
        geometer.inventory.detector = (0,0,mod2sample), (0,0,0)

        source = self.inventory.source
        source.inventory.Ei = Ei
        source.inventory.E = E
        source.inventory.Q = Q
        source.inventory.L1 = mod2sample

        detector = self.inventory.detector
        detector.inventory.eventsdat = eventsdat
        detector.inventory.instrumentxml = instrumentxml
        detector.inventory.tofparams = str(tofparams)
        return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:19,代码来源:FixedQE.py

示例11: _defaults

    def _defaults(self):
        base._defaults(self)
        # serial mode
        self.inventory.mode = 'worker'
        from mcni.pyre_support.LauncherSerial import LauncherSerial
        self.inventory.launcher = LauncherSerial()

        self.inventory.sequence = ['source', 'storage']
        
        geometer = self.inventory.geometer
        self.inventory.geometer.inventory.source = (0,0,0), (0,0,0)
        self.inventory.geometer.inventory.storage = (0,0,1), (0,0,0)

        source = self.inventory.source
        source.inventory.position = '0,0,0'
        source.inventory.velocity = '1000,2000,3000'

        storage = self.inventory.storage
        storage.inventory.path = neutron_storage_path
        return
开发者ID:mcvine,项目名称:mcvine,代码行数:20,代码来源:neutron_storage_TestCase.py

示例12: _defaults

 def _defaults(self):
     
     base._defaults(self)
     
     self.inventory.sequence = [            
         'source',
         'guide1',
         'guide2',
         'slit1',
         'slit2',
         'neutron_recorder',
         ]
     
     geometer = self.inventory.geometer
     geometer.inventory.source = (0,0,0), (0,0,0)
     geometer.inventory.guide2 = (0,0,5), (0,0,0)
     geometer.inventory.guide2 = (0,0,10), (0,0,0)
     geometer.inventory.slit1 = (0,0,29.0), (0,0,0)
     geometer.inventory.slit2 = (0,0,30.5), (0,0,0)
     geometer.inventory.neutron_recorder = (0,0,30.6), (0,0,0)
     return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:21,代码来源:SMARTS_Moderator2Sample.py

示例13: _defaults

    def _defaults(self):
        
        base._defaults(self)
        
        self.inventory.sequence = [
            
            'moderator',
            'core_vessel_insert',
            'shutter_guide',
            'guide1',
            
            't0_chopper',
            
            'guide2',
            
            'fermi_chopper',
            
            'guide3', 'guide4', 'guide5',
            
            'energy_monitor1', 'tof_monitor1',

            'neutron_recorder',
            ]
        
        geometer = self.inventory.geometer
        geometer.inventory.moderator = (0,0,0), (0,0,0)
        geometer.inventory.core_vessel_insert = (0,0,1.), (0,0,0)
        geometer.inventory.shutter_guide = (0,0, 2.2679), (0,0,0)
        geometer.inventory.guide1 = (0,0,4.179), (0,0,0)
        geometer.inventory.t0_chopper = (0,0,9.000), (0,0,0)
        geometer.inventory.guide2 =  (0,0,9.482), (0,0,0)
        geometer.inventory.fermi_chopper = (0,0,11.6), (0,0,0)
        geometer.inventory.guide3 = (0,0,11.815), (0,0,0)
        geometer.inventory.guide4 = (0,0,12.061), (0,0,0)
        geometer.inventory.guide5 = (0,0,13.017), (0,0,0)
        geometer.inventory.energy_monitor1 = (0,0,13.407), (0,0,0)
        geometer.inventory.tof_monitor1 = (0,0,13.407), (0,0,0)
        geometer.inventory.neutron_recorder = (0,0,13.45), (0,0,0)
        return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:39,代码来源:ARCS_Moderator2Sample.py

示例14: _defaults

    def _defaults(self):
        base._defaults(self)
        self.inventory.sequence = ['source', 'sample', 'detector']

        geometer = self.inventory.geometer
        geometer.inventory.source = (0,0,0), (0,0,0)
        geometer.inventory.sample = (0,0,mod2sample), (0,0,0)
        geometer.inventory.detector = (0,0,mod2sample), (0,0,0)

        source = self.inventory.source
        source.inventory.position = 0,0,0
        source.inventory.velocity = 0,0,vi
        source.inventory.probability = 1
        source.inventory.time = 0.0

        sample = self.inventory.sample
        sample.inventory.xml = 'Ni.xml'

        detector = self.inventory.detector
        detector.inventory.eventsdat = eventsdat
        detector.inventory.instrumentxml = instrumentxml
        detector.inventory.tofparams = str(tofparams)
        return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:23,代码来源:Nickel.py

示例15: _defaults

    def _defaults(self):
        base._defaults(self)
        
        self.inventory.sequence = ['source', 'monitor']
        
        geometer = self.inventory.geometer
        geometer.inventory.source = (0,0,0), (0,0,0)
        geometer.inventory.monitor = (0,0,10), (0,0,0)
        
        source = self.inventory.source
        source.inventory.dist = 10
        source.inventory.xw = 0.1
        source.inventory.yh = 0.1
        source.inventory.radius = 0.02
        source.inventory.E0 = 60
        source.inventory.dE = 5

        monitor = self.inventory.monitor
        monitor.inventory.Emin = 10
        monitor.inventory.Emax = 100
        monitor.inventory.nchan = 20
        monitor.inventory.xwidth = 0.1
        monitor.inventory.yheight = 0.1
        return
开发者ID:McStasMcXtrace,项目名称:MCViNE,代码行数:24,代码来源:Simple2.py


注:本文中的mcni.pyre_support.Instrument.Instrument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。