def getsnq(): snq = NQS('id', 't', 'ty', 'ice') snq.v[0].from_python(lids) snq.v[1].from_python(lspks) for i in xrange(len(lids)): snq.v[2].append(lctyID[int(lids[i])]) snq.v[3].append(h.ice(lctyID[int(lids[i])])) return snq
def getsnq(ld): lspks, lids, lctyID = ld['lspks'], ld['lids'], ld['lctyID'] snq = NQS('id', 't', 'ty', 'ice') snq.v[0].from_python(lids) snq.v[1].from_python(lspks) for i in xrange(len(lids)): snq.v[2].append(lctyID[lids[i]]) snq.v[3].append(h.ice(lctyID[lids[i]])) ld['snq'] = snq return snq
def makeix(lctyID): global ix, ixe, allcells, ecells, icells allcells, ecells, icells = 0, 0, 0 for i in xrange(CTYPi): ix[i] = 1e9 ixe[i] = -1e9 numc[i] = 0 for i in xrange(len(lctyID)): ty = lctyID[i] numc[ty] += 1 allcells += 1 ix[ty] = min(ix[ty], i) ixe[ty] = max(ixe[ty], i) if h.ice(ty): icells += 1 else: ecells += 1