Skip to content

Commit

Permalink
[#62] fixing file paths in example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed May 15, 2024
1 parent e0b3284 commit be03078
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions docs/examples/Aggregation_Data_Object_Operations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@
"# download the time series aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"\n",
"download_to = r\"D:\\Temp\\TimeSeries_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"base_working_dir = \"aggr_objects\"\n",
"download_to = os.path.join(base_working_dir, \"timeseries_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=ts_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -356,8 +357,8 @@
"source": [
"# download the geographic feature aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"download_to = r\"D:\\Temp\\GeoFeature_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"download_to = os.path.join(base_working_dir, \"geofeature_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gf_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -569,8 +570,8 @@
"source": [
"# download the multidimensional aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"download_to = r\"D:\\Temp\\NetCDF_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"download_to = os.path.join(base_working_dir, \"netcdf_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=md_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -726,8 +727,8 @@
"source": [
"# download the georaster aggregation - these directory paths must exist for hsclient to download and unzip the aggregation zip file\n",
"# Note: These directory paths need to be changed based on where you want to download the aggregation\n",
"download_to = r\"D:\\Temp\\GeoRaster_Testing\"\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"download_to = os.path.join(base_working_dir, \"georaster_testing\")\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gr_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")"
],
Expand Down Expand Up @@ -843,7 +844,7 @@
"# Note: The original raster aggregation may have more than one tif files. The following update will always result in an updated or new aggregation\n",
"# with a single tif file.\n",
"\n",
"output_raster_dir_path = r\"D:\\Temp\\GeoRaster_Testing\\updated_aggr\"\n",
"output_raster_dir_path = os.path.join(base_working_dir, \"georaster_testing\", \"updated_aggr\")\n",
"output_raster_filename = \"out_sample.tif\"\n",
"output_raster_file_path = os.path.join(output_raster_dir_path, output_raster_filename)\n",
"profile = rasterio_ds.profile\n",
Expand Down Expand Up @@ -885,9 +886,9 @@
"# If you have already updated the aggregation as described in the previous cell, then you have to first download the updated aggregation and load the\n",
"# rasterio.DatasetReader object from the downloaded location before you can save the updated raster to a new aggregation in HydroShare as shown below. Otherwise, you can execute the code in the next cell.\n",
"\n",
"download_to = r\"D:\\Temp\\GeoRaster_Testing\"\n",
"download_to = os.path.join(base_working_dir, \"georaster_testing\")\n",
"# note the unzip_to directory must exist and be empty\n",
"unzip_to = rf\"{download_to}\\updated_aggr_unzipped\"\n",
"unzip_to = os.path.join(download_to, \"updated_aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gr_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"print(f\"Downloaded aggregation to:{aggr_path}\")\n",
"\n",
Expand Down Expand Up @@ -920,9 +921,9 @@
"# retrieve the updated georaster aggregation to verify the data was updated\n",
"\n",
"# need to first download this updated/new aggregation\n",
"download_to = r\"D:\\Temp\\GeoRaster_Testing\"\n",
"download_to = os.path.join(base_working_dir, \"georaster_testing\")\n",
"# note the unzip_to directory must exist and be empty\n",
"unzip_to = rf\"{download_to}\\aggr_unzipped\"\n",
"unzip_to = os.path.join(download_to, \"aggr_unzipped\")\n",
"aggr_path = resource.aggregation_download(aggregation=gr_aggr, save_path=download_to, unzip_to=unzip_to)\n",
"rasterio_ds = gr_aggr.as_data_object(agg_path=aggr_path)\n",
"# check the raster dimensions of the updated aggregation\n",
Expand Down

0 comments on commit be03078

Please sign in to comment.