|
499 | 499 | "outputs": [], |
500 | 500 | "source": [ |
501 | 501 | "if 'do_iono' in site_info.keys() and site_info.get('do_iono') != \"False\":\n", |
502 | | - " iono_stack_file = f\"{mintpy_dir}/inputs/ionStack.h5\" # Input ionosphere stack file \n", |
| 502 | + " # Input ionosphere stack file \n", |
| 503 | + " iono_stack_file = f\"{mintpy_dir}/inputs/ionStack.h5\"\n", |
503 | 504 | "\n", |
504 | | - " dirpath, filename = os.path.split(ifgs_file)\n", |
505 | | - " name, ext = os.path.splitext(filename)\n", |
506 | | - " output_ifgs = os.path.join(dirpath, f\"{name}_iono{ext}\")\n", |
507 | | - " print('#'*10, 'Ionosphere Correction set to True', '#'*10)\n", |
| 505 | + " print(f\"Ionosphere Correction dataset: {iono_stack_file:s}\")\n", |
| 506 | + "\n", |
| 507 | + " # Check it tropo correction file exists\n", |
| 508 | + " if os.path.exists(iono_stack_file):\n", |
| 509 | + " dirpath, filename = os.path.split(ifgs_file)\n", |
| 510 | + " name, ext = os.path.splitext(filename)\n", |
| 511 | + " output_ifgs = os.path.join(dirpath, f\"{name}_iono{ext}\")\n", |
| 512 | + " print('#'*10, 'Ionosphere Correction set to True', '#'*10)\n", |
| 513 | + "\n", |
| 514 | + " else:\n", |
| 515 | + " site_info['do_iono'] = \"False\"\n", |
508 | 516 | "\n", |
509 | 517 | "else:\n", |
510 | 518 | " site_info['do_iono'] = \"False\"\n", |
|
594 | 602 | " if site_info.get(\"tropo_model\") != \"HRRR\":\n", |
595 | 603 | " # ERA5-based correction\n", |
596 | 604 | " tropo_source = \"ERA5\"\n", |
597 | | - " tropo_cor_file = os.path.join(mintpy_dir, \"inputs\", \"ERA5.h5\")\n", |
| 605 | + " tropo_cor_file = os.path.join(mintpy_dir, \"inputs\", f\"{tropo_source}.h5\")\n", |
598 | 606 | "\n", |
599 | 607 | " else:\n", |
600 | 608 | " # HRRR-based correction\n", |
601 | 609 | " tropo_source = \"HRRR_ARIA\"\n", |
602 | | - " tropo_cor_file = os.path.join(mintpy_dir, \"inputs\", \"HRRR_ARIA.h5\")\n", |
| 610 | + " tropo_cor_file = os.path.join(mintpy_dir, \"inputs\", f\"{tropo_source}.h5\")\n", |
603 | 611 | "\n", |
604 | 612 | " print(f\"Troposphere Correction dataset: {tropo_cor_file:s}\")\n", |
605 | 613 | "\n", |
606 | | - " dirpath, filename = os.path.split(ifgs_file)\n", |
607 | | - " name, ext = os.path.splitext(filename)\n", |
608 | | - " output_ifgs = os.path.join(dirpath, f\"{name}_{tropo_source}{ext}\")\n", |
609 | | - " print('#'*10, 'Troposphere Correction set to True', '#'*10)\n", |
| 614 | + " # Check it tropo correction file exists\n", |
| 615 | + " if os.path.exists(tropo_cor_file):\n", |
| 616 | + " dirpath, filename = os.path.split(ifgs_file)\n", |
| 617 | + " name, ext = os.path.splitext(filename)\n", |
| 618 | + " output_ifgs = os.path.join(dirpath, f\"{name}_{tropo_source}{ext}\")\n", |
| 619 | + " print('#'*10, 'Troposphere Correction set to True', '#'*10)\n", |
| 620 | + " else:\n", |
| 621 | + " site_info['do_tropo'] = \"False\"\n", |
610 | 622 | "\n", |
611 | 623 | "else:\n", |
612 | 624 | " site_info['do_tropo'] = \"False\"\n", |
| 625 | + "\n", |
| 626 | + "if site_info['do_tropo'] == \"False\":\n", |
613 | 627 | " print(\"#\" * 10, \"Troposphere Correction set to False\", \"#\" * 10)" |
614 | 628 | ] |
615 | 629 | }, |
|
0 commit comments