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
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
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
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): 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
def _configure(self): AbstractComponent._configure(self) return
def _configure(self): AbstractComponent._configure(self) self.xml = self.inventory.xml return
def _init(self): AbstractComponent._init(self) self.engine = enginefactory(self.name) return
def __init__(self, name): AbstractComponent.__init__(self, name) self.engine = None return
def _configure(self): AbstractComponent._configure(self) self.path = self.inventory.path return
def _init(self): AbstractComponent._init(self) if self._showHelpOnly: return self.engine = enginefactory( self.name, self.path ) return