You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kalpana is a Python module to convert *ADCIRC* output files to geospatial vector formats (shapefile or kmz) and to downscale the maximum water elevation *maxele.6.nc*.
3
+
Kalpana is a Python module to convert *ADCIRC* output files to geospatial vector formats (shapefile or kmz), and to downscale the maximum water elevations onto a higher-resolution raster.
4
4
5
-
## *ADCIRC* to geospatial vector files
5
+
## *ADCIRC* to geospatial vector formats
6
6
7
-
Kalpana is capable of converting time-varying outputs such as the significant wave height and time-constant outputs such as the maximum water elevation into polylines or polygons in both of the recently mentioned formats.
8
-
Kalpana was originally built by Rosemary Cyriac, and her efforts were aided by the initial attempts of Rich Signell (USGS) and Rusty Holleman to generate shapefiles from ADCIRC results. Then, Jason Fleming improved Kalpana and incorporated the code into ADCIRC Surge Guidance System (ASGS) that he maintains at the Renaissance Computing Institute (RENCI).
7
+
Kalpana can convert time-varying outputs (e.g. *fort.63.nc*, *swan_HS.63.nc*) and time-constant outputs (*maxele.63.nc*) into polylines or polygons in both shapefile and kmz formats.
8
+
Kalpana was developed originally by Rosemary Cyriac, and her efforts were aided by the work of Rich Signell and Rusty Holleman to generate shapefiles from *ADCIRC* results. Then, Jason Fleming improved Kalpana and incorporated it into the ADCIRC Surge Guidance System (ASGS).
9
9
10
10
## Downscaling
11
11
12
-
Kalpana transforms the *ADICRC**maxele.63.nc* file to a constant and higher resolution DEM considering small scale topographic/bathymetric features. The static downscaled method was developed by Nelson Tull, and the incorporated into Kalpana along with a new downscaling method by Carter Rucker. The details can be found in [this paper](https://link.springer.com/epdf/10.1007/s11069-021-04634-8?sharing_token=5GBxenc0qDVGHm3BGk6KhPe4RwlQNchNByi7wbcMAY69maaLpgXTBxca-OorPGWBn2w2ySSkXhIRhNeWoyNx8-ituX0UqAcNj_LDMh_kFz6sCpb5e882TbeHKiKpzRd_j4XfVH_6ONriheKYxx2CECQI07z23OD-pFrCALWfyVc=). The schematics below show the downscaling process.
12
+
Kalpana can downscale the maximum water elevations (*maxele.63.nc*) to a higher-resolution raster by considering small-scale topographic features. This process can provide a more-accurate representation of the inundation extent.
13
+
As part of the downscaling, the water surface can be expanded outward to intersect with the ground surface, beyond the extent predicted by ADCIRC. This expansion can be done in two ways: the static method was developed by Nelson Tull, and then the head-loss method was developed by Carter Rucker. The details can be found in [this paper](https://link.springer.com/epdf/10.1007/s11069-021-04634-8?sharing_token=5GBxenc0qDVGHm3BGk6KhPe4RwlQNchNByi7wbcMAY69maaLpgXTBxca-OorPGWBn2w2ySSkXhIRhNeWoyNx8-ituX0UqAcNj_LDMh_kFz6sCpb5e882TbeHKiKpzRd_j4XfVH_6ONriheKYxx2CECQI07z23OD-pFrCALWfyVc=). The schematics below show the downscaling process.
13
14
14
15
**Storm surge expansion**
15
16
@@ -21,6 +22,6 @@ Kalpana transforms the *ADICRC* *maxele.63.nc* file to a constant and higher res
21
22
22
23
## Updated version
23
24
24
-
Kalpana was updated to python 3 and upgraded by Tomás Cuevas as a part of his MSc research.
25
-
Instructions for using Kalpana can be found in the examples folder.
26
-
For any question, comment or suggestion please send an email to tomascuevas@gmail.com or open an *Issue*
25
+
Kalpana was updated to python 3 and upgraded by Tomás Cuevas as a part of his MSc research.
26
+
Instructions for using Kalpana can be found in the examples folder, including a few Jupyter notebooks created by Brandon Tucker.
27
+
For any question, comment or suggestion please send an email to tomascuevas@gmail.com or open an *Issue*.
Copy file name to clipboardExpand all lines: examples/README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
*Kalpana* has two main capabilities:
4
4
5
-
1. Visualization: export*ADCIRC* output as geospatial vector data for visualization using QGIS or any similar GIS software.
6
-
2. Downscaling: transform the *ADICRC**maxele.63.nc* file to a constant and higherresolution DEM considering smallscale topographic/bathymetric features (Rucker et. al 2021).
5
+
1. Visualization: convert*ADCIRC* output as geospatial vector data for visualization using QGIS or any similar GIS software.
6
+
2. Downscaling: transform the *ADCIRC**maxele.63.nc* file to a higher-resolution raster by considering small-scale topographic features (Rucker et. al 2021).
7
7
8
8
## Visualization
9
9
@@ -12,37 +12,37 @@ Setup for running the visualization examples (export_exampleXX.ipynb):
12
12
2. Clone the Kalpana repository to your local device. [Here](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) you can find the instructions.
13
13
14
14
**Export example 01** (export_example01.ipynb)<br>
15
-
Create contours as polygons based on the maximum flooding outputs from ADCIRC, then export the polygons as a .shp file.
15
+
Create contours as polygons based on the maximum flooding outputs from *ADCIRC*, then export the polygons as a .shp file.
16
16
17
17
**Export example 02** (export_example02.ipynb)<br>
18
-
Create contours as polylines based on the maximum flooding outputs from ADCIRC, then export the polylines as a .shp file.
18
+
Create contours as polylines based on the maximum flooding outputs from *ADCIRC*, then export the polylines as a .shp file.
19
19
20
20
**Export example 03** (export_example03.ipynb)<br>
21
-
Read fort.14 file as a GeoPandas GeoDataFrame, then export it as .shp file and some visualizations.
21
+
Read *fort.14* file as a GeoPandas GeoDataFrame, then export it as .shp file and some visualizations.
22
22
23
23
**More examples are comming soon**
24
24
25
25
## Downscaling
26
26
27
-
To use the downscaling method, it is required to have *GRASS GIS* installed. *Kalpana* uses *GRASS GIS* in the backend calling it from a python script. On a Linux OS, you just need to install/compile *GRASS GIS* (https://grass.osgeo.org/) and create a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) using the yml file provided in the *install* folder. On Windows it is more complicated. You need to install *GRASS GIS* and use the *Python* installation that comes with *GRASS GIS*. We will provide a short tutorial soon. To make it more user-friendly we made two *Docker* images to run the *Kalpana* downscaling tools. One of the images if for running the container interactively, and the other is non interactive. The instructions for using them are listed below:
27
+
To use the downscaling method, it is required to have *GRASS GIS* installed. *Kalpana* uses *GRASS GIS* in the backend calling it from a python script. On a Linux OS, you just need to install/compile *GRASS GIS* (https://grass.osgeo.org/) and create a [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) using the yml file provided in the *install* folder. On Windows it is more complicated. You need to install *GRASS GIS* and use the *Python* installation that comes with *GRASS GIS*. We will provide a short tutorial soon.
28
+
29
+
To make it more user-friendly we made two *Docker* images to run the *Kalpana* downscaling tools. With these images, a user can skip the software installation and proceed directly to using *Kalpana*. One image is for running the container interactively, and the other image is non-interactive. The instructions for using them are listed below:
28
30
29
31
**Non interactive**<br>
30
-
This image has all the necessary files and has been set up to downscale *ADCIRC* simulations using *NC9* mesh on a DEM of North Carolina. It is configured to run automatically, i.e. when running the container, the downscaling scripts are executed.
32
+
This image has all the necessary files and has been set up to downscale *ADCIRC* simulations using the *NC9* mesh on a DEM of North Carolina. It is configured to run automatically, i.e. when running the container, the downscaling scripts are executed.
2. Using the terminal, pull the Docker image from Docker hub with the command below. This image can be used only for running the downscaling for a simulation donw with NC9 in North Carolina. <br>
34
+
2. Using the terminal, pull the Docker image from Docker hub with the command below. This image can be used only for running the downscaling for a simulation done with the NC9 mesh in North Carolina. <br>
33
35
```docker pull tacuevas/kalpana_nc:latest```
34
36
3. Create a folder, place the maxele.63.nc and runKalpanaStatic.inp files inside, and 'cd' to it. The *inp* file is provided in this folder, and the *ADCIRC**maxele.63.nc* file can be found [here](https://go.ncsu.edu/kalpana-example-inputs).
35
37
4. Modify the file *runKalpanaStatic.inp* if you want to change the downscaling inputs (e.g. levels, crs, vertical unit, etc).
36
-
5. Run the container declaring a volume so kalpana can access the folder created in *step 3*. Before running the container, check you are located in the same folder where you placed the input files. We also provide a copy of the *Python* script executed with the container is ran (*runKalpanaStatic.py*)<br>
38
+
5. Run the container declaring a volume so kalpana can access the folder created in *step 3*. Before running the container, check you are located in the same folder where you placed the input files. We also provide a copy of the *Python* script executed when the container is ran (*runKalpanaStatic.py*)<br>
37
39
```docker run -it -v "$(pwd)":/home/kalpana/inputs tacuevas/kalpana_nc:latest```
38
40
39
-
40
41
We are working to implement this same image for other areas of the US.
41
42
42
43
**Interactive**<br>
43
44
This image is configured to run kalpana interactively, all the python packages and *GRASS GIS* are installed. You need to copy the examples *downscaling_exampleXX.py* , the necessary inputs (availables [here](https://drive.google.com/drive/folders/1cbQzN4SrLs_rVlz9q8zHCKbFtQpLO5CG?usp=sharing)), and the *Kalpana**downscaling.py* and *export.py* python modules from this repo to the container.
@@ -57,12 +57,12 @@ The steps for running the container:
57
57
Each example is explained below, remember to modify the paths!
58
58
59
59
**Example 01** (downscaling_example01.py)<br>
60
-
This script creates a grass location importing the DEM for downscaling and also creates a new DEM with same resolution and extend with the size of the mesh triangles. This step is key for the downscaling and can be run in advance, since it only depends on the mesh (*fort.14*).
60
+
This script creates a grass location by importing the DEM for downscaling. It also creates a new DEM with the same resolution and extent, but instead of the ground surface, the DEM represents the sizes of the mesh elements. This step is key for the downscaling and can be run in advance, because it only depends on the mesh (*fort.14*).
61
61
62
62
**Example 02** (downscaling_example02.py)<br>
63
-
Example for doing the static downscaling using an existing grass location, and importing the DEM with the mesh elements size. Both inputs were created in the *example 01*. There is a short description of all inputs in the script, more detail can be found in the docstring of the function in the github repository.
63
+
Example for doing the static downscaling using an existing grass location, and importing the DEM with the mesh element sizes. Both inputs were created in the *example 01*. There is a short description of all inputs in the script, more detail can be found in the docstring of the function in the github repository.
64
64
65
65
**Example 03** (downscaling_example03.py)<br>
66
-
This example combines downscaling examples *1* and *2*. The DEM with mesh elements size and the grass location are created. This should be considerable more slow than running *example 2*, since creating the inputs for the downscaling is the slower part.
66
+
This example combines downscaling examples *1* and *2*. The DEM with mesh elements size and the grass location are created. This should be considerably more slow than running *example 2*, because creating the inputs for the downscaling is the slower part.
67
67
68
-
For questions regarding the visualization or downscaling examples please open an *Issue* or email tomascuevas@gmail.com
68
+
For questions regarding the visualization or downscaling examples please open an *Issue* or email tomascuevas@gmail.com.
logger.info('Convert '+os.path.join(pathout, bname+f'_epsg{epsgOut}.tmp.tif')+' to COG with filename '+os.path.join(pathout, bname+f'_epsg{epsgOut}.tif'))
0 commit comments