Beispiel #1
0
    wmax.tip = 'Maximum of wavelength, AA'
    wmax.help = wmax.tip

    nw = InvBase.d.int(name='nw', default=100, validator=InvBase.v.positive)
    nw.tip = 'Number of divisions in wavelength axes'
    nw.help = nw.tip

    xwidth = InvBase.d.float(name='xwidth',
                             default=0.770,
                             validator=InvBase.v.positive)
    xwidth.tip = 'Width of monitors, m'
    xwidth.help = xwidth.tip

    yheight = InvBase.d.float(name='yheight',
                              default=0.385,
                              validator=InvBase.v.positive)
    yheight.tip = 'Height of monitors, m'
    yheight.help = yheight.tip

    dbtablename = 'vulcandetectorsystems'


VulcanDetectorSystem.Inventory = Inventory
del Inventory

from _ import o2t, MonitorTableBase
VulcanDetectorSystemTable = o2t(VulcanDetectorSystem,
                                {'subclassFrom': MonitorTableBase})

__date__ = "$Mar 8, 2011 11:57:08 AM$"
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class NeutronsOnCone_FixedQE(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'neutronsoncone_fixedqe'


NeutronsOnCone_FixedQE.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
NeutronsOnCone_FixedQETable = o2t(NeutronsOnCone_FixedQE,
                                  {'subclassFrom': NeutronComponentTableBase})
Beispiel #3
0
    content = InvBase.d.str(name='content', max_length=65536)

    dbtablename = 'news'


News.Inventory = Inventory

from dsaw.db.WithID import WithID


class TableBase(WithID):

    import dsaw.db

    creator = dsaw.db.varchar(name='creator', length=64)

    time = dsaw.db.timestamp(name='time')
    time.meta['tip'] = 'time of creation'

    pass  # end of TableBase


from _ import o2t

NewsTable = o2t(News, {'subclassFrom': TableBase})

# version
__id__ = "$Id$"

# End of file
Beispiel #4
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class Monitor_4PI(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'monitor_4pi'

Monitor_4PI.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
Monitor_4PITable = o2t(Monitor_4PI, {'subclassFrom': NeutronComponentTableBase})
Beispiel #5
0
    height = InvBase.d.float(name='height', default=0.1)
    height.tip = 'height. unit: meter'

    innerradius = InvBase.d.float(name='innerradius', default=0.0)
    innerradius.tip = 'innerradius. unit: meter'

    outerradius = InvBase.d.float(name='outerradius', default=0.002)
    outerradius.tip = 'outerradius. unit: meter'


Cylinder.Inventory = Inventory
del Inventory

from _ import o2t
CylinderTable = o2t(Cylinder)


# obsolete
def inittable(db):
    from idgenerator import generator

    def cylinder(id, height, innerradius, outerradius):
        b = Cylinder()
        b.id = id
        b.height = height
        b.innerradius = innerradius
        b.outerradius = outerradius
        return b

    cylinders = [
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class ESS_moderator_short(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'ess_moderator_short'

ESS_moderator_short.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
ESS_moderator_shortTable = o2t(ESS_moderator_short, {'subclassFrom': NeutronComponentTableBase})
Beispiel #7
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class CNCS_radial_coll(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = "cncs_radial_coll"


CNCS_radial_coll.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

CNCS_radial_collTable = o2t(CNCS_radial_coll, {"subclassFrom": NeutronComponentTableBase})
Beispiel #8
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class FermiChopper(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'fermichopper'

FermiChopper.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
FermiChopperTable = o2t(FermiChopper, {'subclassFrom': NeutronComponentTableBase})
Beispiel #9
0
#
#                      California Institute of Technology
#                      (C) 2006-2010  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from vsat.Vacf import Vacf
from vnf.dom.AtomicStructure import StructureTable

# db table
from ComputationResult import ComputationResult
from _ import o2t
VacfTable = o2t(Vacf, {'subclassFrom': ComputationResult})
import dsaw.db
VacfTable.addColumn(
    dsaw.db.reference(name='matter', table=StructureTable)#, backref='')
    )

#EisfTable.datafiles = [
#    'data.plot'
#    ]



# version
__id__ = "$Id$"

# End of file 
Beispiel #10
0
#
#                      California Institute of Technology
#                      (C) 2006-2009  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from Atom import Atom
from Lattice import Lattice
from matter.orm.Structure import Structure

# db table
from _ import o2t, AbstractOwnedObjectBase
StructureTable = o2t(Structure, {'subclassFrom': AbstractOwnedObjectBase})


# view
def customizeLubanObjectDrawer(self, drawer):
    drawer.sequence = ['lattice', 'atoms', 'properties',]
    drawer.readonly_view_sequence =  ['lattice', 'atoms', 
                                      'primitive_unitcell', 'properties',]
    drawer.mold.sequence = ['short_description', 'spacegroupno']
Structure.customizeLubanObjectDrawer = customizeLubanObjectDrawer

Structure.luban_orm_actor = "orm/atomicstructures"

# version
__id__ = "$Id$"
    instrument = ''
    short_description = ''

    pass


from dsaw.model.Inventory import Inventory as InvBase


class Inventory(InvBase):

    instrument = InvBase.d.str(name='instrument')
    short_description = InvBase.d.str(name='short_description')

    dbtablename = 'snsmoderatormcsimulateddata'


SNSModeratorMCSimulatedData.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
SNSModeratorMCSimulatedDataTable = o2t(
    SNSModeratorMCSimulatedData, {'subclassFrom': NeutronComponentTableBase})

SNSModeratorMCSimulatedDataTable.datafiles = ['profile.dat']

# version
__id__ = "$Id$"

# End of file
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Guide_channeled(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'guide_channeled'


Guide_channeled.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
Guide_channeledTable = o2t(Guide_channeled,
                           {'subclassFrom': NeutronComponentTableBase})
Beispiel #13
0
    # target definition
    target_radius = InvBase.d.float(name='target_radius', default=0)
    target_radius.tip = 'radius of disk containg target. use 0 for full space'

    target_position = InvBase.d.array(name='target_position',
                                      elementtype='float',
                                      default=(0, 0, 0))

    dbtablename = 'vanadiumplates'


VanadiumPlate.Inventory = Inventory
del Inventory

from _ import o2t
VanadiumPlateTable = o2t(VanadiumPlate, {'subclassFrom': TableBase})


# obsolete ...
def inittable(db):
    Table = VanadiumPlate

    def new(id, short_description, width, height, thickness, target_radius,
            target_position):
        r = Table()
        r.id = id
        r.short_description = short_description
        r.width = width
        r.height = height
        r.thickness = thickness
        r.target_radius = target_radius
Beispiel #14
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Collimator_radial(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = "collimator_radial"


Collimator_radial.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

Collimator_radialTable = o2t(Collimator_radial, {"subclassFrom": NeutronComponentTableBase})
Beispiel #15
0
    def customizeLubanObjectDrawer(self, drawer):
        drawer.mold.sequence = [
            'componentname', 'short_description',
            'referencename', 'position', 'orientation',
            'energy',
            ]
    pass


InvBase=base.Inventory
class Inventory(InvBase):

    energy = InvBase.d.float( name = 'energy', default = 70., validator=InvBase.v.positive)
    energy.help = 'neutron energy. unit: meV'
    
    dbtablename = 'monochromaticsources'


MonochromaticSource.Inventory = Inventory
del Inventory


from _ import o2t, NeutronComponentTableBase
MonochromaticSourceTable = o2t(MonochromaticSource, {'subclassFrom': NeutronComponentTableBase})


# version
__id__ = "$Id$"

# End of file 
Beispiel #16
0
#
#                      California Institute of Technology
#                      (C) 2006-2010  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from vsat.Msd import Msd
from vnf.dom.AtomicStructure import StructureTable

# db table
from ComputationResult import ComputationResult
from _ import o2t
MsdTable = o2t(Msd, {'subclassFrom': ComputationResult})
import dsaw.db
MsdTable.addColumn(
    dsaw.db.reference(name='matter', table=StructureTable)#, backref='')
    )

#EisfTable.datafiles = [
#    'data.plot'
#    ]



# version
__id__ = "$Id$"

# End of file 
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Vitess_ChopperFermi(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'vitess_chopperfermi'


Vitess_ChopperFermi.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
Vitess_ChopperFermiTable = o2t(Vitess_ChopperFermi,
                               {'subclassFrom': NeutronComponentTableBase})
Beispiel #18
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class DivPos_monitor(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'divpos_monitor'


DivPos_monitor.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

DivPos_monitorTable = o2t(DivPos_monitor,
                          {'subclassFrom': NeutronComponentTableBase})
Beispiel #19
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class Vitess(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'vitess'

Vitess.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
VitessTable = o2t(Vitess, {'subclassFrom': NeutronComponentTableBase})
Beispiel #20
0
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                      California Institute of Technology
#                        (C) 2008  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


from _ import o2t

from vnf.dom.Computation import Computation

from vsat.trajectory.VacfDiffusionCalc import VacfDiffusionCalc as VacfDiffusionCalcBase

VacfDiffusionCalc = o2t(VacfDiffusionCalcBase, {'subclassFrom': Computation})
VacfDiffusionCalc.job_builder = 'analysiscalc'
VacfDiffusionCalc.actor = 'analysis/vacfdiffusioncalc'
VacfDiffusionCalc.result_retriever = 'vacfdiffusioncalc'




# version
__id__ = "$Id$"

# End of file 
Beispiel #21
0
    divergence = InvBase.d.float(name='divergence', default=40.0)
    divergence.help = '(min of arc) Divergence angle. May also be specified with the'
    transmission = InvBase.d.float(name='transmission', default=1.0)
    transmission.help = '(1)         Transmission of Soller (0<=t<=1)'
    theta_min = InvBase.d.float(name='theta_min', default=5.0)
    theta_min.help = '(deg)        Minimum Theta angle for the radial setting'
    theta_max = InvBase.d.float(name='theta_max', default=165.0)
    theta_max.help = '(deg)        Maximum Theta angle for the radial setting'
    nchan = InvBase.d.float(name='nchan', default=128.0)
    nchan.help = '(1)          Number of channels in the theta range'
    radius = InvBase.d.float(name='radius', default=0.0)
    radius.help = '(m)          Radius of the collimator (to entry window)'
    nblades = InvBase.d.float(name='nblades', default=0.0)
    nblades.help = '(1)         Number of blades composing each Soller. Overrides'
    roc = InvBase.d.float(name='roc', default=0.0)
    roc.help = '(1)         Enable oscillation of collimator with an amplitude'
    verbose = InvBase.d.float(name='verbose', default=0.0)
    verbose.help = '(0/1)       Gives additional information'
    dbtablename = 'collimatorradials'


CollimatorRadial.Inventory = Inventory
del Inventory
from _ import o2t, NeutronComponentTableBase
CollimatorRadialTable = o2t(CollimatorRadial,
                            {'subclassFrom': NeutronComponentTableBase})
# version
__id__ = "$Id$"

# End of file
Beispiel #22
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Filter_gen(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'filter_gen'


Filter_gen.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
Filter_genTable = o2t(Filter_gen, {'subclassFrom': NeutronComponentTableBase})
Beispiel #23
0
#
#                                   Jiao Lin
#                      California Institute of Technology
#                        (C) 2007  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


class SampleEnvironment(object):

    #unit: K
    temperature = 300.

    #unit: Tesla
    magnetic_field = [0., 0., 0.]

    #unit: atm
    pressure = 1.


from _ import o2t
SampleEnvironmentTable = o2t(SampleEnvironment)

# version
__id__ = "$Id$"

# End of file
Beispiel #24
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Vitess(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'vitess'


Vitess.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
VitessTable = o2t(Vitess, {'subclassFrom': NeutronComponentTableBase})
Beispiel #25
0
# -*- Python -*-
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                      California Institute of Technology
#                        (C) 2008  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from _ import o2t

from memdf.gulp.GulpPotential import GulpPotential
GulpPotentialTable = o2t(GulpPotential)

#import dsaw.db
#GulpSettings.addColumn(
#    dsaw.db.reference(name='matter', table=Structure, backref='gulpsettings')
#    )


# version
__id__ = "$Id$"

# End of file 
Beispiel #26
0
# -*- Python -*-
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                      California Institute of Technology
#                      (C) 2006-2010  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from _ import o2t


# data object
from vsat.Trajectory import Trajectory as TrajectoryDO
from vnf.dom.AtomicStructure import StructureTable

# "Holder" in vnf
from ComputationResultTs import ComputationResultTs
Trajectory = o2t(TrajectoryDO, {'subclassFrom': ComputationResultTs}) 



# version
__id__ = "$Id$"

# End of file 
Beispiel #27
0
# -*- Python -*-
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                                   Jiao Lin
#                      California Institute of Technology
#                      (C) 2006-2009  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


# data object
from matter.orm.UnitCell import UnitCell


# db table
from _ import o2t
UnitCellTable = o2t(UnitCell)


# version
__id__ = "$Id$"

# End of file 
Beispiel #28
0
    w1.help = '(m)    Width at the guide entry'
    h1 = InvBase.d.float(name='h1', default=0)
    h1.help = '(m)    Height at the guide entry'
    w2 = InvBase.d.float(name='w2', default=0)
    w2.help = '(m)    Width at the guide exit'
    h2 = InvBase.d.float(name='h2', default=0)
    h2.help = '(m)    Height at the guide exit'
    l = InvBase.d.float(name='l', default=0)
    l.help = '(m)    length of guide'
    R0 = InvBase.d.float(name='R0', default=0.98999999999999999)
    R0.help = '(1)    Low-angle reflectivity'
    Qc = InvBase.d.float(name='Qc', default=0.021899999999999999)
    Qc.help = '(AA-1) Critical scattering vector'
    alpha = InvBase.d.float(name='alpha', default=6.0700000000000003)
    alpha.help = '(AA)   Slope of reflectivity'
    m = InvBase.d.float(name='m', default=2.0)
    m.help = '(1)    m-value of material. Zero means completely absorbing.'
    W = InvBase.d.float(name='W', default=0.0030000000000000001)
    W.help = '(AA-1) Width of supermirror cut-off'
    reflect = InvBase.d.str(name='reflect', default='')
    reflect.help = '(str)  Reflectivity file name. Format [q(Angs-1) R(0-1)]'
    dbtablename = 'guides'
Guide.Inventory = Inventory
del Inventory
from _ import o2t, NeutronComponentTableBase
GuideTable = o2t(Guide, {'subclassFrom': NeutronComponentTableBase})
# version
__id__ = "$Id$"

# End of file 
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class NeutronFromStorage(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'neutronfromstorage'

NeutronFromStorage.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
NeutronFromStorageTable = o2t(NeutronFromStorage, {'subclassFrom': NeutronComponentTableBase})
Beispiel #30
0
    yh = InvBase.d.float(name='yh', default=0.1)
    yh.tip = "y (vertical) dimension of the target. unit: meter"

    Emin = InvBase.d.float(name='Emin', default=0)
    Emin.tip = 'minimum value for energy of neutrons. unit: meV'

    Emax = InvBase.d.float(name='Emax', default=100)
    Emax.tip = 'maximum value for energy of neutrons. unit: meV'

    neutronprofile = InvBase.d.reference(
        name='neutronprofile',
        targettype=SNSModeratorMCSimulatedData,
        owned=False)
    neutronprofile.tip = 'Select a neutron profile for the instrument in which you want to run your experiment'

    dbtablename = 'snsmoderators'


SNSModerator.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
SNSModeratorTable = o2t(SNSModerator,
                        {'subclassFrom': NeutronComponentTableBase})

# version
__id__ = "$Id$"

# End of file
Beispiel #31
0
    divergenceV = 0.0
    def customizeLubanObjectDrawer(self, drawer):
        drawer.mold.sequence = ['componentname', 'short_description', 'referencename', 'position', 'orientation', 'x_min', 'x_max', 'y_min', 'y_max', 'len', 'divergence', 'transmission', 'divergenceV']
InvBase=base.Inventory
class Inventory(InvBase):
    x_min = InvBase.d.float(name='x_min', default=0)
    x_min.help = '(m)              Lower x bound on slits'
    x_max = InvBase.d.float(name='x_max', default=0)
    x_max.help = '(m)              Upper x bound on slits'
    y_min = InvBase.d.float(name='y_min', default=0)
    y_min.help = '(m)              Lower y bound on slits'
    y_max = InvBase.d.float(name='y_max', default=0)
    y_max.help = '(m)              Upper y bound on slits'
    len = InvBase.d.float(name='len', default=0)
    len.help = '(m)              Distance between slits'
    divergence = InvBase.d.float(name='divergence', default=40.0)
    divergence.help = '(minutes of arc) Divergence horizontal angle (calculated as atan(d/len),'
    transmission = InvBase.d.float(name='transmission', default=1.0)
    transmission.help = '(1)              Transmission of Soller (0<=t<=1)'
    divergenceV = InvBase.d.float(name='divergenceV', default=0.0)
    divergenceV.help = '(minutes of arc) Divergence vertical angle'
    dbtablename = 'collimatorlinears'
CollimatorLinear.Inventory = Inventory
del Inventory
from _ import o2t, NeutronComponentTableBase
CollimatorLinearTable = o2t(CollimatorLinear, {'subclassFrom': NeutronComponentTableBase})
# version
__id__ = "$Id$"

# End of file 
Beispiel #32
0
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from _ import o2t

# data object
from vsat.Phonons import Phonons

from vnf.dom.AtomicStructure import StructureTable
# vnf holder
from ComputationResult import ComputationResult
#PhononDispersionTable = o2t(PhononDispersion, {'subclassFrom': ComputationResult})
PhononsTable = o2t(Phonons, {'subclassFrom': ComputationResult})
import dsaw.db
PhononsTable.addColumn(
    dsaw.db.reference(name='matter', table=StructureTable, backref='phonons'))
# status
#   'n': normal
#   'd': deleted
PhononsTable.addColumn(dsaw.db.varchar(name='status', length=1, default='n'))

PhononsTable.datafiles = [
    'DOS',
    'Omega2',
    'Polarizations',
    'Qgridinfo',
    'WeightedQ',  # this is optional actually
    'data.idf/DOS',
Beispiel #33
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class SNS_source_r1(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'sns_source_r1'

SNS_source_r1.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
SNS_source_r1Table = o2t(SNS_source_r1, {'subclassFrom': NeutronComponentTableBase})
Beispiel #34
0
    x_max = InvBase.d.float(name='x_max', default=0)
    x_max.help = 'Upper x bound of detector opening (m) '
    y_min = InvBase.d.float(name='y_min', default=0)
    y_min.help = 'Lower y bound of detector opening (m) '
    y_max = InvBase.d.float(name='y_max', default=0)
    y_max.help = 'Upper y bound of detector opening (m) '
    x_width = InvBase.d.float(name='x_width',
                              default=0,
                              validator=InvBase.v.nonnegative)
    x_width.help = 'Width/diameter of detector (x). Overrides xmin,xmax. (m) '
    y_height = InvBase.d.float(name='y_height',
                               default=0,
                               validator=InvBase.v.nonnegative)
    y_height.help = 'Height of detector (y). Overrides ymin,ymax. (m) '

    nchan = InvBase.d.int(name='nchan',
                          default=100,
                          validator=InvBase.v.positive)
    nchan.help = 'Number of wavelength channels (1) '

    dbtablename = 'lmonitors'


LMonitor.Inventory = Inventory
del Inventory

from _ import o2t, MonitorTableBase
LMonitorTable = o2t(LMonitor, {'subclassFrom': MonitorTableBase})

__date__ = "$Sep 12, 2010 12:19:20 AM$"
Beispiel #35
0
        owned = 1)
    
    category = InvBase.d.str(name = 'category', max_length = 64)

    name = InvBase.d.str(name='name')
    short_description = InvBase.d.str(name='short_description')
    long_description = InvBase.d.str( name = 'long_description', max_length = 8192 )

    dbtablename = "instruments"

Instrument.Inventory = Inventory
del Inventory


from _ import o2t, AbstractOwnedObjectBase
InstrumentTable = o2t(Instrument, {'subclassFrom': AbstractOwnedObjectBase})


import dsaw.db
InstrumentTable.addColumn(dsaw.db.varchar(name='status', length=32, default='online'))
InstrumentTable.addColumn(dsaw.db.boolean(name='has_sample_component'))



# ????
def inittable(db):
    from instruments import initall
    return initall(db)


# version
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


class DetectorSystemHierarchy_fromXML:
    # detector system from xml. this is the core part of the detector system,
    # mostly unchangeable information of a detector system is here.
    # the tunable parameters are in DetectorSystem_fromXML
    pass


from _ import AbstractOwnedObjectBase as tbase, o2t
DetectorSystemHierarchy_fromXMLTable = o2t(
    DetectorSystemHierarchy_fromXML,
    {'subclassFrom': tbase},
    )
# a db record of DetectorSystemHierarchy_fromXML needs a xml file that contains
# the real specification of the detector system.
# it will be in the dedicated directory for the database record
DetectorSystemHierarchy_fromXMLTable.xmlfilename = 'detectorsystem.xml'
DetectorSystemHierarchy_fromXMLTable.datafiles = [DetectorSystemHierarchy_fromXMLTable.xmlfilename]


from MonitorBase import MonitorBase as base
class DetectorSystem_fromXML(base):

    abstract = False

    tofmin = 3000.
    tofmax = 6000.
Beispiel #37
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class TOF_monitor2(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = "tof_monitor2"


TOF_monitor2.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

TOF_monitor2Table = o2t(TOF_monitor2, {"subclassFrom": NeutronComponentTableBase})
Beispiel #38
0
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#


from _ import o2t

# data object
from vsat.Phonons import Phonons

from vnf.dom.AtomicStructure import StructureTable
# vnf holder
from ComputationResult import ComputationResult
#PhononDispersionTable = o2t(PhononDispersion, {'subclassFrom': ComputationResult})
PhononsTable = o2t(Phonons, {'subclassFrom': ComputationResult})
import dsaw.db
PhononsTable.addColumn(
    dsaw.db.reference(name='matter', table=StructureTable, backref='phonons')
    )
# status
#   'n': normal
#   'd': deleted
PhononsTable.addColumn(dsaw.db.varchar(name='status', length=1, default='n'))


PhononsTable.datafiles = [
    'DOS',
    'Omega2',
    'Polarizations',
    'Qgridinfo',
Beispiel #39
0
# -*- Python -*-
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                                   Jiao Lin
#                      California Institute of Technology
#                      (C) 2006-2009  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

# data object
from matter.orm.UnitCell import UnitCell

# db table
from _ import o2t
UnitCellTable = o2t(UnitCell)

# version
__id__ = "$Id$"

# End of file
Beispiel #40
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Guide(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'guide'


Guide.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

GuideTable = o2t(Guide, {'subclassFrom': NeutronComponentTableBase})
Beispiel #41
0
from dsaw.model.Inventory import Inventory as InvBase
class Inventory(InvBase):

    show_help_on_login = InvBase.d.bool(name='show_help_on_login', max_length = 128)
    dbtablename = 'usersettings'


UserSetting.Inventory = Inventory


from User import User
from dsaw.db.WithID import WithID
class TableBase(WithID):

    import dsaw.db

    user = dsaw.db.reference(name='user', table=User)

    pass # end of TableBase


from _ import o2t
UserSettingTable = o2t(UserSetting, {'subclassFrom': TableBase})


# version
__id__ = "$Id$"

# End of file 
Beispiel #42
0
# data object
# we should use the histogram data object in the histogram package in the long run
class Histogram:

    pass


# orm
from dsaw.model.Inventory import Inventory as InvBase
class Inventory(InvBase):

    dbtablename = 'histograms'

Histogram.Inventory = Inventory


# db table
from ComputationResult import ComputationResult
HistogramTable = o2t(Histogram, {'subclassFrom': ComputationResult})
HistogramTable.datafiles = [
    'data.h5',
    ]



# version
__id__ = "$Id$"

# End of file 
Beispiel #43
0
            return doc

        drawer.mold._createfield_for_neutrons = _createfield_for_neutrons
        
    pass



from vnf.dom.neutron_experiment_simulations.NeutronStorage import NeutronStorage

InvBase=base.Inventory
class Inventory(InvBase):

    neutrons = InvBase.d.reference(name='neutrons', targettype=NeutronStorage, owned=False)
    dbtablename = 'neutronplayers'



NeutronPlayer.Inventory = Inventory
del Inventory


from _ import o2t, NeutronComponentTableBase as TableBase
NeutronPlayerTable = o2t(NeutronPlayer, {'subclassFrom':TableBase})


# version
__id__ = "$Id$"

# End of file 
Beispiel #44
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base
class E_monitor(base):
    abstract = False

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'e_monitor'

E_monitor.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
E_monitorTable = o2t(E_monitor, {'subclassFrom': NeutronComponentTableBase})
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class DetectorSystemFromXml(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'detectorsystemfromxml'


DetectorSystemFromXml.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
DetectorSystemFromXmlTable = o2t(DetectorSystemFromXml,
                                 {'subclassFrom': NeutronComponentTableBase})
Beispiel #46
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Fermi_chop2(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'fermi_chop2'


Fermi_chop2.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

Fermi_chop2Table = o2t(Fermi_chop2,
                       {'subclassFrom': NeutronComponentTableBase})
    components = InvBase.d.referenceSet(
        name = 'components',
        targettype=AbstractNeutronComponent, targettypes=neutroncomponent_types,
        owned = 1)

    dbtablename = 'instrumentconfigurations'
    


InstrumentConfiguration.Inventory = Inventory
del Inventory


from _ import o2t
InstrumentConfigurationTable = o2t(InstrumentConfiguration)


## obsolete
## the instrument for which this configuration is about
## target = dsaw.db.reference(name='target', table=Instrument)
## componentsequence = dsaw.db.varcharArray(
##     name = 'componentsequence', length = 128, default = [] )
## components = vnf.dom.referenceSet(name='components')
## geometer = vnf.dom.geometer()
## configured = dsaw.db.boolean(name='configured', default=False)




# version
Beispiel #48
0
    x_max = 0.0
    y_min = 0.0
    y_max = 0.0
    x_width = 0.0
    y_height = 0.0
    def customizeLubanObjectDrawer(self, drawer):
        drawer.mold.sequence = ['componentname', 'short_description', 'referencename', 'position', 'orientation', 'x_min', 'x_max', 'y_min', 'y_max', 'x_width', 'y_height']
InvBase=base.Inventory
class Inventory(InvBase):
    x_min = InvBase.d.float(name='x_min', default=0.0)
    x_min.help = 'Lower x bound of opening [m]'
    x_max = InvBase.d.float(name='x_max', default=0.0)
    x_max.help = 'Upper x bound of opening [m]'
    y_min = InvBase.d.float(name='y_min', default=0.0)
    y_min.help = 'Lower y bound of opening [m]'
    y_max = InvBase.d.float(name='y_max', default=0.0)
    y_max.help = 'Upper y bound of opening [m]'
    x_width = InvBase.d.float(name='x_width', default=0.0)
    x_width.help = 'Width/diameter of detector (x). Overrides x_min,x_max. (m)'
    y_height = InvBase.d.float(name='y_height', default=0.0)
    y_height.help = 'Height of detector (y). Overrides y_min,y_max. (m)'
    dbtablename = 'monitors'
Monitor.Inventory = Inventory
del Inventory
from _ import o2t, MonitorTableBase
MonitorTable = o2t(Monitor, {'subclassFrom': MonitorTableBase})
# version
__id__ = "$Id$"

# End of file 
Beispiel #49
0
    h2.help = '(m)          Output window height'
    len = InvBase.d.float(name='len', default=0.34999999999999998)
    len.help = '(m)          Length/Distance between slits'
    divergence = InvBase.d.float(name='divergence', default=40.0)
    divergence.help = '(min of arc) Divergence angle. May also be specified with the'
    transmission = InvBase.d.float(name='transmission', default=1.0)
    transmission.help = '(1)         Transmission of Soller (0<=t<=1)'
    theta_min = InvBase.d.float(name='theta_min', default=5.0)
    theta_min.help = '(deg)        Minimum Theta angle for the radial setting'
    theta_max = InvBase.d.float(name='theta_max', default=165.0)
    theta_max.help = '(deg)        Maximum Theta angle for the radial setting'
    nchan = InvBase.d.float(name='nchan', default=128.0)
    nchan.help = '(1)          Number of channels in the theta range'
    radius = InvBase.d.float(name='radius', default=0.0)
    radius.help = '(m)          Radius of the collimator (to entry window)'
    nblades = InvBase.d.float(name='nblades', default=0.0)
    nblades.help = '(1)         Number of blades composing each Soller. Overrides'
    roc = InvBase.d.float(name='roc', default=0.0)
    roc.help = '(1)         Enable oscillation of collimator with an amplitude'
    verbose = InvBase.d.float(name='verbose', default=0.0)
    verbose.help = '(0/1)       Gives additional information'
    dbtablename = 'collimatorradials'
CollimatorRadial.Inventory = Inventory
del Inventory
from _ import o2t, NeutronComponentTableBase
CollimatorRadialTable = o2t(CollimatorRadial, {'subclassFrom': NeutronComponentTableBase})
# version
__id__ = "$Id$"

# End of file 
Beispiel #50
0
#                               Alex Dementsov
#                      California Institute of Technology
#                        (C) 2010  All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

from AbstractNeutronComponent import AbstractNeutronComponent as base
class Arm(base):
    abstract = False
    def customizeLubanObjectDrawer(self, drawer):
        # drawer.mold.sequence = ['componentname', 'short_description', 'referencename', 'position', 'orientation']
        drawer.mold.sequence = ['componentname']

InvBase=base.Inventory
class Inventory(InvBase):
    dbtablename = 'arm'

Arm.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
ArmTable = o2t(Arm, {'subclassFrom': NeutronComponentTableBase})


__date__ = "$Mar 7, 2011 11:49:02 AM$"


Beispiel #51
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Sans_spheres(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'sans_spheres'


Sans_spheres.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
Sans_spheresTable = o2t(Sans_spheres,
                        {'subclassFrom': NeutronComponentTableBase})
Beispiel #52
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class Selector(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'selector'


Selector.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase
SelectorTable = o2t(Selector, {'subclassFrom': NeutronComponentTableBase})
Beispiel #53
0
# -*- Python -*-

from AbstractNeutronComponent import AbstractNeutronComponent as base


class V_sample(base):
    abstract = False


InvBase = base.Inventory


class Inventory(InvBase):
    dbtablename = 'v_sample'


V_sample.Inventory = Inventory
del Inventory

from _ import o2t, NeutronComponentTableBase

V_sampleTable = o2t(V_sample, {'subclassFrom': NeutronComponentTableBase})