From 6a72fcede76ef1a5cd0adc8964ba795998b0c4b5 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 13 Feb 2023 15:46:17 -0800 Subject: [PATCH 01/16] update metadata w/ frame_id and secondary dt --- isce2_topsapp/__main__.py | 1 + isce2_topsapp/delivery_prep.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/isce2_topsapp/__main__.py b/isce2_topsapp/__main__.py index f0cf2644..a51b9a78 100644 --- a/isce2_topsapp/__main__.py +++ b/isce2_topsapp/__main__.py @@ -47,6 +47,7 @@ def localize_data(reference_scenes: list, out = {'reference_scenes': reference_scenes, 'secondary_scenes': secondary_scenes, + 'frame_id': frame_id, **out_slc, **out_dem, **out_aux_cal, diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index 3967f5ce..e7123c2e 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -142,8 +142,8 @@ def format_metadata(nc_path: Path, sec_props = all_metadata['secondary_properties'][0] b_perp = read_baseline_perp(nc_path).mean() - startTime_f = format_time_string(ref_props["startTime"]) - stopTime_f = format_time_string(ref_props["stopTime"]) + sec_start_time_formatted = format_time_string(sec_props["startTime"]) + ref_start_time_formatted = format_time_string(ref_props["startTime"]) metadata = {} # get 4 corners of bounding box of the geometry; default is 5 returning @@ -152,8 +152,9 @@ def format_metadata(nc_path: Path, metadata.update({"ogr_bbox": ogr_bbox, "reference_scenes": all_metadata['reference_scenes'], "secondary_scenes": all_metadata['secondary_scenes'], - "sensing_start": startTime_f, - "sensing_stop": stopTime_f, + "sensing_start": sec_start_time_formatted, + "sensing_stop": ref_start_time_formatted, + "frame_id": all_metadata['frame_id'], "orbit_number": [int(ref_props['orbit']), int(sec_props['orbit'])], "platform": [ref_props['platform'], sec_props['platform']], From 9b68415fb9b6b1269f826d2ad666b53a8b799820 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 13 Feb 2023 15:52:12 -0800 Subject: [PATCH 02/16] update changelog; fix version num --- CHANGELOG.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4111e4..7804e2b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,19 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.2.3] - -### Added -* Added support to compute and embed solid earth tide correction layers into GUNW products (see PR #91) - ## [0.2.2] ### Added +* Added support to compute and embed solid earth tide correction layers into GUNW products (see PR #91) * Provide prototype (internal) for burst analysis thanks to Forrest Williams and Joseph Kennedy (see PR #73) * CLI (and API) can switch between burst and SLC ifg generation thanks to entry point magic (see PR #73 for details) * Exposes a number of new corrections/ISCE2 processing options including: `ionosphere`, and `ESD threshold` arguments in CLI. Examples in README. * Exposes `frame-id` parameter for fixed frame cropping. Discussion, references, and examples in README. * Pins ISCE2 version to 2.6.1 and numpy / scipy to previous versions (see environment.yml) - to be amended when newest ISCE2 build is sorted out +* Includes `frame_id` in json metadata for CMR handshake +* Updates `sensing_start` and `sensing_stop` with secondary and reference start times, respectively. ## [0.2.1] From 70ccb38d06ad57012498cc3e0d7e95d26eb5b378 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 13 Feb 2023 15:56:07 -0800 Subject: [PATCH 03/16] add frame-id to test data --- tests/sample_loc_metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sample_loc_metadata.json b/tests/sample_loc_metadata.json index 82728d72..e6245313 100644 --- a/tests/sample_loc_metadata.json +++ b/tests/sample_loc_metadata.json @@ -15,6 +15,7 @@ "S1B_IW_SLC__1SDV_20210711T014947_20210711T015013_027740_034F80_D404.zip", "S1B_IW_SLC__1SDV_20210711T014922_20210711T014949_027740_034F80_859D.zip" ], + "frame_id": -1, "extent": [ -119.080994, 33.405682, From 07ddf91c61cae913fa272e8b0c3646321661bb72 Mon Sep 17 00:00:00 2001 From: Charlie Marshak Date: Tue, 14 Feb 2023 15:03:36 -0800 Subject: [PATCH 04/16] Update delivery_prep.py --- isce2_topsapp/delivery_prep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index e7123c2e..06ccd309 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -162,7 +162,7 @@ def format_metadata(nc_path: Path, "orbit_direction": ref_props['flightDirection'].lower(), "dataset_type": 'slc', "product_type": 'interferogram', - "polarization": "HH", + "polarization": "VV", "look_direction": 'right', "track_number": int(ref_props['pathNumber']), "perpendicular_baseline": round(float(b_perp), 4) From 5a4617b956340ad1e1ec14c51aa2c3a9ad5cd1e3 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 27 Feb 2023 14:40:24 -0800 Subject: [PATCH 05/16] temporal baseline and frame id --- isce2_topsapp/delivery_prep.py | 11 ++++++++--- tests/sample_loc_metadata.json | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index 06ccd309..5977789d 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -142,8 +142,12 @@ def format_metadata(nc_path: Path, sec_props = all_metadata['secondary_properties'][0] b_perp = read_baseline_perp(nc_path).mean() - sec_start_time_formatted = format_time_string(sec_props["startTime"]) ref_start_time_formatted = format_time_string(ref_props["startTime"]) + ref_stop_time_formatted = format_time_string(ref_props["startTime"]) + + # We assume that temporal baseline are best captured as integer days + # This is true for current spaceborne satellite imaging + temporal_baseline = (ref_props["startTime"] - sec_props["startTime"]).days metadata = {} # get 4 corners of bounding box of the geometry; default is 5 returning @@ -152,9 +156,10 @@ def format_metadata(nc_path: Path, metadata.update({"ogr_bbox": ogr_bbox, "reference_scenes": all_metadata['reference_scenes'], "secondary_scenes": all_metadata['secondary_scenes'], - "sensing_start": sec_start_time_formatted, - "sensing_stop": ref_start_time_formatted, + "sensing_start": ref_start_time_formatted, + "sensing_stop": ref_stop_time_formatted, "frame_id": all_metadata['frame_id'], + "temporal_baseline_days": temporal_baseline, "orbit_number": [int(ref_props['orbit']), int(sec_props['orbit'])], "platform": [ref_props['platform'], sec_props['platform']], diff --git a/tests/sample_loc_metadata.json b/tests/sample_loc_metadata.json index e6245313..8d57f135 100644 --- a/tests/sample_loc_metadata.json +++ b/tests/sample_loc_metadata.json @@ -16,6 +16,7 @@ "S1B_IW_SLC__1SDV_20210711T014922_20210711T014949_027740_034F80_859D.zip" ], "frame_id": -1, + "temporal_baseline_days": 12, "extent": [ -119.080994, 33.405682, From f28b198a22c742cbf749a7a17a5c0bb314ab06cc Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 27 Feb 2023 16:24:46 -0800 Subject: [PATCH 06/16] fix datetime types --- isce2_topsapp/delivery_prep.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index c1225bc3..dbe5bf3b 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -5,6 +5,7 @@ import numpy as np import rasterio from PIL import Image +from dateparser import parse from matplotlib import cm from isce2_topsapp.packaging import DATASET_VERSION @@ -147,7 +148,9 @@ def format_metadata(nc_path: Path, # We assume that temporal baseline are best captured as integer days # This is true for current spaceborne satellite imaging - temporal_baseline = (ref_props["startTime"] - sec_props["startTime"]).days + ref_start_time_dt = parse(ref_props["startTime"]) + sec_start_time_dt = parse(sec_props["startTime"]) + temporal_baseline = (ref_start_time_dt - sec_start_time_dt).days metadata = {} # get 4 corners of bounding box of the geometry; default is 5 returning From 8bf78a75470b8095f251b4374029095b2f39f456 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 27 Feb 2023 17:24:42 -0800 Subject: [PATCH 07/16] remove duplicate SET line --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a6f75e0..a4809551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,6 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [0.2.2] ### Added -* Added support to compute and embed solid earth tide correction layers into GUNW products (see PR #91) * Provide prototype (internal) for burst analysis thanks to Forrest Williams and Joseph Kennedy (see PR #73) * CLI (and API) can switch between burst and SLC ifg generation thanks to entry point magic (see PR #73 for details) * Exposes a number of new corrections/ISCE2 processing options including: `ionosphere`, and `ESD threshold` arguments in CLI. Examples in README. From 257c7b8d4349d46038c79dfb84e6160bbace4df5 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 6 Mar 2023 10:55:30 -0800 Subject: [PATCH 08/16] ensure start time is earliest --- isce2_topsapp/delivery_prep.py | 57 ++++++++++++++-------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index dbe5bf3b..53351cf6 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -114,24 +114,6 @@ def gen_browse_imagery(nc_path: Path, return out_path -def format_time_string(time_str: str) -> str: - """Generates formatted string for ingest schema using built in python manipulations. - New ASF API provides time string as 2022-05-20T07:11:01.000Z and we need 6 decimal places - at end of string, specifically, 2022-05-20T07:11:01.000000Z - """ - assert time_str[-1] == 'Z' - - # removes Z at end and focuses in on decimal - temp = time_str[:-1].split('.') - - # update the split string with required decimals - temp[-1] = f'{int(temp[-1]):06d}' - - # rejoin and return - formatted_time_str = '.'.join(temp) - return f'{formatted_time_str}Z' - - def format_metadata(nc_path: Path, all_metadata: dict) -> dict: @@ -139,18 +121,27 @@ def format_metadata(nc_path: Path, label = nc_path.name[:-3] # removes suffix .nc geojson = all_metadata['gunw_geo'].__geo_interface__ - ref_props = all_metadata['reference_properties'][0] - sec_props = all_metadata['secondary_properties'][0] + ref_props_all = sorted(all_metadata['reference_properties'], + key=lambda prop: prop['startTime']) + ref_props_first = ref_props_all[0] + sec_props_all = sorted(all_metadata['secondary_properties'], + key=lambda prop: prop['startTime']) + sec_props_first = sec_props_all[0] b_perp = read_baseline_perp(nc_path).mean() - ref_start_time_formatted = format_time_string(ref_props["startTime"]) - ref_stop_time_formatted = format_time_string(ref_props["startTime"]) + ref_start_times = [parse(props['startTime']) for props in ref_props_all] + ref_stop_times = [parse(props['stopTime']) for props in ref_props_all] + sec_start_times = [parse(props['startTime']) for props in sec_props_all] + + ref_start_time = ref_start_times[0] + ref_stop_time = ref_stop_times[-1] + sec_start_time = sec_start_times[0] + + # The %f is miliseconds zero-padded with 6 decimals - just as we need! + ref_start_time_formatted = ref_start_time.strftime('%Y-%m-%dT%H:%M:%S.%fZ') + ref_stop_time_formatted = ref_stop_time.strftime('%Y-%m-%dT%H:%M:%S.%fZ') - # We assume that temporal baseline are best captured as integer days - # This is true for current spaceborne satellite imaging - ref_start_time_dt = parse(ref_props["startTime"]) - sec_start_time_dt = parse(sec_props["startTime"]) - temporal_baseline = (ref_start_time_dt - sec_start_time_dt).days + temporal_baseline = (ref_start_time - sec_start_time).days metadata = {} # get 4 corners of bounding box of the geometry; default is 5 returning @@ -163,16 +154,16 @@ def format_metadata(nc_path: Path, "sensing_stop": ref_stop_time_formatted, "frame_id": all_metadata['frame_id'], "temporal_baseline_days": temporal_baseline, - "orbit_number": [int(ref_props['orbit']), - int(sec_props['orbit'])], - "platform": [ref_props['platform'], sec_props['platform']], - "beam_mode": ref_props['beamModeType'], - "orbit_direction": ref_props['flightDirection'].lower(), + "orbit_number": [int(ref_props_first['orbit']), + int(sec_props_first['orbit'])], + "platform": [ref_props_first['platform'], sec_props_first['platform']], + "beam_mode": ref_props_first['beamModeType'], + "orbit_direction": ref_props_first['flightDirection'].lower(), "dataset_type": 'slc', "product_type": 'interferogram', "polarization": "VV", "look_direction": 'right', - "track_number": int(ref_props['pathNumber']), + "track_number": int(ref_props_first['pathNumber']), "perpendicular_baseline": round(float(b_perp), 4) }) From 6e1cc3b59f31e1d95600f783ff48fbc8050e2a1f Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 6 Mar 2023 10:56:31 -0800 Subject: [PATCH 09/16] split url and download cells --- tests/prepare-for-delivery.ipynb | 67 +++++++++++++++++++------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/tests/prepare-for-delivery.ipynb b/tests/prepare-for-delivery.ipynb index 7d5751fa..dd6839bc 100644 --- a/tests/prepare-for-delivery.ipynb +++ b/tests/prepare-for-delivery.ipynb @@ -6,8 +6,8 @@ "id": "a9077005", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:48:46.776007Z", - "start_time": "2023-02-23T02:48:46.772841Z" + "end_time": "2023-03-06T18:45:58.069411Z", + "start_time": "2023-03-06T18:45:56.318950Z" } }, "outputs": [], @@ -37,18 +37,31 @@ { "cell_type": "code", "execution_count": null, - "id": "6e4826bf", + "id": "2b69cf1f", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:49:14.320081Z", - "start_time": "2023-02-23T02:48:47.604876Z" + "end_time": "2023-03-06T18:45:58.079450Z", + "start_time": "2023-03-06T18:45:58.076986Z" } }, "outputs": [], "source": [ "url = 'https://grfn.asf.alaska.edu/door/download/S1-GUNW-A-R-064-tops-20210723_20210711-015001-35393N_33512N-PP-6267-v2_0_4.nc'\n", - "nc_path = Path(url.split('/')[-1])\n", - "\n", + "nc_path = Path(url.split('/')[-1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6e4826bf", + "metadata": { + "ExecuteTime": { + "end_time": "2023-03-06T18:46:20.000997Z", + "start_time": "2023-03-06T18:45:58.082664Z" + } + }, + "outputs": [], + "source": [ "resp = requests.get(url)\n", "with open(nc_path, 'wb') as file:\n", " file.write(resp.content)" @@ -70,8 +83,8 @@ "id": "c95b6dd0", "metadata": { "ExecuteTime": { - "end_time": "2023-02-03T23:48:51.230827Z", - "start_time": "2023-02-03T23:48:51.228003Z" + "end_time": "2023-03-06T18:46:20.005455Z", + "start_time": "2023-03-06T18:46:20.002858Z" } }, "outputs": [], @@ -93,8 +106,8 @@ "id": "239d2148", "metadata": { "ExecuteTime": { - "end_time": "2023-02-03T23:48:51.891722Z", - "start_time": "2023-02-03T23:48:51.884415Z" + "end_time": "2023-03-06T18:46:20.012570Z", + "start_time": "2023-03-06T18:46:20.007779Z" } }, "outputs": [], @@ -125,8 +138,8 @@ "id": "7fd297cb", "metadata": { "ExecuteTime": { - "end_time": "2023-02-03T23:49:56.049768Z", - "start_time": "2023-02-03T23:49:56.043410Z" + "end_time": "2023-03-06T18:46:20.023256Z", + "start_time": "2023-03-06T18:46:20.014577Z" }, "scrolled": true }, @@ -144,8 +157,8 @@ "id": "aa743e32", "metadata": { "ExecuteTime": { - "end_time": "2023-02-03T23:53:11.392483Z", - "start_time": "2023-02-03T23:53:10.279477Z" + "end_time": "2023-03-06T18:46:20.312023Z", + "start_time": "2023-03-06T18:46:20.026340Z" } }, "outputs": [], @@ -169,8 +182,8 @@ "id": "841686cd", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:49:14.327580Z", - "start_time": "2023-02-23T02:49:14.322297Z" + "end_time": "2023-03-06T18:46:20.318743Z", + "start_time": "2023-03-06T18:46:20.314194Z" } }, "outputs": [], @@ -200,8 +213,8 @@ "id": "982d838b", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:52:00.568443Z", - "start_time": "2023-02-23T02:49:14.328921Z" + "end_time": "2023-03-06T18:47:55.911191Z", + "start_time": "2023-03-06T18:46:20.320764Z" } }, "outputs": [], @@ -215,8 +228,8 @@ "id": "6b07ba73", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:52:00.584374Z", - "start_time": "2023-02-23T02:52:00.571171Z" + "end_time": "2023-03-06T18:47:55.917180Z", + "start_time": "2023-03-06T18:47:55.912988Z" } }, "outputs": [], @@ -240,8 +253,8 @@ "id": "81b12194", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:52:10.225364Z", - "start_time": "2023-02-23T02:52:10.221367Z" + "end_time": "2023-03-06T18:47:55.923057Z", + "start_time": "2023-03-06T18:47:55.919248Z" } }, "outputs": [], @@ -256,8 +269,8 @@ "id": "c863ebae", "metadata": { "ExecuteTime": { - "end_time": "2023-02-23T02:53:23.482724Z", - "start_time": "2023-02-23T02:53:23.474497Z" + "end_time": "2023-03-06T18:47:55.933284Z", + "start_time": "2023-03-06T18:47:55.924987Z" } }, "outputs": [], @@ -285,8 +298,8 @@ "id": "34891199", "metadata": { "ExecuteTime": { - "end_time": "2022-01-14T02:33:23.109747Z", - "start_time": "2022-01-14T02:33:23.103792Z" + "end_time": "2023-03-06T18:47:55.941238Z", + "start_time": "2023-03-06T18:47:55.935324Z" } }, "outputs": [], From 47a52d7eb2352adb6466e3c4b000ea2d97ccd213 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Mon, 6 Mar 2023 13:39:23 -0800 Subject: [PATCH 10/16] ensure midnight crossing is correctly handled per DB --- isce2_topsapp/delivery_prep.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index 53351cf6..5c3f9688 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -141,7 +141,9 @@ def format_metadata(nc_path: Path, ref_start_time_formatted = ref_start_time.strftime('%Y-%m-%dT%H:%M:%S.%fZ') ref_stop_time_formatted = ref_stop_time.strftime('%Y-%m-%dT%H:%M:%S.%fZ') - temporal_baseline = (ref_start_time - sec_start_time).days + # We want the nearest day (dt.days takes a floor) so we use total seconds and then round + temporal_baseline_seconds = (ref_start_time - sec_start_time).total_seconds() + temporal_baseline_days = round(temporal_baseline_seconds / 60 / 60 / 24) metadata = {} # get 4 corners of bounding box of the geometry; default is 5 returning @@ -153,7 +155,7 @@ def format_metadata(nc_path: Path, "sensing_start": ref_start_time_formatted, "sensing_stop": ref_stop_time_formatted, "frame_id": all_metadata['frame_id'], - "temporal_baseline_days": temporal_baseline, + "temporal_baseline_days": temporal_baseline_days, "orbit_number": [int(ref_props_first['orbit']), int(sec_props_first['orbit'])], "platform": [ref_props_first['platform'], sec_props_first['platform']], From 7c72c95e5db8ebd86e5d46bcf3c2e40b0f7480b8 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Thu, 23 Mar 2023 11:25:40 -0700 Subject: [PATCH 11/16] increase dataset version 3.0.0, include version in cmr metadata, and change frame_id to frame_number in metadata --- isce2_topsapp/delivery_prep.py | 3 ++- isce2_topsapp/packaging.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index 5c3f9688..45ed9769 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -154,7 +154,8 @@ def format_metadata(nc_path: Path, "secondary_scenes": all_metadata['secondary_scenes'], "sensing_start": ref_start_time_formatted, "sensing_stop": ref_stop_time_formatted, - "frame_id": all_metadata['frame_id'], + "frame_number": all_metadata['frame_id'], + "version": DATASET_VERSION, "temporal_baseline_days": temporal_baseline_days, "orbit_number": [int(ref_props_first['orbit']), int(sec_props_first['orbit'])], diff --git a/isce2_topsapp/packaging.py b/isce2_topsapp/packaging.py index db961ef2..fc44b1cb 100644 --- a/isce2_topsapp/packaging.py +++ b/isce2_topsapp/packaging.py @@ -14,7 +14,7 @@ from isce2_topsapp.packaging_utils.ionosphere import format_ionosphere_for_gunw from isce2_topsapp.templates import read_netcdf_packaging_template -DATASET_VERSION = '2.0.6' +DATASET_VERSION = '3.0.0' PERMISSIBLE_2D_LAYERS = ['ionosphere'] From cf387a728faf67c1a6c0d0e08f04cfaf8f260fe5 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Thu, 23 Mar 2023 11:46:27 -0700 Subject: [PATCH 12/16] dynamically update dataset version for test --- tests/test_packaging.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_packaging.py b/tests/test_packaging.py index b04f6b2b..523e129c 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -1,7 +1,7 @@ import json from pathlib import Path -from isce2_topsapp.packaging import get_gunw_id +from isce2_topsapp.packaging import get_gunw_id, DATASET_VERSION test_dir = Path(__file__).parent @@ -12,4 +12,5 @@ def test_gunw_id_generation_crossing_dateline(): gunw_id = get_gunw_id(metadata['reference_properties'], metadata['secondary_properties'], metadata['extent']) - assert gunw_id == 'S1-GUNW-D-R-048-tops-20230106_20221214-235959-00090E_00040N-PP-c254-v2_0_6' + version_str = DATASET_VERSION.replace(".", "_") + assert gunw_id == f'S1-GUNW-D-R-048-tops-20230106_20221214-235959-00090E_00040N-PP-c254-v{version_str}' From fd73e06f862d54251fa2b00dfa6aea711e5d2df1 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Thu, 23 Mar 2023 11:47:31 -0700 Subject: [PATCH 13/16] lint --- tests/test_packaging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_packaging.py b/tests/test_packaging.py index 523e129c..c2fa1140 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -1,7 +1,7 @@ import json from pathlib import Path -from isce2_topsapp.packaging import get_gunw_id, DATASET_VERSION +from isce2_topsapp.packaging import DATASET_VERSION, get_gunw_id test_dir = Path(__file__).parent From 4b8019a334c33b70f2cfa050ae07d4bf806d18f8 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Wed, 29 Mar 2023 10:34:22 -0700 Subject: [PATCH 14/16] andrews suggestion --- isce2_topsapp/delivery_prep.py | 4 +++- tests/sample_loc_metadata.json | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/isce2_topsapp/delivery_prep.py b/isce2_topsapp/delivery_prep.py index 45ed9769..c29be3ac 100644 --- a/isce2_topsapp/delivery_prep.py +++ b/isce2_topsapp/delivery_prep.py @@ -154,7 +154,6 @@ def format_metadata(nc_path: Path, "secondary_scenes": all_metadata['secondary_scenes'], "sensing_start": ref_start_time_formatted, "sensing_stop": ref_stop_time_formatted, - "frame_number": all_metadata['frame_id'], "version": DATASET_VERSION, "temporal_baseline_days": temporal_baseline_days, "orbit_number": [int(ref_props_first['orbit']), @@ -176,6 +175,9 @@ def format_metadata(nc_path: Path, "version": DATASET_VERSION, "metadata": metadata} + if all_metadata['frame_id'] != -1: + metadata['frame_number'] = all_metadata['frame_id'] + return data diff --git a/tests/sample_loc_metadata.json b/tests/sample_loc_metadata.json index dd35dbd5..30b4f8ec 100644 --- a/tests/sample_loc_metadata.json +++ b/tests/sample_loc_metadata.json @@ -15,7 +15,6 @@ "S1B_IW_SLC__1SDV_20210711T014947_20210711T015013_027740_034F80_D404.zip", "S1B_IW_SLC__1SDV_20210711T014922_20210711T014949_027740_034F80_859D.zip" ], - "frame_id": -1, "temporal_baseline_days": 12, "extent": [ -119.080994, From 7ccb526c58f9a2919cb9686970bc1334742e69e3 Mon Sep 17 00:00:00 2001 From: cmarshak Date: Wed, 29 Mar 2023 10:47:57 -0700 Subject: [PATCH 15/16] revert localized data --- tests/sample_loc_metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sample_loc_metadata.json b/tests/sample_loc_metadata.json index 30b4f8ec..dd35dbd5 100644 --- a/tests/sample_loc_metadata.json +++ b/tests/sample_loc_metadata.json @@ -15,6 +15,7 @@ "S1B_IW_SLC__1SDV_20210711T014947_20210711T015013_027740_034F80_D404.zip", "S1B_IW_SLC__1SDV_20210711T014922_20210711T014949_027740_034F80_859D.zip" ], + "frame_id": -1, "temporal_baseline_days": 12, "extent": [ -119.080994, From 98dadaf1ef0ff418f8cda8462ed2c40188460127 Mon Sep 17 00:00:00 2001 From: Charlie Marshak Date: Wed, 24 May 2023 18:32:18 -0700 Subject: [PATCH 16/16] Update __main__.py with water mask --- isce2_topsapp/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/isce2_topsapp/__main__.py b/isce2_topsapp/__main__.py index cd5bbc9d..40a1e079 100644 --- a/isce2_topsapp/__main__.py +++ b/isce2_topsapp/__main__.py @@ -67,6 +67,7 @@ def localize_data( 'frame_id': frame_id, **out_slc, **out_dem, + **out_water_mask, **out_aux_cal, **out_orbits} return out