@@ -6,30 +6,30 @@ function _validate_deltares_worldflood_params(; year, res, dem_source, return_pe
6
6
# check the parameters
7
7
# resolution depends on dem_source
8
8
if dem_source == :NASADEM || dem_source == :MERITDEM
9
- @assert res in (" 90m" , " 1km" )
9
+ @assert res in (" 90m" , " 1km" ) " Provided: $res , expected one of "
10
10
elseif dem_source == :LIDAR
11
- @assert res == " 5km"
11
+ @assert res == " 5km" " Provided: $res , expected one of "
12
12
else
13
- @assert dem_source in (:NASADEM , :MERITDEM , :LIDAR )
13
+ @assert dem_source in (:NASADEM , :MERITDEM , :LIDAR ) " Provided: $dem_source , expected one of "
14
14
end
15
15
16
- @assert return_period in (0 , 2 , 5 , 10 , 25 , 50 , 100 , 250 )
17
- @assert year in (2018 , 2050 )
16
+ @assert return_period in (0 , 2 , 5 , 10 , 25 , 50 , 100 , 250 ) " Provided: $return_period , expected one of "
17
+ @assert year in (2018 , 2050 ) " Provided: $year , expected one of "
18
18
return true
19
19
end
20
20
21
21
22
22
getraster_keywords (:: Type{<: Deltares{<: WorldFlood}} ) = (:year , :res , :dem_source , :return_period )
23
23
24
- function rastername (:: Type{<: Deltares{<: WorldFlood}} , layer; res:: String = " 90m" , dem_source:: Symbol = :NASADEM , return_period:: Int = 100 )
24
+ function rastername (:: Type{<: Deltares{<: WorldFlood}} , layer; year = 2050 , res:: String = " 90m" , dem_source:: Symbol = :NASADEM , return_period:: Int = 100 )
25
25
26
26
# validate params
27
27
_validate_deltares_worldflood_params (; year, res, dem_source, return_period)
28
- " GFM_global_$(dem_source)$(res) _$(sea_level_year ) slr_rp$(lpad (return_period, 4 , ' 0' )) _masked.nc"
28
+ " GFM_global_$(dem_source)$(res) _$(year ) slr_rp$(lpad (return_period, 4 , ' 0' )) _masked.nc"
29
29
30
30
end
31
31
32
- function rasterpath (T:: Type{<: Deltares{<: WorldFlood}} , layer; year = 2050 , res:: String = " 90m" , dem_source:: Symbol = :NASADEM , return_period:: Int = 100 )
32
+ function rasterpath (T:: Type{<: Deltares{<: WorldFlood}} , layer; year = 2050 , res:: String = " 90m" , dem_source:: Symbol = :NASADEM , return_period:: Int = 100 )
33
33
34
34
# validate params
35
35
_validate_deltares_worldflood_params (; year, res, dem_source, return_period)
@@ -48,7 +48,7 @@ function rasterurl(T::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res:
48
48
49
49
end
50
50
51
- function getraster (T:: Type{<: Deltares{<: WorldFlood}} , layer; year = 2050 , res:: String = " 90m" , dem_source:: Symbol = :NASADEM , return_period:: Int = 100 )
51
+ function getraster (T:: Type{<: Deltares{<: WorldFlood}} , layer; year = 2050 , res:: String = " 90m" , dem_source:: Symbol = :NASADEM , return_period:: Int = 100 )
52
52
raster_path = rasterpath (T, layer; year, res, dem_source, return_period)
53
53
mkpath (dirname (raster_path))
54
54
_maybe_download (rasterurl (T, layer; year, res, dem_source, return_period), raster_path)
0 commit comments