##// END OF EJS Templates
Improved AMDA tree, uses node names instead of xml:id which is more...
jeandet -
r1502:239919e8e177
parent child
Show More
@@ -1,4 +1,5
1 build/
1 build/
2 _build/
2 CMakeLists.txt.user
3 CMakeLists.txt.user
3 /.project
4 /.project
4 core/src/Version.cpp
5 core/src/Version.cpp
@@ -81,7 +81,13 class AmdaProvider(PyDataProvider):
81
81
82 products = []
82 products = []
83 for key, parameter in parameters.items():
83 for key, parameter in parameters.items():
84 path = f"/AMDA/{parameter['mission']}/{parameter.get('observatory','')}/{parameter['instrument']}/{parameter['dataset']}/{parameter['name']}"
84 mission_name = amda.mission[parameter['mission']]['name']
85 observatory_name = parameter.get('observatory','')
86 if observatory_name != '':
87 observatory_name = amda.observatory[observatory_name]['name']
88 instrument_name = amda.instrument[parameter['instrument']]['name']
89 dataset_name = amda.dataset[parameter['dataset']]['name']
90 path = f"/AMDA/{mission_name}/{observatory_name}/{instrument_name}/{dataset_name}/{parameter['name']}"
85 components = [component['name'] for component in parameter.get('components',[])]
91 components = [component['name'] for component in parameter.get('components',[])]
86 metadata = {key: item for key, item in parameter.items() if key is not 'components'}
92 metadata = {key: item for key, item in parameter.items() if key is not 'components'}
87 n_components = parameter.get('size', 0)
93 n_components = parameter.get('size', 0)
@@ -95,8 +101,9 class AmdaProvider(PyDataProvider):
95 metadata["type"] = "scalar"
101 metadata["type"] = "scalar"
96 products.append(Product(path, components, metadata))
102 products.append(Product(path, components, metadata))
97 self.register_products(products)
103 self.register_products(products)
98 for mission in amda.mission:
104 for _,mission in amda.mission.items():
99 self.set_icon(f'/AMDA/{mission}','satellite')
105 if ('target' in mission) and (mission['xml:id'] != 'Ephemerides') and (mission['target'] != 'Earth'):
106 self.set_icon(f'/AMDA/{mission["name"]}','satellite')
100
107
101 def get_data(self, metadata, start, stop):
108 def get_data(self, metadata, start, stop):
102 ts_type = amda_make_scalar
109 ts_type = amda_make_scalar
General Comments 0
You need to be logged in to leave comments. Login now