SDC Sphy Manual
  • 📚Readme
  • manual
    • SPHY Manual
      • 1. Introduction
      • 2. Theory
        • 2.1 Background
        • Modules
        • Reference and potential evaporation
        • Dynamic vegetation processes
        • Snow processes
        • Glacier processes
        • Soil water processes
        • Soil erosion processes
        • Routing
      • 3. Applications
        • Irrigation management in lowland areas
        • Snow- and glacier-fed river basins
        • Flow forecasting
      • 4. Installation of SPHY
      • 5. SPHY model GUI
        • 5.1 Map canvas layers and GUI interactions
        • 5.2 Top menu buttons
        • 5.3 General settings
        • 5.4 Climate
        • 5.5 Soils
        • 5.6 Groundwater
        • 5.7 Land use
        • 5.8 Glaciers
        • 5.9 Snow
        • 5.10 Routing
        • 5.11 Report options
        • 5.12 Running the model
        • 5.13 Visualizing model output
      • 6. SPHY model preprocessor v1.0
        • 6.1 Overview
        • 6.2 General settings
        • 6.3 Area selection
        • 6.4 Modules
        • 6.5 Basin delineation
        • 6.6 Stations
        • 5.7 Meteorological forcing
      • 7. 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-basins map
        • Glacier fraction map
        • Soil hydraulic properties
        • Other static input maps
        • Meteorological forcing map series
        • Open water evaporation
        • Soil erosion model input
        • Sediment transport
        • Reporting
      • Appendix 1: Input and Output
      • Appendix 2: Hindu Kush-Himalaya database
      • References
      • Copyright
Powered by GitBook
On this page
  1. manual
  2. SPHY Manual
  3. 7. Build your own SPHY-model

DEM and Slope

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

Figure 23: Opening the “Processing Toolbox”.

Figure 24: Selecting the “Advanced interface” in the “Processing Toolbox”.

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 23).

  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 24, 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 24 it is EPSG:32737. Then click OK to do the reprojection. After the reprojection is finished click OK, and again OK, and finally Close.

Figure 25: Warp tool

Figure 26: Setting the files and Source and Target SRS in the Warp Tool.

  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 25).

Figure 27: Selecting the Resampling tool in the Processing Toolbox.

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

  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 4 to determine which options to set for the “Preserve Data Type”, and the “Interpolation Methods” for scaling up and for scaling down.

Figure 28: Setting the Resampling tool options.

Table 4: 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 26) 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 26 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 27).

Figure 29: Translate tool (convert raster format)

  1. In the “Translate” box (see Figure 28) 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 29 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.

Figure 30: Setting the Translate options.

Figure 31: Saving the translated raster as a PCRaster Raster File (*.map).

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

pcrcalc slope.map = slope(dem.map)

PreviousClone mapNextDelineate catchment and create local drain direction map

Last updated 1 year ago

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