Skip to content

Commit

Permalink
fix ALMA remote tests, which had broken both because of an update to
Browse files Browse the repository at this point in the history
column names and because G0.25 is no longer considered to be Sgr A*
(which is good)
  • Loading branch information
keflavich committed Jan 11, 2017
1 parent 7709083 commit cc8b5e9
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions astroquery/alma/tests/test_alma_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ def test_SgrAstar(self, temp_dir):
alma.cache_location = temp_dir

result_s = alma.query_object('Sgr A*')
assert b'2011.0.00217.S' in result_s['Project code']
assert b'2011.0.00887.S' in result_s['Project code']
c = coordinates.SkyCoord(266.41681662 * u.deg, -29.00782497 * u.deg,
frame='fk5')
result_c = alma.query_region(c, 1 * u.deg)
assert b'2011.0.00887.S' in result_c['Project code']
# "The Brick", g0.253, is in this one
assert b'2011.0.00217.S' in result_c['Project code']

def test_m83(self, temp_dir, recwarn):
Expand Down Expand Up @@ -91,19 +93,14 @@ def test_stage_data(self, temp_dir, recwarn):
alma.cache_location = temp_dir

result_s = alma.query_object('Sgr A*')
assert b'2011.0.00217.S' in result_s['Project code']
# UID comes from:
# 2011.0.00217.S G0.25+0.02 266.53995833333346 -28.709500000000009 3 1.4544413048949709 976.5625 2280.739 2013-09-07 [86.26..88.14GHz,976.56kHz,null] U [88.15..90.03GHz,976.56kHz,null] U [98.19..100.07GHz,976.56kHz,null] U [100.15..102.03GHz,976.56kHz,null] 3110.9112850878114 XX YY 2012-07-29 02:01:54 Rathborne, Jill 1.7593164 uid://A002/X391d0b/X7b uid://A002/X47aefc/X369 Globular cluster formation: caught in the act S TARGET 365.55225721174787 Y 7
# (this information is included in comments because the ALMA archive
# has apparently changed UIDs, but the associated data should never go
# missing)
assert b'uid://A002/X47aefc/X369' in result_s['Asdm uid']
match = result_s['Asdm uid'] == b'uid://A002/X47aefc/X369'
assert b'2011.0.00887.S' in result_s['Project code']
assert b'uid://A002/X40d164/X1b3' in result_s['Asdm uid']
match = result_s['Asdm uid'] == b'uid://A002/X40d164/X1b3'
uid = result_s['Asdm uid'][match]

result = alma.stage_data(uid)

assert ('uid___A002_X47aefc' in
assert ('uid___A002_X40d164_X1b3' in
os.path.split(result['URL'][0])[1])

# test re-staging
Expand All @@ -128,7 +125,8 @@ def test_doc_example(self, temp_dir):
alma2.cache_location = temp_dir
m83_data = alma.query_object('M83')
# the order can apparently sometimes change
assert set(m83_data.colnames) == set(all_colnames)
# These column names change too often to keep testing.
#assert set(m83_data.colnames) == set(all_colnames)
galactic_center = coordinates.SkyCoord(0 * u.deg, 0 * u.deg,
frame='galactic')
gc_data = alma.query_region(galactic_center, 1 * u.deg)
Expand Down

0 comments on commit cc8b5e9

Please sign in to comment.