From f96dbaf3e841b94ae173b02544cdbba1c600831c Mon Sep 17 00:00:00 2001 From: kim Date: Wed, 28 Feb 2024 08:16:36 -0900 Subject: [PATCH 1/5] adds empty nisar dataset --- SearchAPI/CMR/Translate/datasets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/SearchAPI/CMR/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index 15ee1db3..4d2c9d4a 100644 --- a/SearchAPI/CMR/Translate/datasets.py +++ b/SearchAPI/CMR/Translate/datasets.py @@ -368,4 +368,5 @@ "C1206752770-ASF", "C1206144699-ASF", ], + "NISAR": [] } From 2ff40bfb890b91a1b50726ec4282af49e5de3df5 Mon Sep 17 00:00:00 2001 From: kim Date: Wed, 28 Feb 2024 08:28:13 -0900 Subject: [PATCH 2/5] adds nisar uat dataset concept-ids --- SearchAPI/CMR/Translate/datasets.py | 38 ++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/SearchAPI/CMR/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index 4d2c9d4a..0e640dba 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,5 +368,37 @@ "C1206752770-ASF", "C1206144699-ASF", ], - "NISAR": [] + "NISAR": [ + "C1257349081-ASF", + "C1257349079-ASF", + "C1257349048-ASF", + "C1257349082-ASF", + "C1257349059-ASF", + "C1257349053-ASF", + "C1257349054-ASF", + "C1257349120-ASF", + "C1257349072-ASF", + "C1257349066-ASF", + "C1257349023-ASF", + "C1257349067-ASF", + "C1257349121-ASF", + "C1257349074-ASF", + "C1257349088-ASF", + "C1257349083-ASF", + "C1257349114-ASF", + "C1257349115-ASF", + "C1257349065-ASF", + "C1257349089-ASF", + "C1257349063-ASF", + "C1257349073-ASF", + "C1257349094-ASF", + "C1257349095-ASF", + "C1257349102-ASF", + "C1257349096-ASF", + "C1257349103-ASF", + "C1257349109-ASF", + "C1257349107-ASF", + "C1257349108-ASF", + "C1257349093-ASF", + ], } From 93af966c05a8d389aea4e572aa07bf375866fc8e Mon Sep 17 00:00:00 2001 From: kim Date: Wed, 28 Feb 2024 08:36:18 -0900 Subject: [PATCH 3/5] adds check for gpolygon, returns empty wkt if no gpolygon is parsed --- SearchAPI/CMR/Translate/parse_cmr_response.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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): From cec053ebcf9a74db4153bd845774b1b79d878d11 Mon Sep 17 00:00:00 2001 From: kim Date: Wed, 28 Feb 2024 08:53:26 -0900 Subject: [PATCH 4/5] comments out non-spatial collections, adds commented out spatial collection version --- SearchAPI/CMR/Translate/datasets.py | 57 +++++++++++++++++------------ 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/SearchAPI/CMR/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index 0e640dba..df97e4ef 100644 --- a/SearchAPI/CMR/Translate/datasets.py +++ b/SearchAPI/CMR/Translate/datasets.py @@ -369,28 +369,28 @@ "C1206144699-ASF", ], "NISAR": [ - "C1257349081-ASF", - "C1257349079-ASF", - "C1257349048-ASF", - "C1257349082-ASF", - "C1257349059-ASF", - "C1257349053-ASF", - "C1257349054-ASF", - "C1257349120-ASF", - "C1257349072-ASF", - "C1257349066-ASF", - "C1257349023-ASF", - "C1257349067-ASF", - "C1257349121-ASF", - "C1257349074-ASF", - "C1257349088-ASF", - "C1257349083-ASF", - "C1257349114-ASF", - "C1257349115-ASF", - "C1257349065-ASF", - "C1257349089-ASF", - "C1257349063-ASF", - "C1257349073-ASF", + # "C1257349081-ASF", # item['umm']['SpatialExtent']['GranuleSpatialRepresentation'] == 'NO_SPATIAL' + # "C1257349079-ASF", + # "C1257349048-ASF", + # "C1257349082-ASF", + # "C1257349059-ASF", + # "C1257349053-ASF", + # "C1257349054-ASF", + # "C1257349120-ASF", + # "C1257349072-ASF", + # "C1257349066-ASF", + # "C1257349023-ASF", + # "C1257349067-ASF", + # "C1257349121-ASF", + # "C1257349074-ASF", + # "C1257349088-ASF", + # "C1257349083-ASF", + # "C1257349114-ASF", + "C1257349115-ASF", # spatial + # "C1257349065-ASF", + # "C1257349089-ASF", + # "C1257349063-ASF", + # "C1257349073-ASF", "C1257349094-ASF", "C1257349095-ASF", "C1257349102-ASF", @@ -399,6 +399,17 @@ "C1257349109-ASF", "C1257349107-ASF", "C1257349108-ASF", - "C1257349093-ASF", + # "C1257349093-ASF", ], + # "NISAR-SPATIAL": [ + # "C1257349115-ASF", + # "C1257349094-ASF", + # "C1257349095-ASF", + # "C1257349102-ASF", + # "C1257349096-ASF", + # "C1257349103-ASF", + # "C1257349109-ASF", + # "C1257349107-ASF", + # "C1257349108-ASF", + # ], } From 90641cb5faf277285802bd57d5b5d0a204264104 Mon Sep 17 00:00:00 2001 From: kim Date: Wed, 28 Feb 2024 10:17:11 -0900 Subject: [PATCH 5/5] adds latest nisar collections --- SearchAPI/CMR/Translate/datasets.py | 109 +++++++++++++++++----------- 1 file changed, 66 insertions(+), 43 deletions(-) diff --git a/SearchAPI/CMR/Translate/datasets.py b/SearchAPI/CMR/Translate/datasets.py index df97e4ef..cea57a6d 100644 --- a/SearchAPI/CMR/Translate/datasets.py +++ b/SearchAPI/CMR/Translate/datasets.py @@ -368,48 +368,71 @@ "C1206752770-ASF", "C1206144699-ASF", ], - "NISAR": [ - # "C1257349081-ASF", # item['umm']['SpatialExtent']['GranuleSpatialRepresentation'] == 'NO_SPATIAL' - # "C1257349079-ASF", - # "C1257349048-ASF", - # "C1257349082-ASF", - # "C1257349059-ASF", - # "C1257349053-ASF", - # "C1257349054-ASF", - # "C1257349120-ASF", - # "C1257349072-ASF", - # "C1257349066-ASF", - # "C1257349023-ASF", - # "C1257349067-ASF", - # "C1257349121-ASF", - # "C1257349074-ASF", - # "C1257349088-ASF", - # "C1257349083-ASF", - # "C1257349114-ASF", - "C1257349115-ASF", # spatial - # "C1257349065-ASF", - # "C1257349089-ASF", - # "C1257349063-ASF", - # "C1257349073-ASF", - "C1257349094-ASF", - "C1257349095-ASF", - "C1257349102-ASF", - "C1257349096-ASF", - "C1257349103-ASF", - "C1257349109-ASF", - "C1257349107-ASF", - "C1257349108-ASF", - # "C1257349093-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", ], - # "NISAR-SPATIAL": [ - # "C1257349115-ASF", - # "C1257349094-ASF", - # "C1257349095-ASF", - # "C1257349102-ASF", - # "C1257349096-ASF", - # "C1257349103-ASF", - # "C1257349109-ASF", - # "C1257349107-ASF", - # "C1257349108-ASF", - # ], }