Skip to content

Commit c026e1b

Browse files
committed
refactor xmm_newton download to use astroquery tools
1 parent 7609419 commit c026e1b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

astroquery/esa/xmm_newton/core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def download_data(self, observation_id, *, filename=None, verbose=False,
110110
if verbose:
111111
log.info(link)
112112

113-
response = self._request('GET', link, save=False, cache=True)
113+
response = self._request('HEAD', link, save=False, cache=False)
114114

115115
# Get original extension
116116
_, params = cgi.parse_header(response.headers['Content-Disposition'])
@@ -122,9 +122,7 @@ def download_data(self, observation_id, *, filename=None, verbose=False,
122122

123123
filename += "".join(suffixes)
124124

125-
log.info("Copying file to {0}...".format(filename))
126-
with open(filename, 'wb') as f:
127-
f.write(response.content)
125+
self._download_file(link, filename)
128126

129127
if verbose:
130128
log.info("Wrote {0} to {1}".format(link, filename))

0 commit comments

Comments
 (0)