-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTP_land.py
52 lines (48 loc) · 2.1 KB
/
STP_land.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
from os import path
import compress_pickle as pkl
def landSelector(land, REL, PT_ROT):
if land == 'SPA':
# Fully spatial -------------------------------------------------------
if REL == '265':
pth = ''.join(PT_ROT.split('/'+REL)).replace('/sim/', '')
STP = pkl.load(pth+ '/GEO/cluster_1/clusters.bz')
elif REL == '505':
pth = ''.join(PT_ROT.split('/'+REL)).replace('/sim/', '')
STP = pkl.load(pth+ '/GEO/regular/clusters.bz')
elif REL == '106':
pth = ''.join(PT_ROT.split('/'+REL)).replace('/sim/', '')
STP = pkl.load(pth+ '/GEO/cluster_2/clusters.bz')
# Spatial condensed ---------------------------------------------------
elif REL == '265P':
pth = ''.join(PT_ROT.split('/'+REL)).replace('/sim/', '')
STP = pkl.load(pth+ '/GEO/cluster_1/SPAN/clusters.bz')
elif REL == '505P':
pth = ''.join(PT_ROT.split('/'+REL)).replace('/sim/', '')
STP = pkl.load(pth+ '/GEO/regular/SPAN/clusters.bz')
elif REL == '106P':
pth = ''.join(PT_ROT.split('/'+REL)).replace('/sim/', '')
STP = pkl.load(pth+ '/GEO/cluster_2/SPAN/clusters.bz')
# Return --------------------------------------------------------------
return STP
else:
PAN = ([0], )
return PAN
def landPopSelector(REL, PT_ROT):
if (REL=='265') or (REL=='265P'):
PT_UAS = path.join(
''.join(PT_ROT.split('/'+REL)).replace('/sim/', ''),
'GEO', 'cluster_1', 'stp_cluster_sites_pop_v5_fixed.csv'
)
elif (REL=='505') or (REL=='505P'):
PT_UAS = path.join(
''.join(PT_ROT.split('/'+REL)).replace('/sim/', ''),
'GEO', 'regular', 'stp_all_sites_pop_v5_fixed.csv'
)
elif (REL=='106') or (REL=='106P'):
PT_UAS = path.join(
''.join(PT_ROT.split('/'+REL)).replace('/sim/', ''),
'GEO', 'cluster_2', 'stp_cluster_sites_pop_01_v5_fixed.csv'
)
return (PT_UAS, path.join(PT_ROT, 'video'))