SPHY Manual - All versions
  • 📚Readme
  • manual
    • SPHY manual 3.1
      • Introduction
      • Theory
        • Background
        • Modules
        • Reference and potential evaporation
        • Dynamic vegetation processes
        • Snow processes
        • Glacier processes
        • Soil water processes
        • Soil erosion processes
        • Routing
      • Applications
        • Irrigation management in lowland areas
        • Snow- and glacier-fed river basins
        • Flow forecasting
        • Soil erosion and sediment transport
      • Installation of SPHY
        • Installing SPHY as a stand-alone application
          • Miniconda
          • SPHY v3.1 source code
      • Build your own SPHY-model
        • Select projection extent and resolution
        • Clone map
        • DEM and Slope
        • Delineate catchment and create local drain direction map
        • Preparing stations map and sub-basin.map
        • Glacier table
        • Soil hydraulic properties
        • Other static input maps
        • Meteorological forcing map series
        • Open water evaporation
        • Dynamic vegetation module
        • Soil erosion model input
          • MMF
          • Soil erosion model calibration
          • Soil erosion model output
        • Sediment transport
      • Reporting and other utilities
        • Reporting
        • NetCDF
      • References
      • Copyright
      • Appendix 1: Input and Output
      • Appendix 2: Input and Output description
      • Appendix 3: Soil erosion model input
        • MUSLE
        • INCA
        • SHETRAN
        • DHVSM
        • HSFP
    • SPHY manual 3.0
      • Introduction
      • Theory
        • Background
        • Modules
        • Reference and potential evaporation
        • Dynamic vegetation processes
        • Snow processes
        • Glacier processes
        • Soil water processes
        • Soil erosion processes
        • Routing
      • Applications
        • Irrigation management in lowland areas
        • Snow- and glacier-fed river basins
        • Flow forecasting
      • Installation of SPHY
        • General
        • Installing SPHY as a stand-alone application
          • Miniconda
          • SPHY v3.1 source code
      • Build your own SPHY-model
        • Select projection extent and resolution
        • Clone map
        • DEM and Slope
        • Delineate catchment and create local drain direction map
        • Preparing stations map and sub-basin.map
        • Glacier fraction map
        • Soil hydraulic properties
        • Other static input maps
        • Meteorological forcing map series
        • Open water evaporation
        • Dynamic vegetation module
        • Soil erosion model input
          • MUSLE
          • MMF
          • INCA
          • SHETRAN
          • DHVSM
          • HSFP
          • Soil erosion model calibration
          • Soil erosion model output
        • Sediment transport
        • Applications
        • Reporting
        • NetCDF
      • References
      • Copyright
      • Appendix 1: Input and Output
Powered by GitBook
On this page
  1. manual
  2. SPHY manual 3.1
  3. Build your own SPHY-model

DEM and Slope

PreviousClone mapNextDelineate catchment and create local drain direction map

Last updated 1 year ago

Before you continue with the next steps, make sure that you have opened the “Processing Toolbox” in QGIS (see Figure 24). Next make sure that you select the “Advanced interface” from the “Processing Toolbox” (see Figure 25).

Use your own DEM or otherwise the DEM provided in the database. You will need to project your DEM in the model’s projection and resample the DEM to model resolution and extent. You can do that using the following steps:

  1. Drag the DEM inside the QGIS canvas;

  2. Use the Warp tool in QGIS to reproject the DEM to the Coordinate Reference System (CRS) of your basin (EPSG:XXXXXX). This can be found under Raster 🡪 Projections 🡪 Warp (Reproject) (see Figure 26).

  3. Within the Warp tool you need to select the “Input file”, the “Output file”, and the “Target SRS”. The “Input file” is the layer that you need to reproject, which is in this case the dem. The “Output file” is the file to which you want to save the reprojected dem in GeoTiff format (*.tif). Give it a useful name and save it in a directory that is useful. In the example of Figure 27, the reprojected dem is saved under the SPHY/input/ directory with the name: dem_pr.tif. Finally, it is important that you select the correct “Target SRS” (EPSG:XXXXX), which you defined in Section 5.1. In the example of Figure 27 it is EPSG:32737. Then click OK to do the reprojection. After the reprojection is finished click OK, and again OK, and finally Close.

  1. The next step involves resampling the projected dem from step 3) to the extent and spatial resolution of the clone.map. For this you need to type “resampling” in the “Processing Toolbox” search window (see Figure 28).

  1. Then double click “Resampling” under SAGA 🡪 Grid – Tools to open the Resampling tool as shown in Figure 29.

  2. Within this tool you need to select the “Grid” file that you want to resample, the “Interpolation Methods” for scaling up and for scaling down, the “Output extent”, the “Cellsize”, and the “Grid” to which you want to save the resampled file. You also need to check or uncheck the “Preserve Data Type” option. You can use Table 9 to determine which options to set for the “Preserve Data Type”, and the “Interpolation Methods” for scaling up and for scaling down.

Table 9: Resampling settings based on the layer data type.

Layer data type
Preserve data type
Interpolation Method (scale up)
Interpolation Method (scale down)
Example layer

Continuous

No

Bilinear

Bilinear

DEM

Classified

No

Majority

Nearest neighbor

Landuse

  1. Since the projected dem that we want to resample is continuous data, we select “Bilinear Interpolation” for both the interpolation methods, and we uncheck the “Preserve Data Type” option. For the “Grid” we select the projected dem from step 3). For the “Output extent” we use the layer extent (see Figure 29) of the clone.map. For the “Cellsize” (=cell length) you can fill in the value that you determined in Section 5.1. Then, save the resampled Grid as GeoTiff in the “Grid” in a useful directory. In the example of Figure 29 the file is saved as dem_res.tif under the directory SPHY/input/. Finally, click Run to finish the resampling. If these steps are performed correctly, then your resampled dem should have the same extent and spatial resolution as your clone.map.

  2. The final step involves converting the GeoTiff format to the PCRaster *.map format. This can be done using the Translate function under Raster 🡪 Conversion 🡪Translate (Convert Format) (see Figure 30).

  1. In the “Translate” box (see Figure 31) make sure that you select the “Input Layer” (result from step 7) and set the “Output Layer”. The “Output Layer” should be save as PCRaster Raster File format (*.map). In the example of Figure 32 we save it in the SPHY\input\ directory with the name dem.map. Finally click OK, and OK, and OK, and Close to finish this step.

Now you should have the DEM in the model resolution and extent and in PCRaster format.

pcrcalc slope.map = slope(dem.map)

The slope map can be derived from the DEM using the command. This can be done in the Windows Command line window by typing:

slope
Figure 24: Opening the "Processing Toolbox".
Figure 25: Selecting the "Advanced interface" in the "Processing Toolbox".
Figure 26: Warp tool
Figure 27: Setting the files and Source and Target SRS in the Warp Tool.
Figure 28: Selecting the Resampling tool in the Processing Toolbox.
Figure 29: Setting the Resampling tool options.
Figure 30: Translate tool (convert raster format)
Figure 31: Setting the Translate options.
Figure 32: Saving the translated raster as a PCRaster Raster File (*.map).