コード例 #1
0
def getjson(filename):
    #M2E = MidasToEvaSDA.SDA(filename)
    M2E = SDA(filename)
    M2E.versionMID = 2
    M2E.extractXML()
    M2E.getStartFreq(None)
    M2E.getStopFreq(None)
    M2E.getStartTime(None)
    M2E.getEndTime(None)
    M2E.getNumFreqSteps(None)
    M2E.getNumCycles()
    M2E.getCycleTime()
    M2E.getElem(None)
    M2E.getZ(None)
    M2E.collectMdumpData()
    M2E.reorganizeMdumpData()
    M2E.binMdumpData(0.2, 200)

    bindata = M2E.getbindata()

    numFreq = M2E.numfreqsteps
    jsonData = []
    for i in xrange(len(bindata)):
        hist = Counter(bindata[i])
        for j in hist:
            jsonData.append({'f': i % numFreq, 'c': j, 'N': hist[j]})

    return jsonData
コード例 #2
0
def getjson(filename):
    #M2E = MidasToEvaSDA.SDA(filename)
    M2E = SDA(filename)
    M2E.versionMID = 2
    M2E.extractXML()
    M2E.getStartFreq(None)
    M2E.getStopFreq(None)
    M2E.getStartTime(None)
    M2E.getEndTime(None)
    M2E.getNumFreqSteps(None)
    M2E.getNumCycles()
    M2E.getCycleTime()
    M2E.getElem(None)
    M2E.getZ(None)
    M2E.collectMdumpData()
    M2E.reorganizeMdumpData()
    M2E.binMdumpData(0.2, 200)

    bindata = M2E.getbindata()

    numFreq = M2E.numfreqsteps
    jsonData = []
    for i in xrange(len(bindata)):
        hist = Counter(bindata[i])
        for j in hist:
            jsonData.append({'f': i % numFreq, 'c': j, 'N': hist[j]})

    return jsonData
コード例 #3
0
def getjson(filename):
    '''Extract the TOF data from the given filename and create
    a JSON data structure from it.

    f: The position in the frequency list
    c: The tof channel of a count
    N: Number of ions counted in channel 'c'
    countclass: the total number of ions in the event
    invcc: 1/countclass -> A hack to get the count class histogram
           to appear correctly in prcview.html
    '''
    M2E = SDA(filename)
    M2E.versionMID = 2
    M2E.extractXML()
    M2E.getStartFreq(None)
    M2E.getStopFreq(None)
    M2E.getStartTime(None)
    M2E.getEndTime(None)
    M2E.getNumFreqSteps(None)
    M2E.getNumCycles()
    M2E.getCycleTime()
    M2E.getElem(None)
    M2E.getZ(None)
    M2E.collectMdumpData()
    M2E.reorganizeMdumpData()
    M2E.binMdumpData(0.2, 200)

    bindata = M2E.getbindata()

    numFreq = M2E.numfreqsteps
    jsonData = []
    for i in xrange(len(bindata)):
        hist = Counter(bindata[i])
        countclass = sum(hist.values())
        if countclass == 0:
            invcc = 0
        else:
            invcc = 1. / float(countclass)
        for j in hist:
            jsonData.append({
                'f': i % numFreq,
                'c': j,
                'N': hist[j],
                'countclass': countclass,
                'invcc': invcc
            })

    return jsonData
コード例 #4
0
def getjson(filename):
    '''Extract the TOF data from the given filename and create
    a JSON data structure from it.

    f: The position in the frequency list
    c: The tof channel of a count
    N: Number of ions counted in channel 'c'
    countclass: the total number of ions in the event
    invcc: 1/countclass -> A hack to get the count class histogram
           to appear correctly in prcview.html
    '''
    M2E = SDA(filename)
    M2E.versionMID = 2
    M2E.extractXML()
    M2E.getStartFreq(None)
    M2E.getStopFreq(None)
    M2E.getStartTime(None)
    M2E.getEndTime(None)
    M2E.getNumFreqSteps(None)
    M2E.getNumCycles()
    M2E.getCycleTime()
    M2E.getElem(None)
    M2E.getZ(None)
    M2E.collectMdumpData()
    M2E.reorganizeMdumpData()
    M2E.binMdumpData(0.2, 200)

    bindata = M2E.getbindata()

    numFreq = M2E.numfreqsteps
    jsonData = []
    for i in xrange(len(bindata)):
        hist = Counter(bindata[i])
        countclass = sum(hist.values())
        if countclass == 0:
            invcc = 0
        else:
            invcc = 1. / float(countclass)
        for j in hist:
            jsonData.append({'f': i % numFreq, 'c': j, 'N': hist[j],
                             'countclass': countclass,
                             'invcc': invcc})

    return jsonData