~brenthuisman/dosia

fe68df5fffed8494a74450b223d6c5db5cfe113a — Brent 9 months ago 71d96ee master
trf upd
1 files changed, 19 insertions(+), 5 deletions(-)

M test.trf.py
M test.trf.py => test.trf.py +19 -5
@@ 1,11 1,25 @@
import trf
from gpumcd.ctypes_helpers import make_c_array
from gpumcd.gpumcdwrapper import Segment, Pair, MlcInformation, ModifierOrientation, Float3

fn=r"D:\postdoc\analyses\trf\19_03_27 13_28_48 Z 1_210_1_210.trf"

header,table=trf.read_trf(fn)
print(header)
print("================")
print(table)
#table.to_csv(r"D:\postdoc\analyses\trf\trftab.csv")

header.to_csv(r"D:\postdoc\analyses\trf\trfhead.csv")
table.to_csv(r"D:\postdoc\analyses\trf\trftab.csv")
\ No newline at end of file
table = table[table["Linac State/Actual Value (None)"] == "Radiation On"]

#table.to_csv(r"D:\postdoc\analyses\trf\trfcondsensed.csv")

nsegments = len(table)

for index,row in table.iterrows():
	if row["Linac State/Actual Value (None)"] == "Radiation On":
		nsegments += 1

print(f"{nsegments} snapshots found.")
segments = make_c_array(Segment,nsegments)

for index,row in table.iterrows():
	segments[index]=Segment()
	segments[index].collimator.perpendicularJaw