예제 #1
0
import sys
import os
import math
import numpy as np
#from shelltools import run
from utils import readLvoxGridHeaderTuple

gridfile = sys.argv[1]
centerX = float(sys.argv[2])
centerY = float(sys.argv[3])
outname = sys.argv[4]

nx, ny, nz, xmin, ymin, zmin, xsize, ysize, zsize, noda, dt = readLvoxGridHeaderTuple(
    gridfile)

infile = open(gridfile, 'r')
outfile = open(outname, 'w')

MAX_R = 11.28
rstep = xsize
nr = int((MAX_R + 0.0001) / rstep)
hists = np.zeros((nr, nz))
counts = np.zeros((nr, nz))

ix = 0
iy = 0
iz = 0

for i in range(0, 11):
    infile.readline()
v2nt = sys.argv[8]
v3nt = sys.argv[9]
v4nt = sys.argv[10]

v0nb = sys.argv[11]
v1nb = sys.argv[12]
v2nb = sys.argv[13]
v3nb = sys.argv[14]
v4nb = sys.argv[15]

N_THRESHOLD = 5

normalizeHist = False
isFirst = True
#read header of one
nx0, ny0, nz0, xmin, ymin, zmin, xsize, ysize, zsize, noda, dt = readLvoxGridHeaderTuple(
    v0pad)
nx1, ny1, nz1, xmin1, ymin1, zmin1, xsize1, ysize1, zsize1, noda1, dt1 = readLvoxGridHeaderTuple(
    v1pad)
nx2, ny2, nz2, xmin2, ymin2, zmin2, xsize2, ysize2, zsize2, noda2, dt2 = readLvoxGridHeaderTuple(
    v2pad)
nx3, ny3, nz3, xmin3, ymin3, zmin3, xsize3, ysize3, zsize3, noda3, dt3 = readLvoxGridHeaderTuple(
    v3pad)
nx4, ny4, nz4, xmin4, ymin4, zmin4, xsize4, ysize4, zsize4, noda4, dt4 = readLvoxGridHeaderTuple(
    v4pad)

nx = min(nx0, nx1, nx2, nx3, nx4)
ny = min(ny0, ny1, ny2, ny3, ny4)
nz = min(nz0, nz1, nz2, nz3, nz4)

sumPADs = np.zeros((nx, ny, nz))
sumWeight = np.zeros((nx, ny, nz))