-
Notifications
You must be signed in to change notification settings - Fork 2
/
analysis.penumbra.py
44 lines (37 loc) · 2.29 KB
/
analysis.penumbra.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
#sysimports
from os import path
#package imports
import seaborn as sns,pandas as pd
#local imports
import image,plot
from nki import plots
# from nki import runners
fname = path.join(r"Z:\brent\fieldseries\F180813B",'profile_plot')
df = pd.read_csv(fname+".csv",index_col=0)
fname_shift = path.join(r"Z:\brent\fieldseries\F180823Q",'profile_plot')
df_shift = pd.read_csv(fname_shift+".csv",index_col=0)
columntitles = ["Plan","Axis","Fieldsize","Penumbra"]
data = []
for dataset,penum_links,penum_rechts in plots.get_penumbras(df.query("Axis=='X' and (Setname=='5cm' or Setname=='10cm' or Setname=='15cm' or Setname=='20cm')")):
# data.append(["isocentred","x",dataset,penum_links,penum_rechts])
data.append(["isocentred","X (BLD:Jaw)",dataset,penum_links])
data.append(["isocentred","X (BLD:Jaw)",dataset,penum_rechts])
# print("Penumbra's voor ",dataset,penum_links,penum_rechts)
for dataset,penum_links,penum_rechts in plots.get_penumbras(df.query("Axis=='Z' and (Setname=='5cm' or Setname=='10cm' or Setname=='15cm' or Setname=='20cm')")):
data.append(["isocentred","Z (BLD:MLC)",dataset,penum_links])
data.append(["isocentred","Z (BLD:MLC)",dataset,penum_rechts])
# print("Penumbra's voor ",dataset,penum_links,penum_rechts)
for dataset,penum_links,penum_rechts in plots.get_penumbras(df_shift.query("Axis=='X' and (Setname=='5cm' or Setname=='10cm' or Setname=='15cm' or Setname=='20cm')")):
data.append(["shifted","X (BLD:Jaw)",dataset,penum_links])
data.append(["shifted","X (BLD:Jaw)",dataset,penum_rechts])
# print("Penumbra's voor ",dataset,penum_links,penum_rechts)
for dataset,penum_links,penum_rechts in plots.get_penumbras(df_shift.query("Axis=='Z' and (Setname=='5cm' or Setname=='10cm' or Setname=='15cm' or Setname=='20cm')")):
data.append(["shifted","Z (BLD:MLC)",dataset,penum_links])
data.append(["shifted","Z (BLD:MLC)",dataset,penum_rechts])
# print("Penumbra's voor ",dataset,penum_links,penum_rechts)
newdf = pd.DataFrame(data = data,columns = columntitles)
sns.set_style(style="whitegrid")
f = sns.catplot(x="Fieldsize", y="Penumbra", hue="Plan", data=newdf, col="Axis", kind="box", sharey=True)
f.savefig(r'Z:\brent\fieldseries\penumbra.pdf', bbox_inches='tight')
f.savefig(r'Z:\brent\fieldseries\penumbra.png', bbox_inches='tight',dpi=300)