def test1(self):
     from mccomponents.detector.reduction_utils import events2IQE
     eventsfile = 'events.dat'
     outfile = 'intensities.dat'
     nevents = 337
     arcs_res = os.path.join(
         mcvine_resources, 'instruments/ARCS/resources',)
     pixelpositionsfile = os.path.join(
         arcs_res, 'pixelID2position.bin')
     solidanglesfile = os.path.join(
         arcs_res, 'solidangles.bin')
     npixels = 117760
     import pyre.units.length
     import pyre.units.energy
     import pyre.units.time
     iqe = events2IQE(
         eventsfile, nevents, 
         outfile,
         pixelpositionsfile, 
         solidanglesfile,
         npixels,
         mod2sample=13.6*pyre.units.length.meter,
         Ei=700*pyre.units.energy.meV,
         Qaxis=(9.5,10.5,0.02), Eaxis=(30,120,1.),
         tofUnit=1*pyre.units.time.microsecond,
         toffset=0*pyre.units.time.s,
         tofmax=0.015*pyre.units.time.s,
         )
     global interactive
     if interactive:
         from histogram.plotter import defaultPlotter
         defaultPlotter.plot(iqe)
     return
示例#2
0
def reduceToIQE(eventsfile, Ei, toffset, Qaxis, Eaxis):
    from mccomponents.detector.reduction_utils import events2IQE
    from mccomponents.detector.event_utils import datatype
    import os
    nevents = os.path.getsize(eventsfile) * 1. / datatype.itemsize
    assert int(nevents) - nevents == 0

    outfile = 'intensities.dat'
    pixelpositionsfile = 'pixelID2position.bin'
    solidanglesfile = 'solidangles.bin'
    iqe = events2IQE(
        eventsfile,
        nevents,
        outfile,
        pixelpositionsfile,
        solidanglesfile,
        npixels,
        mod2sample=mod2sample,
        Ei=Ei * pyre.units.energy.meV,
        Qaxis=Qaxis,
        Eaxis=Eaxis,
        tofUnit=1 * pyre.units.time.microsecond,
        toffset=toffset * pyre.units.time.microsecond,
        tofmax=mod_period,
    )
    return iqe
 def test1(self):
     from mccomponents.detector.reduction_utils import events2IQE
     eventsfile = 'events.dat'
     outfile = 'intensities.dat'
     nevents = 337
     arcs_res = os.path.join(
         mcvine_resources,
         'instruments/ARCS/resources',
     )
     pixelpositionsfile = os.path.join(arcs_res, 'pixelID2position.bin')
     solidanglesfile = os.path.join(arcs_res, 'solidangles.bin')
     npixels = 117760
     import pyre.units.length
     import pyre.units.energy
     import pyre.units.time
     iqe = events2IQE(
         eventsfile,
         nevents,
         outfile,
         pixelpositionsfile,
         solidanglesfile,
         npixels,
         mod2sample=13.6 * pyre.units.length.meter,
         Ei=700 * pyre.units.energy.meV,
         Qaxis=(9.5, 10.5, 0.02),
         Eaxis=(30, 120, 1.),
         tofUnit=1 * pyre.units.time.microsecond,
         toffset=0 * pyre.units.time.s,
         tofmax=0.015 * pyre.units.time.s,
     )
     global interactive
     if interactive:
         from histogram.plotter import defaultPlotter
         defaultPlotter.plot(iqe)
     return
示例#4
0
def reduceToIQE(eventsfile):
    from mccomponents.detector.reduction_utils import events2IQE
    from mccomponents.detector.event_utils import datatype
    import os
    nevents = os.path.getsize(eventsfile)*1. / datatype.itemsize
    assert int(nevents) - nevents == 0
    
    outfile = 'intensities.dat'
    pixelpositionsfile = 'pixelID2position.bin'
    iqe = events2IQE(
        eventsfile, nevents, 
        outfile,
        pixelpositionsfile, npixels,
        mod2sample=mod2sample,
        Ei=700*pyre.units.energy.meV,
        Qaxis=(9.5,10.5,0.02), Eaxis=(30,120,1.),
        tofUnit=1*pyre.units.time.microsecond,
        toffset=0*pyre.units.time.s,
        tofmax=mod_period,
        )
    return iqe
示例#5
0
def reduceToIQE(eventsfile, Ei, toffset, Qaxis, Eaxis):
    from mccomponents.detector.reduction_utils import events2IQE
    from mccomponents.detector.event_utils import datatype
    import os
    nevents = os.path.getsize(eventsfile)*1. / datatype.itemsize
    assert int(nevents) - nevents == 0
    
    outfile = 'intensities.dat'
    pixelpositionsfile = 'pixelID2position.bin'
    solidanglesfile = 'solidangles.bin'
    iqe = events2IQE(
        eventsfile, nevents, 
        outfile,
        pixelpositionsfile, solidanglesfile, npixels,
        mod2sample=mod2sample,
        Ei=Ei*pyre.units.energy.meV,
        Qaxis=Qaxis, Eaxis=Eaxis,
        tofUnit=.1*pyre.units.time.microsecond,
        toffset=toffset*pyre.units.time.microsecond,
        tofmax=mod_period,
        )
    return iqe