@@ -50,11 +50,11 @@ class ObservationsClass(MastQueryWithLogin):
50
50
"""
51
51
52
52
# Calling static class variables
53
- caom_all = 'Mast.Caom.All'
54
- caom_cone = 'Mast.Caom.Cone'
55
- caom_filtered_position = 'Mast.Caom.Filtered.Position'
56
- caom_filtered = 'Mast.Caom.Filtered'
57
- caom_products = 'Mast.Caom.Products'
53
+ _caom_all = 'Mast.Caom.All'
54
+ _caom_cone = 'Mast.Caom.Cone'
55
+ _caom_filtered_position = 'Mast.Caom.Filtered.Position'
56
+ _caom_filtered = 'Mast.Caom.Filtered'
57
+ _caom_products = 'Mast.Caom.Products'
58
58
59
59
def _parse_result (self , responses , verbose = False ): # Used by the async_to_sync decorator functionality
60
60
"""
@@ -87,7 +87,7 @@ def list_missions(self):
87
87
"""
88
88
89
89
# getting all the histogram information
90
- service = self .caom_all
90
+ service = self ._caom_all
91
91
params = {}
92
92
response = self ._portal_api_connection .service_request_async (service , params , format = 'extjs' )
93
93
json_response = response [0 ].json ()
@@ -117,9 +117,9 @@ def get_metadata(self, query_type):
117
117
"""
118
118
119
119
if query_type .lower () == "observations" :
120
- colconf_name = self .caom_cone
120
+ colconf_name = self ._caom_cone
121
121
elif query_type .lower () == "products" :
122
- colconf_name = self .caom_products
122
+ colconf_name = self ._caom_products
123
123
else :
124
124
raise InvalidQueryError ("Unknown query type." )
125
125
@@ -157,13 +157,13 @@ def _parse_caom_criteria(self, **criteria):
157
157
158
158
# Build the mashup filter object and store it in the correct service_name entry
159
159
if coordinates or objectname :
160
- mashup_filters = self ._portal_api_connection .build_filter_set (self .caom_cone ,
161
- self .caom_filtered_position ,
160
+ mashup_filters = self ._portal_api_connection .build_filter_set (self ._caom_cone ,
161
+ self ._caom_filtered_position ,
162
162
** criteria )
163
163
coordinates = utils .parse_input_location (coordinates , objectname )
164
164
else :
165
- mashup_filters = self ._portal_api_connection .build_filter_set (self .caom_cone ,
166
- self .caom_filtered ,
165
+ mashup_filters = self ._portal_api_connection .build_filter_set (self ._caom_cone ,
166
+ self ._caom_filtered ,
167
167
** criteria )
168
168
169
169
# handle position info (if any)
@@ -214,7 +214,7 @@ def query_region_async(self, coordinates, radius=0.2*u.deg, pagesize=None, page=
214
214
# if radius is just a number we assume degrees
215
215
radius = coord .Angle (radius , u .deg )
216
216
217
- service = self .caom_cone
217
+ service = self ._caom_cone
218
218
params = {'ra' : coordinates .ra .deg ,
219
219
'dec' : coordinates .dec .deg ,
220
220
'radius' : radius .deg }
@@ -291,12 +291,12 @@ def query_criteria_async(self, pagesize=None, page=None, **criteria):
291
291
raise InvalidQueryError ("At least one non-positional criterion must be supplied." )
292
292
293
293
if position :
294
- service = self .caom_filtered_position
294
+ service = self ._caom_filtered_position
295
295
params = {"columns" : "*" ,
296
296
"filters" : mashup_filters ,
297
297
"position" : position }
298
298
else :
299
- service = self .caom_filtered
299
+ service = self ._caom_filtered
300
300
params = {"columns" : "*" ,
301
301
"filters" : mashup_filters }
302
302
@@ -336,7 +336,7 @@ def query_region_count(self, coordinates, radius=0.2*u.deg, pagesize=None, page=
336
336
# turn coordinates into the format
337
337
position = ', ' .join ([str (x ) for x in (coordinates .ra .deg , coordinates .dec .deg , radius .deg )])
338
338
339
- service = self .caom_filtered_position
339
+ service = self ._caom_filtered_position
340
340
params = {"columns" : "COUNT_BIG(*)" ,
341
341
"filters" : [],
342
342
"position" : position }
@@ -404,12 +404,12 @@ def query_criteria_count(self, pagesize=None, page=None, **criteria):
404
404
405
405
# send query
406
406
if position :
407
- service = self .caom_filtered_position
407
+ service = self ._caom_filtered_position
408
408
params = {"columns" : "COUNT_BIG(*)" ,
409
409
"filters" : mashup_filters ,
410
410
"position" : position }
411
411
else :
412
- service = self .caom_filtered
412
+ service = self ._caom_filtered
413
413
params = {"columns" : "COUNT_BIG(*)" ,
414
414
"filters" : mashup_filters }
415
415
@@ -445,7 +445,7 @@ def get_product_list_async(self, observations):
445
445
if len (observations ) == 0 :
446
446
raise InvalidQueryError ("Observation list is empty, no associated products." )
447
447
448
- service = self .caom_products
448
+ service = self ._caom_products
449
449
params = {'obsid' : ',' .join (observations )}
450
450
451
451
return self ._portal_api_connection .service_request_async (service , params )
0 commit comments