|
81 | 81 | "from rasterio.warp import reproject, Resampling, transform_bounds\n", |
82 | 82 | "import h5py\n", |
83 | 83 | "from pyproj import Transformer\n", |
84 | | - "import tile_mate" |
| 84 | + "import tile_mate\n", |
| 85 | + "import asf_search as asf" |
85 | 86 | ] |
86 | 87 | }, |
87 | 88 | { |
|
102 | 103 | "outputs": [], |
103 | 104 | "source": [ |
104 | 105 | "# === Basic Configuration ===\n", |
105 | | - "site = \"OregonA34\" # Cal/Val location ID\n", |
| 106 | + "site = \"LosAngelesA34\" # Cal/Val location ID\n", |
106 | 107 | "requirement = \"Transient\" # Options: 'Secular', 'Coseismic', 'Transient'\n", |
107 | 108 | "dataset = \"NISAR\" # Dataset type: 'NISAR_sample', 'ARIA_S1', 'ARIA_S1_new'\n", |
108 | 109 | "\n", |
109 | 110 | "\n", |
110 | | - "rundate = \"20260227\" # Date of this Cal/Val run\n", |
| 111 | + "rundate = \"20260312\" # Date of this Cal/Val run\n", |
111 | 112 | "version = \"1\" # Version of this Cal/Val run\n", |
112 | 113 | "custom_sites = \"/home/jovyan/my_nisar_sites.txt\" # Path to custom site metadata\n", |
113 | 114 | "\n", |
|
217 | 218 | " print(f\"Earthdata credentials found for user: {earthdata_user}\")\n", |
218 | 219 | "\n", |
219 | 220 | "if not earthdata:\n", |
220 | | - " print(\"\\nNEEDED to Download ARIA GUNWs\")\n", |
| 221 | + " print(\"\\nNEEDED to Download ARIA/NISAR GUNWs\")\n", |
221 | 222 | " print(\"Create account at: https://urs.earthdata.nasa.gov/\")\n", |
222 | 223 | " earthdata_user = input(\"Earthdata username: \").strip()\n", |
223 | 224 | " earthdata_password = input(\"Earthdata password: \").strip()\n", |
|
266 | 267 | "<hr>\n", |
267 | 268 | "\n", |
268 | 269 | "<a id='prep_ifg'></a>\n", |
269 | | - "# 1. Download and Prepare Interferograms\n", |
270 | | - "\n", |
271 | | - "In this initial processing step, all the necessary Level-2 unwrapped interferogram products are gathered and organized for analysis with MintPy." |
| 270 | + "# 1. Download and Prepare Interferograms" |
| 271 | + ] |
| 272 | + }, |
| 273 | + { |
| 274 | + "cell_type": "code", |
| 275 | + "execution_count": null, |
| 276 | + "id": "95f2582c-8291-4cdc-b4b6-c3e1b2e66c37", |
| 277 | + "metadata": {}, |
| 278 | + "outputs": [], |
| 279 | + "source": [ |
| 280 | + "print(f\"CalVal site: {site}\")\n", |
| 281 | + "\n", |
| 282 | + "# Extract site-specific metadata\n", |
| 283 | + "bbox = site_info.get('download_region')\n", |
| 284 | + "startdate = site_info.get('download_start_date')\n", |
| 285 | + "enddate = site_info.get('download_end_date')\n", |
| 286 | + "track = site_info.get('nisar_track')\n", |
| 287 | + "\n", |
| 288 | + "s, n, w, e = map(float, bbox.strip(\"'\").split())\n", |
| 289 | + "bbox_wkt = f\"POLYGON(({w} {s}, {e} {s}, {e} {n}, {w} {n}, {w} {s}))\"\n", |
| 290 | + "startdate_fmt = f\"{enddate[:4]}-{enddate[4:6]}-{enddate[6:]}\"\n", |
| 291 | + "enddate_fmt = f\"{enddate[:4]}-{enddate[4:6]}-{enddate[6:]}\"\n", |
| 292 | + "data_list = asf.search(dataset=asf.DATASET.NISAR, processingLevel=asf.PRODUCT_TYPE.GUNW, relativeOrbit=int(track), intersectsWith=bbox_wkt)\n", |
| 293 | + "prod_list = data_list.find_urls(extension='.h5', pattern=r'.*\\d.h5')" |
| 294 | + ] |
| 295 | + }, |
| 296 | + { |
| 297 | + "cell_type": "code", |
| 298 | + "execution_count": null, |
| 299 | + "id": "460d1964-b369-48c0-b915-6ca8e7a717ee", |
| 300 | + "metadata": {}, |
| 301 | + "outputs": [], |
| 302 | + "source": [ |
| 303 | + "asf.download_urls(prod_list, path=gunw_dir)" |
272 | 304 | ] |
273 | 305 | }, |
274 | 306 | { |
|
505 | 537 | "outputs": [], |
506 | 538 | "source": [ |
507 | 539 | "command = f'prep_nisar.py -i \"{gunw_dir}/*.h5\" -d {out_dem} -m {out_mask} -o {mintpy_dir}'\n", |
508 | | - "process = subprocess.run(command, shell=True)\n", |
| 540 | + "process = subprocess.run(command, shell=True, check=True)" |
| 541 | + ] |
| 542 | + }, |
| 543 | + { |
| 544 | + "cell_type": "code", |
| 545 | + "execution_count": null, |
| 546 | + "id": "d64d0033-49da-4b8f-9a44-8cd66ecd589d", |
| 547 | + "metadata": {}, |
| 548 | + "outputs": [], |
| 549 | + "source": [ |
509 | 550 | "print('Mintpy input files:')\n", |
510 | 551 | "[x for x in os.listdir(mintpy_dir + '/inputs') if x.endswith('.h5')]" |
511 | 552 | ] |
512 | 553 | }, |
513 | 554 | { |
514 | 555 | "cell_type": "code", |
515 | 556 | "execution_count": null, |
516 | | - "id": "d64d0033-49da-4b8f-9a44-8cd66ecd589d", |
| 557 | + "id": "8cd8b317-b54b-40b8-aa79-80bef0298c98", |
517 | 558 | "metadata": {}, |
518 | 559 | "outputs": [], |
519 | 560 | "source": [] |
|
0 commit comments