Skip to content

Commit ce33b8b

Browse files
jaymedinaburnout87
authored andcommitted
init variables under PortalAPI in discovery_portal.py. also code cleanup.
1 parent df026a0 commit ce33b8b

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

astroquery/mast/discovery_portal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ def __init__(self, session=None):
133133
self._column_configs = dict()
134134
self._current_service = None
135135

136+
self.tess_all_name = 'Mast.Catalogs.All.Tic'
137+
self.dd_all_name = 'Mast.Catalogs.All.Disk.Detective'
138+
136139
def _request(self, method, url, params=None, data=None, headers=None,
137140
files=None, stream=False, auth=None, retrieve_all=True):
138141
"""
@@ -238,10 +241,10 @@ def _get_col_config(self, service, fetch_name=None):
238241

239242
more = False # for some catalogs this is not enough information
240243
if "tess" in fetch_name.lower():
241-
all_name = "Mast.Catalogs.All.Tic"
244+
all_name = self.test_all_name
242245
more = True
243246
elif "dd." in fetch_name.lower():
244-
all_name = "Mast.Catalogs.All.DiskDetective"
247+
all_name = self.dd_all_name
245248
more = True
246249

247250
if more:

astroquery/mast/observations.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
This module contains various methods for querying MAST observations.
77
"""
88

9-
10-
import ctypes
119
import warnings
1210
import json
1311
import time
1412
import os
15-
import sys
1613
import uuid
1714

1815
import numpy as np
@@ -40,8 +37,6 @@
4037
from . import conf, utils
4138
from .core import MastQueryWithLogin
4239

43-
import astroquery
44-
4540
__all__ = ['Observations', 'ObservationsClass',
4641
'MastClass', 'Mast']
4742

@@ -91,10 +86,8 @@ def list_missions(self):
9186
List of available missions.
9287
"""
9388

94-
# calling `service` variable
95-
service = self.caom_all
96-
9789
# getting all the histogram information
90+
service = self.caom_all
9891
params = {}
9992
response = self._portal_api_connection.service_request_async(service, params, format='extjs')
10093
json_response = response[0].json()
@@ -108,7 +101,6 @@ def list_missions(self):
108101
missions.remove('hist')
109102
return missions
110103

111-
112104
def get_metadata(self, query_type):
113105
"""
114106
Returns metadata about the requested query type.
@@ -170,7 +162,8 @@ def _parse_caom_criteria(self, **criteria):
170162
**criteria)
171163
coordinates = utils.parse_input_location(coordinates, objectname)
172164
else:
173-
mashup_filters = self._portal_api_connection.build_filter_set(self.caom_cone, self.caom_filtered,
165+
mashup_filters = self._portal_api_connection.build_filter_set(self.caom_cone,
166+
self.caom_filtered,
174167
**criteria)
175168

176169
# handle position info (if any)

0 commit comments

Comments
 (0)