diff --git a/methods/coseismic/Coseismic_Requirement_Validation.ipynb b/methods/coseismic/Coseismic_Requirement_Validation.ipynb index cf91f1f..64b2909 100644 --- a/methods/coseismic/Coseismic_Requirement_Validation.ipynb +++ b/methods/coseismic/Coseismic_Requirement_Validation.ipynb @@ -288,9 +288,25 @@ }, "outputs": [], "source": [ - "command = 'smallbaselineApp.py ' + str(config_file) + ' --dostep modify_network'\n", + "# Formulate ifgramStack file\n", + "ifgramStack_file = os.path.join(mintpy_dir, 'inputs/ifgramStack.h5')\n", + "\n", + "# Modify network - base command\n", + "command = f\"modify_network.py {ifgramStack_file} -t {config_file}\"\n", + "\n", + "# Check whether exclusions specified in my_sites file\n", + "if site_info.get('ifgExcludePair') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-ifg {site_info.get('ifgExcludePair')}\"\n", + "\n", + "if site_info.get('ifgExcludeDate') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-date {site_info.get('ifgExcludeDate')}\"\n", + "\n", + "if site_info.get('ifgExcludeIndex') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-ifg-index {site_info.get('ifgExcludeIndex')} \"\n", + "\n", + "# Run command\n", "process = subprocess.run(command, shell=True)\n", - "plot_network.main(['inputs/ifgramStack.h5'])" + "plot_network.main([ifgramStack_file])" ] }, { diff --git a/methods/secular/Secular_Requirement_Validation.ipynb b/methods/secular/Secular_Requirement_Validation.ipynb index fd82084..612141b 100644 --- a/methods/secular/Secular_Requirement_Validation.ipynb +++ b/methods/secular/Secular_Requirement_Validation.ipynb @@ -150,7 +150,7 @@ "aria_gunw_version = \"3_0_1\"\n", "\n", "rundate = \"20250826\" # Date of this Cal/Val run\n", - "version = \"1\" # Version of this Cal/Val run\n", + "version = \"1b\" # Version of this Cal/Val run\n", "custom_sites = \"/home/jovyan/my_sites.txt\" # Path to custom site metadata\n", "\n", "# === Username Detection / Creation ===\n", @@ -287,9 +287,25 @@ }, "outputs": [], "source": [ - "command = 'smallbaselineApp.py ' + str(config_file) + ' --dostep modify_network'\n", + "# Formulate ifgramStack file\n", + "ifgramStack_file = os.path.join(mintpy_dir, 'inputs/ifgramStack.h5')\n", + "\n", + "# Modify network - base command\n", + "command = f\"modify_network.py {ifgramStack_file} -t {config_file}\"\n", + "\n", + "# Check whether exclusions specified in my_sites file\n", + "if site_info.get('ifgExcludePair') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-ifg {site_info.get('ifgExcludePair')}\"\n", + "\n", + "if site_info.get('ifgExcludeDate') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-date {site_info.get('ifgExcludeDate')}\"\n", + "\n", + "if site_info.get('ifgExcludeIndex') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-ifg-index {site_info.get('ifgExcludeIndex')} \"\n", + "\n", + "# Run command\n", "process = subprocess.run(command, shell=True)\n", - "plot_network.main(['inputs/ifgramStack.h5'])" + "plot_network.main([ifgramStack_file])" ] }, { diff --git a/methods/transient/Transient_Requirement_Validation.ipynb b/methods/transient/Transient_Requirement_Validation.ipynb index 66f79e4..265d87a 100644 --- a/methods/transient/Transient_Requirement_Validation.ipynb +++ b/methods/transient/Transient_Requirement_Validation.ipynb @@ -111,7 +111,7 @@ "from matplotlib import pyplot as plt\n", "from mintpy import smallbaselineApp\n", "from mintpy.objects import gnss\n", - "from mintpy.utils import readfile, utils as ut\n", + "from mintpy.utils import readfile, utils as ut, network\n", "from mintpy.cli import view\n", "\n", "from solid_utils.sampling import load_geo, samp_pair\n", @@ -138,13 +138,13 @@ "outputs": [], "source": [ "# === Basic Configuration ===\n", - "site = \"CalVal_S1_LosAngelesA64\"\n", + "site = \"test\"\n", "requirement = \"Transient\"\n", "dataset = 'ARIA_S1_new' # For Sentinel-1 testing with aria-tools\n", "aria_gunw_version = \"3_0_1\"\n", "\n", - "rundate = \"20250820\" # Date of this Cal/Val run\n", - "version = \"1\" # Version of this Cal/Val run\n", + "rundate = \"20250826\" # Date of this Cal/Val run\n", + "version = \"1b\" # Version of this Cal/Val run\n", "custom_sites = \"/home/jovyan/my_sites.txt\" # Path to custom site metadata\n", "\n", "# === Username Detection / Creation ===\n", @@ -278,6 +278,39 @@ "Load the date of interferograms into Python:" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Formulate ifgramStack file\n", + "ifgramStack_file = os.path.join(mintpy_dir, 'inputs/ifgramStack.h5')\n", + "\n", + "# Modify network - base command\n", + "command = f\"modify_network.py {ifgramStack_file} -t {config_file} \"\n", + "\n", + "# Check whether exclusions specified in my_sites file\n", + "if site_info.get('ifgExcludePair') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-ifg {site_info.get('ifgExcludePair')}\"\n", + "\n", + "if site_info.get('ifgExcludeDate') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-date {site_info.get('ifgExcludeDate')}\"\n", + "\n", + "if site_info.get('ifgExcludeIndex') not in [None, 'auto', 'no']:\n", + " command += f\" --exclude-ifg-index {site_info.get('ifgExcludeIndex')} \"\n", + "\n", + "# Run command\n", + "process = subprocess.run(command, shell=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Retrieve the valid date pairs." + ] + }, { "cell_type": "code", "execution_count": null, @@ -287,12 +320,12 @@ "outputs": [], "source": [ "# Retrieve available interferogram date pairs\n", - "ifgs_date = readfile.read(ifgs_file,datasetName='date')[0]\n", + "ifgs_date = network.get_date12_list(ifgs_file, dropIfgram=True)\n", "\n", "# Report all available date pairs\n", "print(f\"Total {len(ifgs_date)} interferograms available\")\n", "for pair in ifgs_date:\n", - " print(f\"{pair[0].decode()}-{pair[1].decode()}\")" + " print(f\"{'-'.join(pair.split('_'))}\")" ] }, { @@ -305,9 +338,8 @@ "source": [ "# Format date strings into Python datetime objects\n", "_ifgs_date = np.empty_like(ifgs_date, dtype=dt)\n", - "for i in range(ifgs_date.shape[0]):\n", - " start_date = ifgs_date[i,0].decode()\n", - " end_date = ifgs_date[i,1].decode()\n", + "for i, pair in enumerate(ifgs_date):\n", + " start_date, end_date = pair.split(\"_\")\n", " start_date = dt.strptime(start_date, \"%Y%m%d\")\n", " end_date = dt.strptime(end_date, \"%Y%m%d\")\n", " _ifgs_date[i] = [start_date, end_date]\n", @@ -337,11 +369,11 @@ "# Determine which interferograms to exclude based on 12-day criterion\n", "del_row_index = []\n", "for i in range(ifgs_date.shape[0]):\n", - " time_interval = (ifgs_date[i,1]-ifgs_date[i,0]).days\n", + " time_interval = (ifgs_date[i][1]-ifgs_date[i][0]).days\n", " if time_interval != 12:\n", " del_row_index.append(i)\n", "while i