Skip to content

Commit 5d1a556

Browse files
author
rzinke
committed
ERA5 and file checks implemented
1 parent 74e209f commit 5d1a556

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

methods/transient/Transient_Requirement_Validation.ipynb

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,20 @@
499499
"outputs": [],
500500
"source": [
501501
"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",
503504
"\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",
508516
"\n",
509517
"else:\n",
510518
" site_info['do_iono'] = \"False\"\n",
@@ -594,22 +602,28 @@
594602
" if site_info.get(\"tropo_model\") != \"HRRR\":\n",
595603
" # ERA5-based correction\n",
596604
" 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",
598606
"\n",
599607
" else:\n",
600608
" # HRRR-based correction\n",
601609
" 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",
603611
"\n",
604612
" print(f\"Troposphere Correction dataset: {tropo_cor_file:s}\")\n",
605613
"\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",
610622
"\n",
611623
"else:\n",
612624
" site_info['do_tropo'] = \"False\"\n",
625+
"\n",
626+
"if site_info['do_tropo'] == \"False\":\n",
613627
" print(\"#\" * 10, \"Troposphere Correction set to False\", \"#\" * 10)"
614628
]
615629
},

0 commit comments

Comments
 (0)