@@ -54,6 +54,7 @@ class ESASkyClass(BaseQuery):
54
54
__TAP_DEC_COLUMN_STRING = "tapDecColumn"
55
55
__METADATA_STRING = "metadata"
56
56
__PRODUCT_URL_STRING = "product_url"
57
+ __EROSITA_PRODUCT_URL_STRING = "prod_url"
57
58
__ACCESS_URL_STRING = "access_url"
58
59
__USE_INTERSECT_STRING = "useIntersectPolygonInsteadOfContainsPoint"
59
60
__ZERO_ARCMIN_STRING = "0 arcmin"
@@ -1464,6 +1465,8 @@ def _get_maps_for_mission(self, maps_table, mission, download_dir, cache, json,
1464
1465
url_key = self .__PRODUCT_URL_STRING
1465
1466
if url_key == "" and self .__ACCESS_URL_STRING in maps_table .keys ():
1466
1467
url_key = self .__ACCESS_URL_STRING
1468
+ if url_key == "" and mission == 'EROSITA' :
1469
+ url_key = self .__EROSITA_PRODUCT_URL_STRING
1467
1470
if url_key == "" or mission == "ALMA" :
1468
1471
log .info (mission + " does not yet support downloading of fits files" )
1469
1472
return maps
@@ -1520,13 +1523,20 @@ def _get_maps_for_mission(self, maps_table, mission, download_dir, cache, json,
1520
1523
1521
1524
response .raise_for_status ()
1522
1525
1523
- if ('Content-Type' in response .headers
1524
- and response .headers ['Content-Type' ] == 'application/zip' ):
1526
+ if response .headers .get ('Content-Type' ) == 'application/zip' :
1525
1527
with ZipFile (file = BytesIO (response .content )) as zip :
1526
1528
for info in zip .infolist ():
1527
1529
if self ._ends_with_fits_like_extentsion (info .filename ):
1528
1530
maps .append (self ._open_fits (
1529
1531
zip .extract (info .filename , path = mission_directory ), verbose = verbose ))
1532
+ elif response .headers .get ('Content-Type' ) == 'application/x-gzip' :
1533
+ with esatar .open (name = 'dummy' , mode = 'r' , fileobj = BytesIO (response .content )) as tar :
1534
+ for file in tar .getmembers ():
1535
+ if self ._ends_with_fits_like_extentsion (file .name ):
1536
+ file .name = os .path .basename (file .name )
1537
+ tar .extract (file , path = mission_directory )
1538
+ maps .append (self ._open_fits (
1539
+ Path (mission_directory , file .name ), verbose = verbose ))
1530
1540
else :
1531
1541
file_name = self ._extract_file_name_from_response_header (response .headers )
1532
1542
if file_name == "" :
0 commit comments