Skip to content
Snippets Groups Projects
Commit 75678517 authored by Rudolf, Michael's avatar Rudolf, Michael
Browse files

Fixed paths

parent 1a6e21ed
Branches
No related tags found
No related merge requests found
Showing with 59 additions and 26 deletions
...@@ -1112,7 +1112,7 @@ def invert_test_data(): ...@@ -1112,7 +1112,7 @@ def invert_test_data():
fig.tight_layout() fig.tight_layout()
fig.savefig( fig.savefig(
Path( Path(
r"~\HESSENBOX-DA\Umwelt_4\Bericht_2024\images\beispiel_zeitreihe.pdf" r"~\nextHessenbox\Umwelt_4\Bericht_2024\images\beispiel_zeitreihe.pdf"
).expanduser() ).expanduser()
) )
# plt.show() # plt.show()
......
import matplotlib.pyplot as plt
import u4py.plotting.axes as u4ax
def main():
file_path = (
r"E:\Projekte\Umwelt4\PSI_Tiffs_EGMS_2015_2021_vertikal\2016-01-05.tif"
)
u4ax.add_tile(file_path)
plt.show()
if __name__ == "__main__":
main()
...@@ -26,7 +26,7 @@ def main(): ...@@ -26,7 +26,7 @@ def main():
r"~\Documents\ArcGIS\EndberichtWorkflowPlots" r"~\Documents\ArcGIS\EndberichtWorkflowPlots"
).expanduser() ).expanduser()
output_path = Path( output_path = Path(
r"~\HESSENBOX-DA\Umwelt_4\Bericht_2024\images" r"~\nextHessenbox\Umwelt_4\Bericht_2024\images"
).expanduser() ).expanduser()
fig, axes = plt.subplots( fig, axes = plt.subplots(
...@@ -35,7 +35,7 @@ def main(): ...@@ -35,7 +35,7 @@ def main():
# Original difference plan and boundary of plot # Original difference plan and boundary of plot
logging.info("Plotting Differenzenplan") logging.info("Plotting Differenzenplan")
axes[0][0].set_title("Differenzenplan") axes[0][0].set_title("DEM difference")
orig_folder = os.path.join(base_path, "original_tiffs") orig_folder = os.path.join(base_path, "original_tiffs")
orig_tiffs = [ orig_tiffs = [
os.path.join(orig_folder, f) os.path.join(orig_folder, f)
...@@ -61,7 +61,7 @@ def main(): ...@@ -61,7 +61,7 @@ def main():
# Get and plot buffered shapes # Get and plot buffered shapes
logging.info("Plotting Filter Masken") logging.info("Plotting Filter Masken")
axes[0][1].set_title("Filter Masken") axes[0][1].set_title("Masking")
shp_cfg = u4config.get_shape_config() shp_cfg = u4config.get_shape_config()
shape_cache_folder = os.path.join(base_path, "shape_cache") shape_cache_folder = os.path.join(base_path, "shape_cache")
os.makedirs(shape_cache_folder, exist_ok=True) os.makedirs(shape_cache_folder, exist_ok=True)
...@@ -81,7 +81,7 @@ def main(): ...@@ -81,7 +81,7 @@ def main():
# Plot Clipped tiffs # Plot Clipped tiffs
logging.info("Plotting Clipped Tiffs") logging.info("Plotting Clipped Tiffs")
axes[0][2].set_title("Geschnittener Differenzenplan") axes[0][2].set_title("Filtered differences")
clip_folder = os.path.join(base_path, "clipped_tiffs") clip_folder = os.path.join(base_path, "clipped_tiffs")
clip_tiffs = [ clip_tiffs = [
os.path.join(clip_folder, f) os.path.join(clip_folder, f)
...@@ -93,7 +93,7 @@ def main(): ...@@ -93,7 +93,7 @@ def main():
# Contours # Contours
logging.info("Plotting Contours") logging.info("Plotting Contours")
axes[1][0].set_title("Konturierung") axes[1][0].set_title("Contouring")
u4ax.add_gpkg_data_in_axis( u4ax.add_gpkg_data_in_axis(
os.path.join(base_path, "contours.gpkg"), os.path.join(base_path, "contours.gpkg"),
table="contours", table="contours",
...@@ -106,7 +106,7 @@ def main(): ...@@ -106,7 +106,7 @@ def main():
# Groups # Groups
logging.info("Plotting Groups") logging.info("Plotting Groups")
axes[1][1].set_title("Gruppierung") axes[1][1].set_title("Clustering")
u4ax.add_gpkg_data_in_axis( u4ax.add_gpkg_data_in_axis(
os.path.join(base_path, "Classified_Shapes.gpkg"), os.path.join(base_path, "Classified_Shapes.gpkg"),
table="Classified_Shapes", table="Classified_Shapes",
...@@ -119,7 +119,7 @@ def main(): ...@@ -119,7 +119,7 @@ def main():
# Klassifikation # Klassifikation
logging.info("Plotting Classification") logging.info("Plotting Classification")
axes[1][2].set_title("Klassifikation") axes[1][2].set_title("Classification")
gpkg_crs = u4sql.get_crs( gpkg_crs = u4sql.get_crs(
os.path.join(base_path, "Filtered_Classified_Shapes_onlyLarge.gpkg"), os.path.join(base_path, "Filtered_Classified_Shapes_onlyLarge.gpkg"),
"Filtered_Classified_Shapes_2410", "Filtered_Classified_Shapes_2410",
...@@ -157,9 +157,9 @@ def main(): ...@@ -157,9 +157,9 @@ def main():
axes[1][0].xaxis.set_major_formatter(u4pltfmt.coordinate_formatter) axes[1][0].xaxis.set_major_formatter(u4pltfmt.coordinate_formatter)
axes[1][1].xaxis.set_major_formatter(u4pltfmt.coordinate_formatter) axes[1][1].xaxis.set_major_formatter(u4pltfmt.coordinate_formatter)
axes[1][2].xaxis.set_major_formatter(u4pltfmt.coordinate_formatter) axes[1][2].xaxis.set_major_formatter(u4pltfmt.coordinate_formatter)
u4pltfmt.enumerate_axes(fig) # u4pltfmt.enumerate_axes(fig)
fig.tight_layout() fig.tight_layout()
fig.savefig(os.path.join(output_path, "ContourWorkflow.png")) fig.savefig(os.path.join(output_path, "ContourWorkflow_en.png"))
# fig.savefig(os.path.join(output_path, "ContourWorkflow.pdf")) # fig.savefig(os.path.join(output_path, "ContourWorkflow.pdf"))
......
...@@ -69,7 +69,7 @@ def main(): ...@@ -69,7 +69,7 @@ def main():
fig.savefig( fig.savefig(
os.path.join( os.path.join(
Path( Path(
r"~\HESSENBOX-DA\Umwelt_4_privat\2023-12 HLNUG Kolloq" r"~\nextHessenbox\Umwelt_4_privat\2023-12 HLNUG Kolloq"
).expanduser(), ).expanduser(),
f"{kk}.png", f"{kk}.png",
) )
......
...@@ -16,12 +16,14 @@ import u4py.utils.projects as u4proj ...@@ -16,12 +16,14 @@ import u4py.utils.projects as u4proj
def main(): def main():
project = u4proj.get_project( project = u4proj.get_project(
proj_path=Path( proj_path=Path(
r"C:\Users\Michael Rudolf\Documents\ArcGIS\U4_projects\Groundwater_height.u4project" r"~\Documents\ArcGIS\U4_projects\Groundwater_height.u4project"
).expanduser(), ).expanduser(),
required=["base_path", "places_path", "ext_path", "diff_plan_path"], required=["base_path", "places_path", "ext_path", "diff_plan_path"],
interactive=False, interactive=False,
) )
wells_shp_path = r"C:\Users\Michael Rudolf\HESSENBOX-DA\Datenaustausch_Umwelt4.0\All_Correlations_GW_PSI.shp" wells_shp_path = Path(
r"~\nextHessenbox\Datenaustausch_Umwelt4.0\All_Correlations_GW_PSI.shp"
).expanduser()
wells_gdf = gp.read_file(wells_shp_path) wells_gdf = gp.read_file(wells_shp_path)
wells_path = os.path.join( wells_path = os.path.join(
project["paths"]["ext_path"], "GWStände_2015", "GWStände_2015.pkl" project["paths"]["ext_path"], "GWStände_2015", "GWStände_2015.pkl"
......
...@@ -11,7 +11,7 @@ def main(): ...@@ -11,7 +11,7 @@ def main():
r"~\Documents\ArcGIS\INSAR_results\NeoTect_URG_PSI\Faults" r"~\Documents\ArcGIS\INSAR_results\NeoTect_URG_PSI\Faults"
).expanduser() ).expanduser()
out_path = Path( out_path = Path(
r"~\HESSENBOX-DA\Entwurf_Neotectonics_URG (Johannes Mair)\Python Plots" r"~\nextHessenbox\Entwurf_Neotectonics_URG (Johannes Mair)\Python Plots"
).expanduser() ).expanduser()
fault_list = ["1A", "1B", "1C", "1D", "1E", "2A", "2B"] fault_list = ["1A", "1B", "1C", "1D", "1E", "2A", "2B"]
......
from pathlib import Path
import geopandas as gp import geopandas as gp
import numpy as np import numpy as np
from tqdm import tqdm from tqdm import tqdm
def main(): def main():
file_path = r"c:\Users\Michael Rudolf\Documents\ArcGIS\SelectedSites_August24\Filtered_Classified_Shapes_all_merged_unclean.gpkg" file_path = Path(
r"~\Documents\ArcGIS\SelectedSites_August24\Filtered_Classified_Shapes_all_merged_unclean.gpkg"
).expanduser()
gdf: gp.GeoDataFrame gdf: gp.GeoDataFrame
print("Loading File") print("Loading File")
gdf = gp.read_file(file_path, layer="Filtered_Classified_Shapes") gdf = gp.read_file(file_path, layer="Filtered_Classified_Shapes")
......
from pathlib import Path
import geopandas as gp import geopandas as gp
def main(): def main():
# in_file = "C:/Users/Michael Rudolf/Documents/ArcGIS/SelectedSites_August24/Filtered_Classified_Shapes_all_merged_clean.gpkg" # in_file = Path("~/Documents/ArcGIS/SelectedSites_August24/Filtered_Classified_Shapes_all_merged_clean.gpkg").expanduser()
# out_file = "C:/Users/Michael Rudolf/Documents/ArcGIS/SelectedSites_August24/Filtered_Classified_Shapes_2410.gpkg" # out_file = Path("~/Documents/ArcGIS/SelectedSites_August24/Filtered_Classified_Shapes_2410.gpkg").expanduser()
# gdf: gp.GeoDataFrame # gdf: gp.GeoDataFrame
# gdf = gp.read_file(in_file, where="area>20000 AND volumes_moved>10000") # gdf = gp.read_file(in_file, where="area>20000 AND volumes_moved>10000")
# gdf.to_file(out_file) # gdf.to_file(out_file)
in_file = r"c:\Users\Michael Rudolf\Documents\ArcGIS\SelectedSites_HLNUG_RD\RD_Rutschungen_gesamt.shp" in_file = Path(
out_file = r"c:\Users\Michael Rudolf\Documents\ArcGIS\SelectedSites_HLNUG_RD\thresholded_contours_all_shapes.gpkg" r"~\Documents\ArcGIS\SelectedSites_HLNUG_RD\RD_Rutschungen_gesamt.shp"
).expanduser()
out_file = Path(
r"~\Documents\ArcGIS\SelectedSites_HLNUG_RD\thresholded_contours_all_shapes.gpkg"
).expanduser()
gdf: gp.GeoDataFrame gdf: gp.GeoDataFrame
gdf = gp.read_file(in_file) gdf = gp.read_file(in_file)
......
...@@ -35,7 +35,9 @@ def main(): ...@@ -35,7 +35,9 @@ def main():
# Testing classifier # Testing classifier
project = { project = {
"paths": { "paths": {
"sites_path": r"C:\Users\Michael Rudolf\Documents\ArcGIS\SelectedSites_April24" "sites_path": Path(
r"~\Documents\ArcGIS\SelectedSites_April24"
).expanduser()
} }
} }
res = dict() res = dict()
......
from pathlib import Path
import contextily import contextily
import geopandas as gp import geopandas as gp
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
...@@ -8,7 +10,7 @@ import u4py.analysis.spatial as u4spatial ...@@ -8,7 +10,7 @@ import u4py.analysis.spatial as u4spatial
def main(): def main():
out_folder = r"c:\Users\Michael Rudolf\Documents\ArcGIS\Places\bodenkarte" out_folder = Path(r"~\Documents\ArcGIS\Places\bodenkarte").expanduser()
region = gp.GeoDataFrame( region = gp.GeoDataFrame(
geometry=[ geometry=[
u4spatial.bounds_to_polygon( u4spatial.bounds_to_polygon(
......
import os import os
from pathlib import Path
import geopandas as gp import geopandas as gp
import matplotlib.axes as max import matplotlib.axes as max
...@@ -7,9 +8,9 @@ import numpy as np ...@@ -7,9 +8,9 @@ import numpy as np
def main(): def main():
folder_path = ( folder_path = Path(
r"C:\Users\Michael Rudolf\Documents\ArcGIS\SelectedSites_August24" r"~\Documents\ArcGIS\SelectedSites_August24"
) ).expanduser()
flist = [ flist = [
"Filtered_Classified_Shapes_hazard.gpkg", "Filtered_Classified_Shapes_hazard.gpkg",
"Filtered_Classified_Shapes_onlyLarge.gpkg", "Filtered_Classified_Shapes_onlyLarge.gpkg",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment