Skip to content

Commit

Permalink
Remove occurrences from the DEM raster in TIFF format
Browse files Browse the repository at this point in the history
  • Loading branch information
soaressgabriel committed Feb 23, 2024
1 parent 1dc351c commit 223bfb1
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 63 deletions.
19 changes: 0 additions & 19 deletions doc/source/fileformats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,6 @@ This file is the result of pre-processing the corresponding TIFF/GeoTIFF raster
- Columns = :ref:`clone columns<fileformats:Mask of Catchment (Clone) raster>`;
- Cell Size = :ref:`clone cell size<fileformats:Mask of Catchment (Clone) raster>`.

Digital Elevation Map (DEM) raster (TIFF)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Filetype: TIFF :file:`*.tif` raster file.
- Unit: `Meters Above Sea Level (MASL) <https://wiki.gis.com/wiki/index.php/Meters_above_sea_level>`_
- Valid Range: :math:`[-100.0, 10000.0]`
- Restrictions:

- ``PCRASTER_VALUESCALE`` = ``VS_SCALAR``;
- None of the pixels in the raster must contain ``NO_DATA`` value;
- Raster pixels cannot consist entirely of ``1.0`` values;
- Raster pixels cannot consist entirely of ``0.0`` values.

- Dimensions:

- Rows = :ref:`clone rows <fileformats:Mask of Catchment (Clone) raster>`;
- Columns = :ref:`clone columns<fileformats:Mask of Catchment (Clone) raster>`;
- Cell Size = :ref:`clone cell size<fileformats:Mask of Catchment (Clone) raster>`.


Local Drain Direction (LDD) raster
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 0 additions & 6 deletions doc/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ In the part ``Grid`` set 500.000 m as size value and in the part Simulation Peri
[RASTERS]
dem = /Iguazu/input/maps/dem/dem.map
demtif = /Iguazu/input/maps/dem/dem.tif
clone = /Iguazu/input/maps/clone/clone.map
samples = /Iguazu/maps/stations/samples.map
Expand Down Expand Up @@ -109,7 +108,6 @@ Set the following values for ``Initial Soil Conditions`` fields:
[RASTERS]
dem = /Iguazu/input/maps/dem/dem.map
demtif = /Iguazu/input/maps/dem/dem.tif
clone = /Iguazu/input/maps/clone/clone.map
samples = /Iguazu/maps/stations/samples.map
soil = /Iguazu/input/maps/soil/soil.map
Expand Down Expand Up @@ -174,7 +172,6 @@ Use the default values for ``FPAR``, ``LAI`` and ``Impervious Area Interception`
[RASTERS]
dem = /Iguazu/input/maps/dem/dem.map
demtif = /Iguazu/input/maps/dem/dem.tif
clone = /Iguazu/input/maps/clone/clone.map
samples = /Iguazu/maps/stations/samples.map
soil = /Iguazu/input/maps/soil/soil.map
Expand Down Expand Up @@ -243,7 +240,6 @@ In the ``Climate`` section define the appropriate map-series from :file:`/input/
[RASTERS]
dem = /Iguazu/input/maps/dem/dem.map
demtif = /Iguazu/input/maps/dem/dem.tif
clone = /Iguazu/input/maps/clone/clone.map
samples = /Iguazu/maps/stations/samples.map
soil = /Iguazu/input/maps/soil/soil.map
Expand Down Expand Up @@ -335,7 +331,6 @@ Values in this tab correspond to calibrated parameters in the basin. For the dat
[RASTERS]
dem = /Iguazu/input/maps/dem/dem.map
demtif = /Iguazu/input/maps/dem/dem.tif
clone = /Iguazu/input/maps/clone/clone.map
samples = /Iguazu/maps/stations/samples.map
soil = /Iguazu/input/maps/soil/soil.map
Expand Down Expand Up @@ -420,7 +415,6 @@ The complete project configuration file should look like this:
[RASTERS]
dem = /Iguazu/input/maps/dem/dem.map
demtif = /Iguazu/input/maps/dem/dem.tif
clone = /Iguazu/input/maps/clone/clone.map
samples = /Iguazu/maps/stations/samples.map
soil = /Iguazu/input/maps/soil/soil.map
Expand Down
14 changes: 1 addition & 13 deletions doc/source/userguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,13 @@ Mandatory path to the output folder. Must be a valid path to an existing **empty
Digital Elevation Map (DEM)
```````````````````````````

Mandatory path to Digital Elevation Map (DEM) file `[masl] <https://wiki.gis.com/wiki/index.php/Meters_above_sea_level>`_ in:

