Skip to content

Commit 66ba377

Browse files
jespinosaarbsipocz
authored andcommitted
Line 148- underline in title
1 parent 243f695 commit 66ba377

File tree

7 files changed

+438
-260
lines changed

7 files changed

+438
-260
lines changed

astroquery/jwst/__init__.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,27 @@ class Conf(_config.ConfigNamespace):
3535
"Name of Dec parameter in table")
3636

3737
JWST_ARTIFACT_TABLE = _config.ConfigItem("jwst.artifact",
38-
"JWST artifacts (data files) table.")
38+
"JWST artifacts "
39+
"(data files) table.")
3940

4041
JWST_OBSERVATION_TABLE = _config.ConfigItem("jwst.observation",
41-
"JWST observation table")
42+
"JWST observation table")
4243

4344
JWST_PLANE_TABLE = _config.ConfigItem("jwst.plane",
44-
"JWST plane table")
45+
"JWST plane table")
4546

46-
JWST_OBSERVATION_TABLE_RA = _config.ConfigItem("targetposition_coordinates_cval1",
47-
"Name of RA parameter in table")
47+
JWST_OBS_MEMBER_TABLE = _config.ConfigItem("jwst.observationmember",
48+
"JWST observation member table")
4849

49-
JWST_OBSERVATION_TABLE_DEC = _config.ConfigItem("targetposition_coordinates_cval2",
50-
"Name of Dec parameter in table")
50+
JWST_OBSERVATION_TABLE_RA = _config.ConfigItem("targetposition_"
51+
"coordinates_cval1",
52+
"Name of RA parameter "
53+
"in table")
54+
55+
JWST_OBSERVATION_TABLE_DEC = _config.ConfigItem("targetposition_"
56+
"coordinates_cval2",
57+
"Name of Dec parameter "
58+
"in table")
5159

5260

5361
conf = Conf()

astroquery/jwst/core.py

Lines changed: 395 additions & 225 deletions
Large diffs are not rendered by default.

astroquery/jwst/data_access.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
__all__ = ['JwstDataHandler']
2121

2222

23+
2324
class JwstDataHandler(object):
2425
def __init__(self, base_url=None):
2526
if base_url is None:
2627
self.base_url = "http://jwstdummydata.com"
2728
else:
2829
self.base_url = base_url
29-
30+
3031
def download_file(self, url):
31-
return data.download_file(url, cache=True )
32-
32+
return data.download_file(url, cache=True)
33+
3334
def clear_download_cache(self):
3435
data.clear_download_cache()

astroquery/jwst/tests/DummyDataHandler.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class DummyDataHandler(object):
2020

2121
def __init__(self):
22-
self.base_url="http://test/data?"
22+
self.base_url = "http://test/data?"
2323
self.__invokedMethod = None
2424
self.__parameters = {}
2525

@@ -35,9 +35,9 @@ def check_method(self, method):
3535
if method == self.__invokedMethod:
3636
return
3737
else:
38-
raise Exception("Method '"+str(method)
39-
+ "' not invoked. (Invoked method is '"
40-
+ str(self.__invokedMethod)+"')")
38+
raise Exception("Method '"+str(method) +
39+
"' not invoked. (Invoked method is '" +
40+
str(self.__invokedMethod)+"')")
4141

4242
def check_parameters(self, parameters, method_name):
4343
if parameters is None:
@@ -67,5 +67,3 @@ def download_file(self, url=None):
6767
self.__invokedMethod = 'download_file'
6868
self.__parameters['url'] = url
6969
return None
70-
71-

astroquery/jwst/tests/DummyTapHandler.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def check_method(self, method):
4848
if method == self.__invokedMethod:
4949
return
5050
else:
51-
raise Exception("Method '"+str(method)
52-
+ "' not invoked. (Invoked method is '"
53-
+ str(self.__invokedMethod)+"')")
51+
raise Exception("Method '"+str(method) +
52+
"' not invoked. (Invoked method is '" +
53+
str(self.__invokedMethod)+"')")
5454

5555
def check_parameters(self, parameters, method_name):
5656
if parameters is None:
@@ -183,7 +183,8 @@ def get_images_async(self, coordinate):
183183
return None
184184

185185
def cone_search(self, coordinate, radius, output_file=None,
186-
output_format="votable", verbose=False, dump_to_file=False):
186+
output_format="votable", verbose=False,
187+
dump_to_file=False):
187188
self.__invokedMethod = 'cone_search'
188189
self.__parameters['coordinate'] = coordinate
189190
self.__parameters['radius'] = radius
@@ -194,8 +195,8 @@ def cone_search(self, coordinate, radius, output_file=None,
194195
return None
195196

196197
def cone_search_async(self, coordinate, radius, background=False,
197-
output_file=None, output_format="votable", verbose=False,
198-
dump_to_file=False):
198+
output_file=None, output_format="votable",
199+
verbose=False, dump_to_file=False):
199200
self.__invokedMethod = 'cone_search_async'
200201
self.__parameters['coordinate'] = coordinate
201202
self.__parameters['radius'] = radius

astroquery/jwst/tests/test_jwsttap.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -902,18 +902,18 @@ def __check_extracted_files(self, files_expected, files_returned):
902902
if f not in files_returned:
903903
raise ValueError("Not found expected file: %s" % f)
904904

905-
def test_query_by_target_name(self):
905+
def test_query_target_name(self):
906906
jwst = JwstClass()
907907
# Testing default parameters
908908
with pytest.raises(ValueError) as err:
909-
jwst.query_by_target_name("M1", "")
909+
jwst.query_target_name("M1", "")
910910
assert "This target resolver is not allowed" in err.value.args[0]
911911
with pytest.raises(ValueError) as err:
912-
jwst.query_by_target_name("TEST")
912+
jwst.query_target_name("TEST")
913913
assert "This target name cannot be determined with this resolver:"\
914914
" ALL" in err.value.args[0]
915915
with pytest.raises(ValueError) as err:
916-
jwst.query_by_target_name("M1", "ALL")
916+
jwst.query_target_name("M1", "ALL")
917917
assert "Missing required argument: 'width'" in err.value.args[0]
918918

919919
# Testing no valid coordinates from resolvers
@@ -932,17 +932,17 @@ def test_query_by_target_name(self):
932932
coordinate_error = 'coordinate must be either a string or '\
933933
'astropy.coordinates'
934934
with pytest.raises(ValueError) as err:
935-
jwst.query_by_target_name("M1", "SIMBAD",
935+
jwst.query_target_name("M1", "SIMBAD",
936936
units.Quantity(5, units.deg))
937937
assert coordinate_error in err.value.args[0]
938938

939939
with pytest.raises(ValueError) as err:
940-
jwst.query_by_target_name("M1", "NED",
940+
jwst.query_target_name("M1", "NED",
941941
units.Quantity(5, units.deg))
942942
assert coordinate_error in err.value.args[0]
943943

944944
with pytest.raises(ValueError) as err:
945-
jwst.query_by_target_name("M1", "VIZIER",
945+
jwst.query_target_name("M1", "VIZIER",
946946
units.Quantity(5, units.deg))
947947
assert coordinate_error in err.value.args[0]
948948

@@ -972,19 +972,19 @@ def test_query_by_target_name(self):
972972
with open(data_path('test_query_by_target_name_simbad_query.txt'),
973973
'r') as file:
974974
parameters['query'] = file.read()
975-
jwst.query_by_target_name("M1", "SIMBAD",
975+
jwst.query_target_name("M1", "SIMBAD",
976976
units.Quantity(5, units.deg))
977977
dummyTapHandler.check_call('launch_job', parameters)
978978
with open(data_path('test_query_by_target_name_ned_query.txt'),
979979
'r') as file:
980980
parameters['query'] = file.read()
981-
jwst.query_by_target_name("M1", "NED",
981+
jwst.query_target_name("M1", "NED",
982982
units.Quantity(5, units.deg))
983983
dummyTapHandler.check_call('launch_job', parameters)
984984
with open(data_path('test_query_by_target_name_vizier_query.txt'),
985985
'r') as file:
986986
parameters['query'] = file.read()
987-
jwst.query_by_target_name("M1", "VIZIER",
987+
jwst.query_target_name("M1", "VIZIER",
988988
units.Quantity(5, units.deg))
989989
dummyTapHandler.check_call('launch_job', parameters)
990990

docs/jwst/jwst.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Examples
145145
0.8042331552744052 00000000-0000-0000-babe-5c1ec63d3301 ... PRIME S
146146
147147
1.3. Query by target name
148-
~~~~~~~~~~~~~~~~~~~~~~~~
148+
~~~~~~~~~~~~~~~~~~~~~~~~~
149149

150150
To provide the target coordinates based on its name and execute the query region method.
151151
It uses three different catalogs to resolve the coordinates: SIMBAD, NED and VIZIER. An additional target
@@ -161,7 +161,7 @@ element in the list if the target name cannot be resolved).
161161
>>> target_name = 'M1'
162162
>>> target_resolver = 'ALL'
163163
>>> radius = u.Quantity(5, u.deg)
164-
>>> r = Jwst.query_by_target_name(target_name = target_name, target_resolver = target_resolver, radius = radius)
164+
>>> r = Jwst.query_target_name(target_name = target_name, target_resolver = target_resolver, radius = radius)
165165
>>> r.pprint()
166166
167167
dist observationid ...
@@ -193,7 +193,7 @@ This method uses the same parameters as query region, but also includes the targ
193193
>>> target_resolver = 'NED'
194194
>>> width = u.Quantity(5, u.deg)
195195
>>> height = u.Quantity(5, u.deg)
196-
>>> r = Jwst.query_by_target_name(target_name = target_name, target_resolver = target_resolver, width = width, height = height)
196+
>>> r = Jwst.query_target_name(target_name = target_name, target_resolver = target_resolver, width = width, height = height)
197197
>>> r.pprint()
198198
199199
dist observationid ...

0 commit comments

Comments
 (0)