Skip to content

Commit

Permalink
Merge branch 'main' into update_prep
Browse files Browse the repository at this point in the history
  • Loading branch information
ehavazli authored Feb 13, 2025
2 parents 24f91ef + 8a327d3 commit cab14d6
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 6 deletions.
57 changes: 56 additions & 1 deletion methods/coseismic/Coseismic_Requirement_Validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,61 @@
"os.system('info.py inputs/ifgramStack.h5 | egrep \"REF_\"');"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1.2.1 Change Reference Point (Optional) <a id='common_latlon_change'></a>\n",
"\n",
"Use the cells below to update the reference point. Uncomment and enter the desired *new_lat* and *new_lon*, then verify the update in the output."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# def update_reference_point(config_file, new_lat, new_lon):\n",
"# # Read the file\n",
"# with open(config_file, \"r\") as file:\n",
"# lines = file.readlines()\n",
" \n",
"# # Update the specific key\n",
"# for i, line in enumerate(lines):\n",
"# if \"mintpy.reference.lalo\" in line:\n",
"# lines[i] = f\"mintpy.reference.lalo = {new_lat}, {new_lon}\\n\"\n",
"# break # Stop after updating the line\n",
" \n",
"# # Write back the modified file\n",
"# with open(config_file, \"w\") as file:\n",
"# file.writelines(lines)\n",
" \n",
"# print(f\"Updated mintpy.reference.lalo to {new_lat}, {new_lon}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# new_lat =\n",
"# new_lon = \n",
"# update_reference_point(config_file, new_lat, new_lon) # New latitude and longitude"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# command = 'smallbaselineApp.py ' + str(config_file) + ' --dostep reference_point'\n",
"# process = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, shell=True)\n",
"# os.system('info.py inputs/ifgramStack.h5 | egrep \"REF_\"');"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -2031,7 +2086,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.12.8"
},
"toc-autonumbering": false,
"toc-showcode": false,
Expand Down
60 changes: 56 additions & 4 deletions methods/secular/Secular_Requirement_Validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,69 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true,
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"command = 'smallbaselineApp.py ' + str(config_file) + ' --dostep reference_point'\n",
"process = subprocess.run(command, shell=True)\n",
"os.system('info.py inputs/ifgramStack.h5 | egrep \"REF_\"');"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2.3.1 Change Reference Point (Optional) <a id='common_latlon_change'></a>\n",
"\n",
"Use the cells below to update the reference point. Uncomment and enter the desired *new_lat* and *new_lon*, then verify the update in the output."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# def update_reference_point(config_file, new_lat, new_lon):\n",
"# # Read the file\n",
"# with open(config_file, \"r\") as file:\n",
"# lines = file.readlines()\n",
" \n",
"# # Update the specific key\n",
"# for i, line in enumerate(lines):\n",
"# if \"mintpy.reference.lalo\" in line:\n",
"# lines[i] = f\"mintpy.reference.lalo = {new_lat}, {new_lon}\\n\"\n",
"# break # Stop after updating the line\n",
" \n",
"# # Write back the modified file\n",
"# with open(config_file, \"w\") as file:\n",
"# file.writelines(lines)\n",
" \n",
"# print(f\"Updated mintpy.reference.lalo to {new_lat}, {new_lon}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# new_lat =\n",
"# new_lon = \n",
"# update_reference_point(config_file, new_lat, new_lon) # New latitude and longitude"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# command = 'smallbaselineApp.py ' + str(config_file) + ' --dostep reference_point'\n",
"# process = subprocess.run(command, shell=True)\n",
"# os.system('info.py inputs/ifgramStack.h5 | egrep \"REF_\"');"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ gdal>=3
h5py
#isce2
matplotlib
mintpy=1.4.1
mintpy
numpy
scipy
wget
Expand Down

0 comments on commit cab14d6

Please sign in to comment.