@@ -45,28 +45,28 @@ def get_catalog(self):
45
45
return self .ALFALFACAT
46
46
47
47
result = requests .get (self .CATALOG_PREFIX )
48
- iterable_lines = result .iter_lines ( )
48
+ iterable_lines = result .text . split ( ' \n ' )
49
49
50
50
# Read header
51
- cols = [ col for col in next ( iterable_lines ). rstrip ( b' \n ' ). split (b ',' )]
51
+ cols = iterable_lines [ 0 ]. split (',' )
52
52
53
53
catalog = {}
54
54
for col in cols :
55
55
catalog [col ] = []
56
56
57
57
# Parse result
58
- for line in iterable_lines :
58
+ for line in iterable_lines [ 1 :] :
59
59
# skip blank lines or trailing newlines
60
60
if line == "" :
61
61
continue
62
- col_values = line .rstrip ( b' \n ' ). split (b ',' )
62
+ col_values = line .split (',' )
63
63
for i , col in enumerate (cols ):
64
64
item = col_values [i ].strip ()
65
65
if item == '\" \" ' :
66
66
catalog [col ].append (self .PLACEHOLDER )
67
67
elif item .isdigit ():
68
68
catalog [col ].append (int (item ))
69
- elif item .replace (b '.' , b '' ).isdigit ():
69
+ elif item .replace ('.' , '' ).isdigit ():
70
70
catalog [col ].append (float (item ))
71
71
else :
72
72
catalog [col ].append (item )
@@ -139,11 +139,11 @@ def query_region(self, coordinates, radius=3. * u.arcmin,
139
139
140
140
# Use RA and DEC to find appropriate AGC
141
141
if optical_counterpart :
142
- ra_ref = cat [b 'RAdeg_OC' ]
143
- dec_ref = cat [b 'DECdeg_OC' ]
142
+ ra_ref = cat ['RAdeg_OC' ]
143
+ dec_ref = cat ['DECdeg_OC' ]
144
144
else :
145
- ra_ref = cat [b 'RAdeg_HI' ]
146
- dec_ref = cat [b 'Decdeg_HI' ]
145
+ ra_ref = cat ['RAdeg_HI' ]
146
+ dec_ref = cat ['Decdeg_HI' ]
147
147
148
148
dra = np .abs (ra_ref - ra ) \
149
149
* np .cos (dec * np .pi / 180. )
@@ -155,7 +155,7 @@ def query_region(self, coordinates, radius=3. * u.arcmin,
155
155
156
156
# Matched object within our search radius?
157
157
if minsep < dr :
158
- return cat [b 'AGCNr' ][i_minsep ]
158
+ return cat ['AGCNr' ][i_minsep ]
159
159
else :
160
160
return None
161
161
@@ -185,7 +185,7 @@ def get_spectrum_async(self, agc, show_progress=True):
185
185
agc = str (agc ).zfill (6 )
186
186
187
187
link = "%s/A%s.fits" % (self .FITS_PREFIX , agc )
188
- result = commons .FileContainer (link , show_progress = show_progress , encoding = 'binary' )
188
+ result = commons .FileContainer (link , show_progress = show_progress )
189
189
return result
190
190
191
191
@prepend_docstr_nosections (get_spectrum_async .__doc__ )
0 commit comments