|
95 | 95 | "outputs": [], |
96 | 96 | "source": [ |
97 | 97 | "# Specify a calval location ID from my_sites.txt\n", |
98 | | - "site = 'test' \n", |
| 98 | + "site = 'CalVal_S1_LosAngelesA64' \n", |
99 | 99 | "\n", |
100 | 100 | "# Choose the requirement to validate\n", |
101 | 101 | "# Options: 'Secular' 'Coseismic' 'Transient'\n", |
|
108 | 108 | "aria_gunw_version = '3_0_1'\n", |
109 | 109 | "\n", |
110 | 110 | "# The date and version of this Cal/Val run\n", |
111 | | - "rundate = '20250415'\n", |
| 111 | + "rundate = '20250417'\n", |
112 | 112 | "version = '1'\n", |
113 | 113 | "\n", |
114 | 114 | "# Provide the file where you keep your customized list of sites.\n", |
|
355 | 355 | " if sitedata['sites'][site]['maskWater'] != 'False':\n", |
356 | 356 | " command = 'ariaTSsetup.py -f ' + product_file + ' -b ' + \\\n", |
357 | 357 | " sitedata['sites'][site]['analysis_region'] + \\\n", |
358 | | - " ' --mask Download -l \"ionosphere, troposphereTotal, solidEarthTide\" --croptounion -nt 8'\n", |
| 358 | + " ' --mask Download -l \"ionosphere, troposphereTotal, solidEarthTide\" --croptounion -nt 8 --log-level info'\n", |
359 | 359 | " mask_file = '../mask/watermask.msk'\n", |
360 | 360 | " else: # skip slow mask download when we don't need to mask water\n", |
361 | 361 | " command = 'ariaTSsetup.py -f ' + product_file + ' -b ' + \\\n", |
362 | | - " sitedata['sites'][site]['analysis_region'] + ' -l \"ionosphere, troposphereTotal, solidEarthTide\" --croptounion -nt 8'\n", |
| 362 | + " sitedata['sites'][site]['analysis_region'] + ' -l \"ionosphere, troposphereTotal, solidEarthTide\" --croptounion -nt 8 --log-level info'\n", |
363 | 363 | " # Crop and prepare stack\n", |
364 | 364 | " process = subprocess.run(command, text = True, shell = True)\n", |
365 | 365 | " print('Finished preparing GUNWs for MintPy!!')\n", |
|
405 | 405 | "source": [ |
406 | 406 | "os.chdir(mintpy_dir)\n", |
407 | 407 | "\n", |
408 | | - "# Write smallbaseline.py config file\n", |
409 | | - "config_file_content = \"\"\"\n", |
410 | | - "mintpy.load.processor = aria\n", |
411 | | - "mintpy.compute.cluster = local\n", |
412 | | - "mintpy.compute.numWorker = auto\n", |
413 | | - "mintpy.load.unwFile = {wd}/stack/unwrapStack.vrt\n", |
414 | | - "mintpy.load.corFile = {wd}/stack/cohStack.vrt\n", |
415 | | - "mintpy.load.connCompFile = {wd}/stack/connCompStack.vrt\n", |
416 | | - "mintpy.load.demFile = {wd}/DEM/glo_90.dem\n", |
417 | | - "mintpy.load.incAngleFile = {wd}/incidenceAngle/*.vrt\n", |
418 | | - "mintpy.load.azAngleFile = {wd}/azimuthAngle/*.vrt\n", |
419 | | - "mintpy.load.waterMaskFile = {mask_file}\n", |
420 | | - "mintpy.topographicResidual.pixelwiseGeometry = no\n", |
421 | | - "mintpy.troposphericDelay.method = no\n", |
422 | | - "mintpy.topographicResidual = no\n", |
423 | | - "mintpy.network.tempBaseMax = {tempmax}\n", |
424 | | - "mintpy.network.startDate = {startdatenet}\n", |
425 | | - "mintpy.network.endDate = {enddatenet}\n", |
426 | | - "mintpy.velocity.startDate = {startdatevel}\n", |
427 | | - "mintpy.velocity.endDate = {enddatevel}\n", |
428 | | - "mintpy.reference.lalo = {reference_lalo}\n", |
429 | | - "mintpy.network.excludeIfgIndex = {excludeIfg}\"\"\".format(wd = work_dir,\n", |
430 | | - " mask_file = mask_file,\n", |
431 | | - " tempmax=sitedata['sites'][site]['tempBaseMax'],\n", |
432 | | - " excludeIfg=sitedata['sites'][site]['ifgExcludeList'],\n", |
433 | | - " startdatenet=sitedata['sites'][site]['download_start_date'],\n", |
434 | | - " enddatenet=sitedata['sites'][site]['download_end_date'],\n", |
435 | | - " startdatevel=sitedata['sites'][site]['download_start_date'],\n", |
436 | | - " enddatevel=sitedata['sites'][site]['download_end_date'],\n", |
437 | | - " reference_lalo=sitedata['sites'][site]['reference_lalo'])\n", |
438 | | - "\n", |
439 | | - "# Write the config file\n", |
| 408 | + "# Build config as a dictionary first\n", |
| 409 | + "config_file_content = {\n", |
| 410 | + " \"mintpy.load.processor\": \"aria\",\n", |
| 411 | + " \"mintpy.compute.cluster\": \"local\",\n", |
| 412 | + " \"mintpy.compute.numWorker\": \"auto\",\n", |
| 413 | + " \"mintpy.load.unwFile\": f\"{work_dir}/stack/unwrapStack.vrt\",\n", |
| 414 | + " \"mintpy.load.corFile\": f\"{work_dir}/stack/cohStack.vrt\",\n", |
| 415 | + " \"mintpy.load.connCompFile\": f\"{work_dir}/stack/connCompStack.vrt\",\n", |
| 416 | + " \"mintpy.load.demFile\": f\"{work_dir}/DEM/glo_90.dem\",\n", |
| 417 | + " \"mintpy.load.incAngleFile\": f\"{work_dir}/incidenceAngle/*.vrt\",\n", |
| 418 | + " \"mintpy.load.azAngleFile\": f\"{work_dir}/azimuthAngle/*.vrt\",\n", |
| 419 | + " \"mintpy.load.waterMaskFile\": mask_file,\n", |
| 420 | + " \"mintpy.topographicResidual.pixelwiseGeometry\": \"no\",\n", |
| 421 | + " \"mintpy.troposphericDelay.method\": \"no\",\n", |
| 422 | + " \"mintpy.topographicResidual\": \"no\",\n", |
| 423 | + " \"mintpy.network.tempBaseMax\": sitedata['sites'][site]['tempBaseMax'],\n", |
| 424 | + " \"mintpy.network.startDate\": sitedata['sites'][site]['download_start_date'],\n", |
| 425 | + " \"mintpy.network.endDate\": sitedata['sites'][site]['download_end_date'],\n", |
| 426 | + " \"mintpy.velocity.startDate\": sitedata['sites'][site]['download_start_date'],\n", |
| 427 | + " \"mintpy.velocity.endDate\": sitedata['sites'][site]['download_end_date'],\n", |
| 428 | + " \"mintpy.reference.lalo\": sitedata['sites'][site]['reference_lalo'],\n", |
| 429 | + " \"mintpy.network.excludeIfgIndex\": sitedata['sites'][site]['ifgExcludeList'],\n", |
| 430 | + "}\n", |
| 431 | + "\n", |
| 432 | + "# Write dictionary to a config text file\n", |
440 | 433 | "with open(config_file, \"w\") as file:\n", |
441 | | - " file.write(config_file_content)\n", |
| 434 | + " for key, value in config_file_content.items():\n", |
| 435 | + " file.write(f\"{key} = {value}\\n\")\n", |
442 | 436 | "\n", |
443 | | - "# Print the results\n", |
| 437 | + "# Print results\n", |
444 | 438 | "print(f'MintPy config file:\\n {config_file}')\n", |
445 | 439 | "with open(config_file, \"r\") as file:\n", |
446 | | - " print(file.read())" |
| 440 | + " print(file.read())\n" |
447 | 441 | ] |
448 | 442 | }, |
449 | 443 | { |
|
464 | 458 | "metadata": {}, |
465 | 459 | "source": [ |
466 | 460 | "<div class=\"alert alert-block alert-info\">\n", |
467 | | - " <b>Note:</b> If you plan to use one or more ARIA GUNW correction layers — such as <b>troposphere</b>, <b>ionosphere</b>, or <b>solid Earth tides</b> — run the <code>prep_aria.py</code> command in the second cell below.\n", |
| 461 | + " <b>Note:</b> If you plan to use one or more ARIA GUNW correction layers — such as <b>troposphere</b>, <b>ionosphere</b>, or <b>solid Earth tides</b> — run <b>Section 1.4.2</b> <code>prep_aria.py</code> command in the second cell below.\n", |
468 | 462 | "</div>" |
469 | 463 | ] |
470 | 464 | }, |
| 465 | + { |
| 466 | + "cell_type": "markdown", |
| 467 | + "id": "50ad69da-bd51-4f40-9975-16863a131cac", |
| 468 | + "metadata": {}, |
| 469 | + "source": [ |
| 470 | + "#### 1.4.1 Use `smallbaselineApp.py` to generate MintPy stacks" |
| 471 | + ] |
| 472 | + }, |
471 | 473 | { |
472 | 474 | "cell_type": "code", |
473 | 475 | "execution_count": null, |
|
484 | 486 | "[x for x in os.listdir('inputs') if x.endswith('.h5')]" |
485 | 487 | ] |
486 | 488 | }, |
| 489 | + { |
| 490 | + "cell_type": "markdown", |
| 491 | + "id": "42cf2c62-6f47-4922-bc25-659645380d56", |
| 492 | + "metadata": {}, |
| 493 | + "source": [ |
| 494 | + "#### 1.4.2 Use `prep_aria.py` to generate MintPy stacks, including optional corrections" |
| 495 | + ] |
| 496 | + }, |
| 497 | + { |
| 498 | + "cell_type": "code", |
| 499 | + "execution_count": null, |
| 500 | + "id": "671415cf-b6b5-412a-af67-c94358d4bf6c", |
| 501 | + "metadata": {}, |
| 502 | + "outputs": [], |
| 503 | + "source": [ |
| 504 | + "# Get paths from MintPy config file content\n", |
| 505 | + "stack_dir = config_file_content['mintpy.load.unwFile'].split('/unwrapStack.vrt')[0]\n", |
| 506 | + "dem_f = config_file_content['mintpy.load.demFile']\n", |
| 507 | + "incAngle_f = config_file_content['mintpy.load.incAngleFile']\n", |
| 508 | + "azAngle_f = config_file_content['mintpy.load.azAngleFile']" |
| 509 | + ] |
| 510 | + }, |
| 511 | + { |
| 512 | + "cell_type": "code", |
| 513 | + "execution_count": null, |
| 514 | + "id": "d5f3a44c-8ea0-4bb6-970e-704581ef107a", |
| 515 | + "metadata": {}, |
| 516 | + "outputs": [], |
| 517 | + "source": [ |
| 518 | + "# Set optional correction file paths\n", |
| 519 | + "solidearthtides_f = f\"{stack_dir}/setStack.vrt\"\n", |
| 520 | + "troposphere_f = f\"{stack_dir}/troposphereTotal/HRRRStack.vrt\"\n", |
| 521 | + "ionosphere_f = f\"{stack_dir}/ionoStack.vrt\"" |
| 522 | + ] |
| 523 | + }, |
| 524 | + { |
| 525 | + "cell_type": "code", |
| 526 | + "execution_count": null, |
| 527 | + "id": "093f314a-8f13-4cfd-a809-4c29cafe3baa", |
| 528 | + "metadata": {}, |
| 529 | + "outputs": [], |
| 530 | + "source": [ |
| 531 | + "# Check if optional corrections files exist\n", |
| 532 | + "cor_files = [solidearthtides_f, troposphere_f, ionosphere_f]\n", |
| 533 | + "\n", |
| 534 | + "for file in cor_files:\n", |
| 535 | + " if os.path.isfile(file):\n", |
| 536 | + " print(f\"Found: {file}\")\n", |
| 537 | + " else:\n", |
| 538 | + " print(f\"File Not Found: {file}\")" |
| 539 | + ] |
| 540 | + }, |
487 | 541 | { |
488 | 542 | "cell_type": "code", |
489 | 543 | "execution_count": null, |
|
493 | 547 | }, |
494 | 548 | "outputs": [], |
495 | 549 | "source": [ |
496 | | - "command = f'prep_aria.py -s {work_dir}/stack -d {work_dir}/DEM/glo_90.dem -i {work_dir}/incidenceAngle/*.vrt -a {work_dir}/azimuthAngle/*.vrt --set {work_dir}/stack/setStack.vrt --tropo {work_dir}/stack/troposphereTotal/HRRRStack.vrt --iono {work_dir}/stack/ionoStack.vrt'\n", |
| 550 | + "command = f\"prep_aria.py -s {stack_dir} -d {dem_f} -i {incAngle_f} -a {azAngle_f} --set {solidearthtides_f} --tropo {troposphere_f} --iono {ionosphere_f}\"\n", |
497 | 551 | "process = subprocess.run(command, shell=True)\n", |
| 552 | + "\n", |
498 | 553 | "print('Mintpy input files:')\n", |
499 | 554 | "[x for x in os.listdir('inputs') if x.endswith('.h5')]" |
500 | 555 | ] |
| 556 | + }, |
| 557 | + { |
| 558 | + "cell_type": "code", |
| 559 | + "execution_count": null, |
| 560 | + "id": "2f337891-567f-4509-a041-a219b8790390", |
| 561 | + "metadata": {}, |
| 562 | + "outputs": [], |
| 563 | + "source": [] |
501 | 564 | } |
502 | 565 | ], |
503 | 566 | "metadata": { |
|
0 commit comments