diff --git a/docs/examples/Aggregation_Data_Object_Operations.ipynb b/docs/examples/Aggregation_Data_Object_Operations.ipynb index 2042761..6cd3395 100644 --- a/docs/examples/Aggregation_Data_Object_Operations.ipynb +++ b/docs/examples/Aggregation_Data_Object_Operations.ipynb @@ -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}\")" ], @@ -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}\")" ], @@ -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}\")" ], @@ -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}\")" ], @@ -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", @@ -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", @@ -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",