Added handling of tar file data products
@@ -887,7 +887,12 @@ class ESASkyClass(BaseQuery):
file_name = self._extract_file_name_from_response_header(response.headers)
if (file_name == ""):
file_name = self._extract_file_name_from_url(product_url)
-
+ if(file_name.lower().endswith("tar")):
+ with tarfile.open(fileobj=BytesIO(response.content)) as tar:
+ for member in tar.getmembers():
+ tar.extract(member, directory_path)
+ maps.append(fits.open(directory_path + member.name))
+ else:
fits_data = response.content
with open(directory_path + file_name, 'wb') as fits_file:
fits_file.write(fits_data)
