-
Notifications
You must be signed in to change notification settings - Fork 2
/
gz4_sloan_ukidss.py
115 lines (112 loc) · 7.18 KB
/
gz4_sloan_ukidss.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
convert={
('sloan-0','a-0'):1, ('sloan-0','a-1'):2, ('sloan-0','a-2'):3,
('sloan-1','a-0'):4, ('sloan-1','a-1'):5,
('sloan-2','a-0'):6, ('sloan-2','a-1'):7,
('sloan-3','a-0'):8, ('sloan-3','a-1'):9,
('sloan-4','a-0'):10, ('sloan-4','a-1'):11, ('sloan-4','a-2'):12, ('sloan-4','a-3'):13,
('sloan-5','a-0'):-1, ('sloan-5','a-1'):-1,
('sloan-6','a-0'):-1,
('sloan-7','a-0'):24, ('sloan-7','a-1'):25, ('sloan-7','a-2'):26,
('sloan-8','a-0'):27, ('sloan-8','a-1'):28, ('sloan-8','a-2'):29,
('sloan-9','a-0'):30, ('sloan-9','a-1'):31, ('sloan-9','a-2'):32,
('sloan-10','a-0'):33, ('sloan-10','a-1'):34, ('sloan-10','a-2'):35, ('sloan-10','a-3'):36, ('sloan-10','a-4'):37, ('sloan-10','a-5'):38,
('sloan-11','a-0'):-1, ('sloan-11','a-1'):-1,
('ukidss-0','a-0'):1, ('ukidss-0','a-1'):2, ('ukidss-0','a-2'):3,
('ukidss-1','a-0'):4, ('ukidss-1','a-1'):5,
('ukidss-2','a-0'):6, ('ukidss-2','a-1'):7,
('ukidss-3','a-0'):8, ('ukidss-3','a-1'):9,
('ukidss-4','a-0'):10, ('ukidss-4','a-1'):11, ('ukidss-4','a-2'):12, ('ukidss-4','a-3'):13,
('ukidss-5','a-0'):-1, ('ukidss-5','a-1'):-1,
('ukidss-6','a-0'):-1,
('ukidss-7','a-0'):24, ('ukidss-7','a-1'):25, ('ukidss-7','a-2'):26,
('ukidss-8','a-0'):27, ('ukidss-8','a-1'):28, ('ukidss-8','a-2'):29,
('ukidss-9','a-0'):30, ('ukidss-9','a-1'):31, ('ukidss-9','a-2'):32,
('ukidss-10','a-0'):33, ('ukidss-10','a-1'):34, ('ukidss-10','a-2'):35, ('ukidss-10','a-3'):36, ('ukidss-10','a-4'):37, ('ukidss-10','a-5'):38,
('ukidss-11','a-0'):-1, ('ukidss-11','a-1'):-1,
'a-0':16, 'x-0':17, 'x-1':18, 'x-2':19, 'x-3':20, 'x-4':21, 'x-5':22, 'x-6':23}
def valid_path(p):
if (p[-1]!=-1) and (p[-1]!=3):
return False
l=len(p)
valid=True
for i in range(l-1):
valid = (valid) and (p[i+1] in vp[p[i]])
if not valid:
return valid
return valid
vp={
-1:[-1],
0: [1,2,3],
1: [24,25,26],
2: [4,5],
3: [-1],
4: [27,28,29],
5: [6,7],
6: [8,9],
7: [8,9],
8: [30,31,32],
9: [10,11,12,13],
10: [-1],
11: [-1],
12: [-1],
13: [-1],
14: [-1],
15: [-1],
16: [-1],
24: [-1],
25: [-1],
26: [-1],
27: [-1],
28: [-1],
29: [-1],
30: [33,34,35,36,37,38],
31: [33,34,35,36,37,38],
32: [33,34,35,36,37,38],
33: [10,11,12,13],
34: [10,11,12,13],
35: [10,11,12,13],
36: [10,11,12,13],
37: [10,11,12,13],
38: [10,11,12,13]}
nodes=[
{"group": 0, "question": "", "name": "All", "answer_id": 0},
{"group": 1, "question": "Is the galaxy simply smooth and rounded, with no sign of a disk?", "name": "Smooth", "answer_id": 1},
{"group": 2, "question": "Is the galaxy simply smooth and rounded, with no sign of a disk?", "name": "Features or disk", "answer_id": 2},
{"group": 4, "question": "Is the galaxy simply smooth and rounded, with no sign of a disk?", "name": "Star or artifact", "answer_id": 3},
{"group": 2, "question": "Could this be a disk viewed edge-on?", "name": "Yes", "answer_id": 4},
{"group": 3, "question": "Could this be a disk viewed edge-on?", "name": "No", "answer_id": 5},
{"group": 3, "question": "Is there a sign of a bar feature through the centre of the galaxy?", "name": "Bar", "answer_id": 6},
{"group": 3, "question": "Is there a sign of a bar feature through the centre of the galaxy?", "name": "No bar", "answer_id": 7},
{"group": 3, "question": "Is there any sign of a spiral arm pattern?", "name": "Spiral", "answer_id": 8},
{"group": 3, "question": "Is there any sign of a spiral arm pattern?", "name": "No spiral", "answer_id": 9},
{"group": 3, "question": "How prominent is the central bulge, compared with the rest of the galaxy?", "name": "No bulge", "answer_id": 10},
{"group": 3, "question": "How prominent is the central bulge, compared with the rest of the galaxy?", "name": "Just noticeable", "answer_id": 11},
{"group": 3, "question": "How prominent is the central bulge, compared with the rest of the galaxy?", "name": "Obvious", "answer_id": 12},
{"group": 3, "question": "How prominent is the central bulge, compared with the rest of the galaxy?", "name": "Dominant", "answer_id": 13},
{"group": 5, "question": "Is there anything odd?", "name": "Yes", "answer_id": 14},
{"group": 5, "question": "Is there anything odd?", "name": "No", "answer_id": 15},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy distrubed or irregular?", "name": "Done", "answer_id": 16},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Ring", "answer_id": 17},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Lens or arc", "answer_id": 18},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Disturbed", "answer_id": 19},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Irregular", "answer_id": 20},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Other", "answer_id": 21},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Merger", "answer_id": 22},
{"group": 5, "question": "Is the odd feature a ring, or is the galaxy disturbed or irregular?", "name": "Dust lane", "answer_id": 23},
{"group": 1, "question": "How rounded is it?", "name": "Completely round", "answer_id": 24},
{"group": 1, "question": "How rounded is it?", "name": "In between", "answer_id": 25},
{"group": 1, "question": "How rounded is it?", "name": "Cigar shaped", "answer_id": 26},
{"group": 2, "question": "Does the galaxy have a bulge at its centre? If so, what shape?", "name": "Rounded", "answer_id": 27},
{"group": 2, "question": "Does the galaxy have a bulge at its centre? If so, what shape?", "name": "Boxy", "answer_id": 28},
{"group": 2, "question": "Does the galaxy have a bulge at its centre? If so, what shape?", "name": "No bulge", "answer_id": 29},
{"group": 3, "question": "How tightly wound do the spiral arms appear?", "name": "Tight", "answer_id": 30},
{"group": 3, "question": "How tightly wound do the spiral arms appear?", "name": "Medium", "answer_id": 31},
{"group": 3, "question": "How tightly wound do the spiral arms appear?", "name": "Loose", "answer_id": 32},
{"group": 3, "question": "How many spiral arms are there?", "name": "1", "answer_id": 33},
{"group": 3, "question": "How many spiral arms are there?", "name": "2", "answer_id": 34},
{"group": 3, "question": "How many spiral arms are there?", "name": "3", "answer_id": 35},
{"group": 3, "question": "How many spiral arms are there?", "name": "4", "answer_id": 36},
{"group": 3, "question": "How many spiral arms are there?", "name": "More than 4", "answer_id": 37},
{"group": 3, "question": "How many spiral arms are there?", "name": "Can't tell", "answer_id": 38},
{"group": 5, "question": "Would you like to discuss this object?", "name": "Yes", "answer_id": 39},
{"group": 5, "question": "Would you like to discuss this object?", "name": "No", "answer_id": 40}]