@@ -92,7 +92,7 @@ def list_missions(self):
92
92
"""
93
93
94
94
# calling `service` variable
95
- service = Observations .caom_all
95
+ service = self .caom_all
96
96
97
97
# getting all the histogram information
98
98
params = {}
@@ -125,9 +125,9 @@ def get_metadata(self, query_type):
125
125
"""
126
126
127
127
if query_type .lower () == "observations" :
128
- colconf_name = ObservationsClass .caom_cone
128
+ colconf_name = self .caom_cone
129
129
elif query_type .lower () == "products" :
130
- colconf_name = ObservationsClass .caom_products
130
+ colconf_name = self .caom_products
131
131
else :
132
132
raise InvalidQueryError ("Unknown query type." )
133
133
@@ -165,14 +165,13 @@ def _parse_caom_criteria(self, **criteria):
165
165
166
166
# Build the mashup filter object and store it in the correct service_name entry
167
167
if coordinates or objectname :
168
- mashup_filters = self ._portal_api_connection .build_filter_set (ObservationsClass .caom_cone ,
169
- ObservationsClass .caom_filtered_position ,
170
- ** criteria )
168
+ mashup_filters = self ._portal_api_connection .build_filter_set (self .caom_cone ,
169
+ self .caom_filtered_position ,
170
+ ** criteria )
171
171
coordinates = utils .parse_input_location (coordinates , objectname )
172
172
else :
173
- mashup_filters = self ._portal_api_connection .build_filter_set (ObservationsClass .caom_cone ,
174
- ObservationsClass .caom_filtered ,
175
- ** criteria )
173
+ mashup_filters = self ._portal_api_connection .build_filter_set (self .caom_cone , self .caom_filtered ,
174
+ ** criteria )
176
175
177
176
# handle position info (if any)
178
177
position = None
@@ -222,7 +221,7 @@ def query_region_async(self, coordinates, radius=0.2*u.deg, pagesize=None, page=
222
221
# if radius is just a number we assume degrees
223
222
radius = coord .Angle (radius , u .deg )
224
223
225
- service = ObservationsClass .caom_cone
224
+ service = self .caom_cone
226
225
params = {'ra' : coordinates .ra .deg ,
227
226
'dec' : coordinates .dec .deg ,
228
227
'radius' : radius .deg }
@@ -299,12 +298,12 @@ def query_criteria_async(self, pagesize=None, page=None, **criteria):
299
298
raise InvalidQueryError ("At least one non-positional criterion must be supplied." )
300
299
301
300
if position :
302
- service = ObservationsClass .caom_filtered_position
301
+ service = self .caom_filtered_position
303
302
params = {"columns" : "*" ,
304
303
"filters" : mashup_filters ,
305
304
"position" : position }
306
305
else :
307
- service = ObservationsClass .caom_filtered
306
+ service = self .caom_filtered
308
307
params = {"columns" : "*" ,
309
308
"filters" : mashup_filters }
310
309
@@ -344,7 +343,7 @@ def query_region_count(self, coordinates, radius=0.2*u.deg, pagesize=None, page=
344
343
# turn coordinates into the format
345
344
position = ', ' .join ([str (x ) for x in (coordinates .ra .deg , coordinates .dec .deg , radius .deg )])
346
345
347
- service = ObservationsClass .caom_filtered_position
346
+ service = self .caom_filtered_position
348
347
params = {"columns" : "COUNT_BIG(*)" ,
349
348
"filters" : [],
350
349
"position" : position }
@@ -412,12 +411,12 @@ def query_criteria_count(self, pagesize=None, page=None, **criteria):
412
411
413
412
# send query
414
413
if position :
415
- service = ObservationsClass .caom_filtered_position
414
+ service = self .caom_filtered_position
416
415
params = {"columns" : "COUNT_BIG(*)" ,
417
416
"filters" : mashup_filters ,
418
417
"position" : position }
419
418
else :
420
- service = ObservationsClass .caom_filtered
419
+ service = self .caom_filtered
421
420
params = {"columns" : "COUNT_BIG(*)" ,
422
421
"filters" : mashup_filters }
423
422
@@ -453,7 +452,7 @@ def get_product_list_async(self, observations):
453
452
if len (observations ) == 0 :
454
453
raise InvalidQueryError ("Observation list is empty, no associated products." )
455
454
456
- service = ObservationsClass .caom_products
455
+ service = self .caom_products
457
456
params = {'obsid' : ',' .join (observations )}
458
457
459
458
return self ._portal_api_connection .service_request_async (service , params )
0 commit comments