def _configure(self):
        AbstractComponent._configure(self)
        velocity = self.inventory.velocity
        assert len(velocity) == 3
        self.velocity = velocity

        energy = self.inventory.energy
        if energy:
            from mcni.utils.conversion import e2v
            v = e2v(energy)
            import numpy.linalg as nl, numpy as np
            norm = nl.norm(velocity)
            velocity = np.array(velocity)
            velocity *= v / norm
            self.velocity = velocity

        energy_width = self.inventory.energy_width
        if energy_width < 0:
            raise ValueError, "energy width must be not negative"
        self.energy_width = energy_width

        position = self.inventory.position
        assert len(position) == 3
        self.position = position

        self.width = self.inventory.width
        self.height = self.inventory.height

        self.time = self.inventory.time
        self.probability = self.inventory.probability
        return
    def _configure(self):
        AbstractComponent._configure(self)
        velocity =  self.inventory.velocity
        assert len(velocity)==3
        self.velocity = velocity

        energy = self.inventory.energy
        if energy:
            from mcni.utils.conversion import e2v
            v = e2v(energy)
            import numpy.linalg as nl, numpy as np
            norm = nl.norm(velocity)
            velocity = np.array(velocity)
            velocity *= v/norm
            self.velocity = velocity

        energy_width = self.inventory.energy_width
        if energy_width < 0:
            raise ValueError, "energy width must be not negative"
        self.energy_width = energy_width
            
        position = self.inventory.position
        assert len(position)==3
        self.position = position
        
        self.width = self.inventory.width
        self.height = self.inventory.height

        self.time = self.inventory.time
        self.probability = self.inventory.probability
        return
 def _init(self):
     AbstractComponent._init(self)
     if self._showHelpOnly: return
     if self.xml:
         self.engine = enginefactory(self.name, self.xml)
     else:
         self.engine = None
     return
 def _init(self):
     AbstractComponent._init(self)
     if self._showHelpOnly: return
     if self.xml:
         self.engine = enginefactory(
             self.name, self.xml)
     else:
         self.engine = None
     return
    def _configure(self):
        AbstractComponent._configure(self)
        Ei = self.inventory.Ei
        E = self.inventory.E
        Q = self.inventory.Q
        L1 = self.inventory.L1

        self.engine = enginefactory(self.name, Q, E, Ei, L1)
        return
示例#6
0
    def _configure(self):
        AbstractComponent._configure(self)
        tofparams = eval( self.inventory.tofparams )
        assert len(tofparams)==3
        self.tofparams = tofparams

        self.instrumentxml = self.inventory.instrumentxml
        self.eventsdat = self.inventory.eventsdat
        return
    def _configure(self):
        AbstractComponent._configure(self)
        Ei = self.inventory.Ei
        E = self.inventory.E
        Q = self.inventory.Q
        L1 = self.inventory.L1

        self.engine = enginefactory( self.name, Q, E, Ei, L1 )
        return
    def _configure(self):
        AbstractComponent._configure(self)
        tofparams = eval(self.inventory.tofparams)
        assert len(tofparams) == 3
        self.tofparams = tofparams

        self.instrumentxml = self.inventory.instrumentxml
        self.eventsdat = self.inventory.eventsdat
        return
示例#9
0
 def _configure(self):
     AbstractComponent._configure(self)
     self.eventsdat = self.inventory.eventsdat
     self.xmin = self.inventory.xmin
     self.xmax = self.inventory.xmax
     self.nx = self.inventory.nx
     self.ymin = self.inventory.ymin
     self.ymax = self.inventory.ymax
     self.ny = self.inventory.ny
     self.tofmin = self.inventory.tofmin
     self.tofmax = self.inventory.tofmax
     self.ntof = self.inventory.ntof
     return
示例#10
0
 def _init(self):
     AbstractComponent._init(self)
     from math import pi
     si = self.inventory
     self.engine = enginefactory(
         self.name,
         si.radius1, si.height1,
         si.radius2, si.height2,
         si.theta1/180*pi, si.theta2/180*pi,
         si.dtheta/180*pi, 
         si.oscillation/180*pi,
         )
     return
 def _init(self):
     AbstractComponent._init(self)
     from mcni import neutron
     self.neutron = neutron(
         r = self.position, v = self.velocity,
         time = self.time, prob = self.probability,
         )
     self.engine = enginefactory( 
         self.name, self.neutron,
         dx = self.width, dy = self.height,
         dE = self.energy_width,
         )
     return
示例#12
0
 def _init(self):
     AbstractComponent._init(self)
     from math import pi
     si = self.inventory
     self.engine = enginefactory(
         self.name,
         si.radius1,
         si.height1,
         si.radius2,
         si.height2,
         si.theta1 / 180 * pi,
         si.theta2 / 180 * pi,
         si.dtheta / 180 * pi,
         si.oscillation / 180 * pi,
     )
     return
 def _init(self):
     AbstractComponent._init(self)
     from mcni import neutron
     self.neutron = neutron(
         r=self.position,
         v=self.velocity,
         time=self.time,
         prob=self.probability,
     )
     self.engine = enginefactory(
         self.name,
         self.neutron,
         dx=self.width,
         dy=self.height,
         dE=self.energy_width,
     )
     return
 def __init__(self, name="fixedqe"):
     AbstractComponent.__init__(self, name)
     return
示例#15
0
 def _configure(self):
     AbstractComponent._configure(self)
     return
 def __init__(self, name="fixedqe"):
     AbstractComponent.__init__(self, name)
     return
 def _configure(self):
     AbstractComponent._configure(self)
     self.xml = self.inventory.xml
     return
示例#18
0
 def _init(self):
     AbstractComponent._init(self)
     self.engine = enginefactory(self.name)
     return
 def _configure(self):
     AbstractComponent._configure(self)
     self.xml = self.inventory.xml
     return
示例#20
0
 def __init__(self, name):
     AbstractComponent.__init__(self, name)
     self.engine = None
     return
示例#21
0
 def _configure(self):
     AbstractComponent._configure(self)
     self.path = self.inventory.path
     return
示例#22
0
 def __init__(self, name):
     AbstractComponent.__init__(self, name)
     self.engine = None
     return
示例#23
0
 def _init(self):
     AbstractComponent._init(self)
     if self._showHelpOnly: return
     self.engine = enginefactory( self.name, self.path )
     return
示例#24
0
 def _configure(self):
     AbstractComponent._configure(self)
     return
示例#25
0
 def _init(self):
     AbstractComponent._init(self)
     self.engine = enginefactory(self.name)
     return