diff --git a/SearchAPI/CMR/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index 15ee1db3..cea57a6d 100644 --- a/SearchAPI/CMR/Translate/datasets.py +++ b/SearchAPI/CMR/Translate/datasets.py @@ -114,8 +114,8 @@ "OPERA-S1": [ "C2777443834-ASF", "C2777436413-ASF", - "C2795135174-ASF", # RTC-STATIC - "C2795135668-ASF", # CSLC-STATIC + "C2795135174-ASF", # RTC-STATIC + "C2795135668-ASF", # CSLC-STATIC "C1258354200-ASF", # maybe extra? "C1259982010-ASF", "C1257995185-ASF", @@ -368,4 +368,71 @@ "C1206752770-ASF", "C1206144699-ASF", ], + # TODO: add check for item['umm']['SpatialExtent']['GranuleSpatialRepresentation'] == 'NO_SPATIAL' + "NISAR": [ # TEST ASFDEV + "C1258125097-ASFDEV", + "C1258290319-ASFDEV", + "C1258301530-ASFDEV", + "C1256535568-ASFDEV", + "C1256574227-ASFDEV", + "C1256579794-ASFDEV", + "C1256535570-ASFDEV", + "C1256583888-ASFDEV", + "C1257088418-ASFDEV", + "C1256578011-ASFDEV", + "C1256583659-ASFDEV", + "C1256737727-ASFDEV", + "C1256729502-ASFDEV", + "C1256832018-ASFDEV", + "C1256944038-ASFDEV", + "C1256802323-ASFDEV", + "C1256938783-ASFDEV", + "C1256621478-ASFDEV", + "C1256622937-ASFDEV", + "C1256983900-ASFDEV", + "C1256984645-ASFDEV", + "C1261630276-ASFDEV", + "C1258290319-ASFDEV", + # TEST + "C1258836794-ASF", + "C1258836797-ASF", + "C1258836800-ASF", + "C1257349089-ASF", + "C1257349088-ASF", + "C1257349083-ASF", + "C1257349082-ASF", + "C1257349081-ASF", + "C1257349079-ASF", + "C1257349074-ASF", + "C1257349073-ASF", + "C1257349072-ASF", + "C1257349067-ASF", + "C1257349066-ASF", + "C1257349065-ASF", + "C1257349063-ASF", + "C1257349059-ASF", + "C1257349054-ASF", + "C1257349053-ASF", + "C1257349048-ASF", + "C1257349023-ASF", + # PROD + "C2727913056-ASF", + "C2727908375-ASF", + "C2727912431-ASF", + "C2727904608-ASF", + "C2727903976-ASF", + "C2727904134-ASF", + "C2727911748-ASF", + "C2727913362-ASF", + "C2727907155-ASF", + "C2727907520-ASF", + "C2727908129-ASF", + "C2727912739-ASF", + "C2727913160-ASF", + "C2727904769-ASF", + "C2727905298-ASF", + "C2727905020-ASF", + "C2727904288-ASF", + "C2727907902-ASF", + ], } diff --git a/SearchAPI/CMR/Translate/parse_cmr_response.py b/SearchAPI/CMR/Translate/parse_cmr_response.py index 1296c3cb..29b2c0e9 100644 --- a/SearchAPI/CMR/Translate/parse_cmr_response.py +++ b/SearchAPI/CMR/Translate/parse_cmr_response.py @@ -238,16 +238,19 @@ def wkt_from_gpolygon(gpoly): # Close the shape if needed shapes[-1].append(shapes[-1][0]) - longest = shapes[0] - for shape in shapes: - if len(shape) > len(longest): - longest = shape - - wkt_shape = 'POLYGON(({0}))'.format( - ','.join(['{0} {1}'.format(x['lon'], x['lat']) for x in longest]) - ) + if len(shapes): + longest = shapes[0] + for shape in shapes: + if len(shape) > len(longest): + longest = shape + + wkt_shape = 'POLYGON(({0}))'.format( + ','.join(['{0} {1}'.format(x['lon'], x['lat']) for x in longest]) + ) - return longest, wkt_shape + return longest, wkt_shape + + return '', '' def shape_not_closed(shapes):