* **PCRaster map format** :file:`*.map`: this map contains topographic ground elevation in meters. Must be a valid file path to a PCRaster map format :file:`*.map` file. :ref:`See more. <fileformats:Digital Elevation Map (DEM) raster>`
Mandatory path to Digital Elevation Map (DEM) file `[masl] <https://wiki.gis.com/wiki/index.php/Meters_above_sea_level>`_ in PCRaster map format :file:`*.map`: this map contains topographic ground elevation in meters. Must be a valid file path to a PCRaster map format :file:`*.map` file. :ref:`See more. <fileformats:Digital Elevation Map (DEM) raster>`

.. code-block:: dosini
[RASTERS]
dem = /Dataset/UIGCRB/input/maps/dem/dem.map
-------

* **TIF format** :file:`*.tif`: this map contains topographic ground elevation in meters. Must be a valid file path to a TIF :file:`*.tif` raster file. :ref:`See more. <fileformats:Digital Elevation Map (DEM) raster (TIFF)>`

.. code-block:: dosini
[RASTERS]
demtif = /Dataset/UIGCRB/input/maps/dem/dem.tif
Mask of Catchment (Clone)
``````````````````````````

Expand Down Expand Up @@ -808,7 +797,6 @@ Configuration File Template
[RASTERS]
dem = /Dataset/UIRB/input/maps/dem/dem.map
demtif = /Dataset/UIRB/input/maps/dem/dem.tif
clone = /Dataset/UIRB/input/maps/clone/clone.map
ndvi_max = /Dataset/UIRB/input/maps/ndvi/ndvi_max.map
ndvi_min = /Dataset/UIRB/input/maps/ndvi/ndvi_min.map
Expand Down
13 changes: 0 additions & 13 deletions rubem/configuration/input_raster_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ class InputRasterFiles:
:param dem: Path to the DEM file (*.map format).
:type dem: Union[str, bytes, os.PathLike]
:param demtif: Path to the DEM file (*.tif format).
:type demtif: Union[str, bytes, os.PathLike]
:param clone: Path to the mask of catchment (clone) file.
:type clone: Union[str, bytes, os.PathLike]
Expand Down Expand Up @@ -46,7 +43,6 @@ class InputRasterFiles:
def __init__(
self,
dem: Union[str, bytes, os.PathLike],
demtif: Union[str, bytes, os.PathLike],
clone: Union[str, bytes, os.PathLike],
ndvi_max: Union[str, bytes, os.PathLike],
ndvi_min: Union[str, bytes, os.PathLike],
Expand All @@ -59,7 +55,6 @@ def __init__(
self.__ranges = DataRangesSettings()

self.dem = dem
self.demtif = demtif
self.clone = clone
self.ndvi_max = ndvi_max
self.ndvi_min = ndvi_min
Expand All @@ -81,13 +76,6 @@ def __validate_files(self) -> None:
| RasterDataRules.FORBID_ALL_ZEROES
| RasterDataRules.FORBID_ALL_ONES,
),
(
self.demtif,
self.__ranges.rasters["dem"],
RasterDataRules.FORBID_NO_DATA
| RasterDataRules.FORBID_ALL_ZEROES
| RasterDataRules.FORBID_ALL_ONES,
),
(self.clone, self.__ranges.rasters["clone"], RasterDataRules.FORBID_ALL_ZEROES),
(self.ndvi_max, self.__ranges.rasters["ndvi"], RasterDataRules.FORBID_NO_DATA),
(self.ndvi_min, self.__ranges.rasters["ndvi"], RasterDataRules.FORBID_NO_DATA),
Expand Down Expand Up @@ -131,7 +119,6 @@ def __validate_files(self) -> None:
def __str__(self) -> str:
return (
f"DEM (PCRaster Map): {self.dem}\n"
f"DEM (GeoTIFF Map): {self.demtif}\n"
f"Mask of Catchment (Clone): {self.clone}\n"
f"Local Drain Direction (LDD): {self.ldd if self.ldd else 'Not specified.'}\n"
f"NDVI Max.: {self.ndvi_max}\n"
Expand Down
1 change: 0 additions & 1 deletion rubem/configuration/model_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def __init__(
)
self.raster_files = InputRasterFiles(
dem=self.__get_setting("RASTERS", "dem"),
demtif=self.__get_setting("RASTERS", "demtif"),
clone=self.__get_setting("RASTERS", "clone"),
ndvi_max=self.__get_setting("RASTERS", "ndvi_max"),
ndvi_min=self.__get_setting("RASTERS", "ndvi_min"),
Expand Down
2 changes: 0 additions & 2 deletions rubem/validation/_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"RASTERS": {
"dem": "None",
"demtif": "None",
"clone": "None",
"ndvi_max": "None",
"ndvi_min": "None",
Expand Down Expand Up @@ -124,7 +123,6 @@
},
"RASTERS": {
"dem": "None",
"demtif": "None",
"clone": "None",
"ndvi_max": "None",
"ndvi_min": "None",
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/base.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ landuse_prefix = cob

[RASTERS]
dem = {PARENT_DIR}/fixtures/base/maps/dem/dem.map
demtif = {PARENT_DIR}/fixtures/base/maps/dem/dem.tif
clone = {PARENT_DIR}/fixtures/base/maps/clone/clone.map
ndvi_max = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_max.map
ndvi_min = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_min.map
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/base2.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ landuse_prefix = cob

[RASTERS]
dem = {PARENT_DIR}/fixtures/base/maps/dem/dem.map
demtif = {PARENT_DIR}/fixtures/base/maps/dem/dem.tif
clone = {PARENT_DIR}/fixtures/base/maps/clone/clone.map
ndvi_max = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_max.map
ndvi_min = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_min.map
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/base3.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ landuse_prefix = cob

[RASTERS]
dem = {PARENT_DIR}/fixtures/base/maps/dem/dem.map
demtif = {PARENT_DIR}/fixtures/base/maps/dem/dem.tif
clone = {PARENT_DIR}/fixtures/base/maps/clone/clone.map
ndvi_max = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_max.map
ndvi_min = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_min.map
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/base4.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[RASTERS]
dem = {PARENT_DIR}/fixtures/base/maps/dem/dem.map
demtif = {PARENT_DIR}/fixtures/base/maps/dem/dem.tif
clone = {PARENT_DIR}/fixtures/base/maps/clone/clone.map
ndvi_max = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_max.map
ndvi_min = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_min.map
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/base7.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[RASTERS]
dem = {PARENT_DIR}/fixtures/base/maps/dem/dem.mapp
demtif = {PARENT_DIR}/fixtures/base/maps/dem/dem.tif
clone = {PARENT_DIR}/fixtures/base/maps/clone/clone.map
ndvi_max = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_max.map
ndvi_min = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_min.map
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/base8.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[RASTERS]
dem = {PARENT_DIR}/fixtures/base/maps/dem/dem.map
demtif = {PARENT_DIR}/fixtures/base/maps/dem/dem.tif
clone = {PARENT_DIR}/fixtures/base/maps/clone/clone.map
ndvi_max = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_max.map
ndvi_min = {PARENT_DIR}/fixtures/base/maps/ndvi/ndvi_min.map
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/configuration/test_model_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class TestModelConfiguration:
},
"RASTERS": {
"dem": "test_path/test_file.map",
"demtif": "test_path/test_file.tif",
"clone": "test_path/test_file.map",
"ndvi_max": "test_path/test_file.map",
"ndvi_min": "test_path/test_file.map",
Expand Down Expand Up @@ -103,7 +102,6 @@ class TestModelConfiguration:
landuse_prefix = cob
[RASTERS]
dem = /test_path/test_file.map
demtif = /test_path/test_file.tif
clone = /test_path/test_file.map
ndvi_max = /test_path/test_file.map
ndvi_min = /test_path/test_file.map
Expand Down Expand Up @@ -184,7 +182,6 @@ class TestModelConfiguration:
},
"RASTERS": {
"dem": "test_path/test_file.map",
"demtif": "test_path/test_file.tif",
"clone": "test_path/test_file.map",
"ndvi_max": "test_path/test_file.map",
"ndvi_min": "test_path/test_file.map",
Expand Down

0 comments on commit 223bfb1

Please sign in to comment.