-
Notifications
You must be signed in to change notification settings - Fork 0
/
stat.py
63 lines (56 loc) · 1.44 KB
/
stat.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# %%
import numpy as np
import sys
sys.path.append('D:/supernova/utils')
import utils.select_id as select_id
import utils.cluster as clst
import utils.slice as slc
testfile = 'event/890.txt'
events=select_id.quick_select_id(testfile)
# %%
ids=events.idmap.keys() # get all ids
slice_lst=[] # list of slices with xz and yz planes
for i in ids:
if i>0:
temp=slc.slice_base(events.select(i))
if temp.both==1:
#print(i)
slice_lst.append(slc.slice_image(events.select(i)))
# %%
xyzclusterlst=[] # list of clusters with xz and yz planes
for i in ids:
if i<0:
#print(i)
event=events.select(i)
b=clst.cluster_info(events.select(i))
if b.both==1:
xyzclusterlst.append(i)
print(b.is_supernova)
# %%
# do a stat on the number of close slices of each cluster
num=[]
for j in xyzclusterlst:
if j<0:
print(j)
b=clst.xyz_cluster(events.select(j))
b.get_close_slice_num(slice_lst)
print(j, b.close_slice_num)
num.append(b.close_slice_num)
# %%
np.mean(num)
# %%
len(slice_lst)/len([i for i in ids if i>0])
# %%
len(xyzclusterlst)/len([i for i in ids if i<0])
# %%
slc.slice_image(events.select(91))# %%
# %%
events.select(91)
# %%
import uuid
str(uuid.uuid4('dasfsf'))
# %%
b=clst.xyz_cluster(events.select(-10))
b.get_close_slice_num(slice_lst)
b.close_slice_list
# %%