-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlwo_parse_nasa.py
executable file
·57 lines (45 loc) · 1.58 KB
/
lwo_parse_nasa.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
#!/usr/bin/env python
import logging
from glob import glob
from pprint import pprint
from lwo_strut.lwoObject import lwoObject
#from lwo_strut.lwoObjectOld import lwoObject
from scripts.lwo_helper import LwoFile
def main():
# #infile = "../NASA-3D-Resources/3D Models/Aquarius (A)/Aquarius-2010-Composite.lwo"
# #infile = "../NASA-3D-Resources/3D Models/Atmosphere-Space Transition Region Explorer/Astre-main3.lwo"
# #infile = "../NASA-3D-Resources/3D Models/Aura/Aura_2013-2.lwo"
# infile = "../NASA-3D-Resources/3D Models/Gamma Ray Observatory - Composite/GRO-Composite.lwo"
# f = LwoFile(infile, create_pickle=True)
# f.check_file()
infiles = glob("../NASA-3D-Resources/**/*.[Ll][Ww][Oo]", recursive=True)
#infiles = infiles[:3]
#print(infiles)
#exit()
#infiles = ["/home/gomez/project/NASA-3D-Resources/3D Models/RADARsat-Composite/RADARsat-Composite.lwo",]
for infile in infiles:
print(infile)
try:
x = lwoObject(infile, logging.DEBUG)
x.read()
except:
print(infile)
raise
y = x.elements
f = LwoFile(infile, create_pickle=False)
f.check_file()
f.setup_pickle(y)
b = f.load_pickle()
if b is None:
return
#print(y == b)
if not y == b:
for k in y.keys():
if not y[k] == b[k]:
print(f'{k}')
# pprint(y[k])
# pprint(b[k])
# raise
#exit()
if __name__ == "__main__":
main()