From a1aae3c776f49fc152423cc9624c0b762e00e8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poisot?= Date: Thu, 26 Sep 2024 15:13:53 -0400 Subject: [PATCH] CHELSA url changed? (#283) * bug: fix CHELSA1 url * bug(datasets): chelsa v2 url * semver(datasets): v0.2.3 * bug: fix errant typo * bug(dataset): chelsa2 future * bug(datasets): chelsa v2 future * doc: fix demo * doc: fig size instead of resolution * bug: doc --- SimpleSDMDatasets/Project.toml | 2 +- SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v1.jl | 4 ++-- SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v2.jl | 6 ++++-- SimpleSDMDatasets/src/providers/CHELSA/chelsa_v1.jl | 6 +++--- SimpleSDMDatasets/src/providers/CHELSA/chelsa_v2.jl | 4 ++-- docs/src/howto/makie.jl | 2 +- docs/src/tutorials/arithmetic.jl | 2 +- docs/src/tutorials/futureclimate.jl | 2 +- docs/src/tutorials/layers_and_occurrences.jl | 2 +- docs/src/tutorials/polygons.jl | 2 +- docs/src/tutorials/pseudoabsences.jl | 6 +++--- docs/src/tutorials/statistics.jl | 6 +++--- 12 files changed, 23 insertions(+), 21 deletions(-) diff --git a/SimpleSDMDatasets/Project.toml b/SimpleSDMDatasets/Project.toml index be6c71df3..9eac08259 100644 --- a/SimpleSDMDatasets/Project.toml +++ b/SimpleSDMDatasets/Project.toml @@ -1,7 +1,7 @@ name = "SimpleSDMDatasets" uuid = "2c7d61d0-5c73-410d-85b2-d2e7fbbdcefa" authors = ["Timothée Poisot "] -version = "0.2.2" +version = "0.2.3" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v1.jl b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v1.jl index 550f21462..c40aad5b1 100644 --- a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v1.jl +++ b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v1.jl @@ -65,7 +65,7 @@ function source( ) where {T <: BioClim, S <: CHELSA1Scenario, M <: CHELSA1Model} var_code = (layer isa Integer) ? layer : findfirst(isequal(layer), layers(data)) year_sep = string(timespan.first.value) * "-" * string(timespan.second.value) - root = "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/cmip5/$(year_sep)/bio/" + root = "https://os.zhdk.cloud.switch.ch/chelsav1/cmip5/$(year_sep)/bio/" stem = "CHELSA_bio_mon_$(replace(string(M), "_" => "-"))_$(lowercase(string(S)))_r1i1p1_g025.nc_$(var_code)_$(year_sep)_V1.2.tif" return ( url = root * stem, @@ -88,7 +88,7 @@ function source( Dict(["pr" => "prec", "tasmin" => "tmin", "tas" => "temp", "tasmax" => "tmax"]) month_code = string(month.value) year_sep = string(timespan.first.value) * "-" * string(timespan.second.value) - root = "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/cmip5/$(year_sep)/$(var_url[var_code])/" + root = "https://os.zhdk.cloud.switch.ch/chelsav1/cmip5/$(year_sep)/$(var_url[var_code])/" stem = "CHELSA_$(var_code)_mon_$(replace(string(M), "_" => "-"))_$(lowercase(string(S)))_r1i1p1_g025.nc_$(month_code)_$(year_sep)_V1.2.tif" return ( url = root * stem, diff --git a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v2.jl b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v2.jl index 68adc8773..6b06cbd71 100644 --- a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v2.jl +++ b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_future_v2.jl @@ -25,7 +25,7 @@ function source( var_code = (layer isa Integer) ? layer : findfirst(isequal(layer), layers(data)) year_sep = string(timespan.first.value) * "-" * string(timespan.second.value) model_sep = replace(uppercase(string(M)) * "/" * lowercase(string(S)), "_" => "-") - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/$(year_sep)/$(model_sep)/bio/" + root = "https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/climatologies/$(year_sep)/$(model_sep)/bio/" stem = "CHELSA_bio$(var_code)_$(year_sep)_$(lowercase(replace(string(M), "_" => "-")))_$(lowercase(string(S)))_V.2.1.tif" return ( url = root * stem, @@ -44,8 +44,10 @@ function source( month_code = lpad(string(month.value), 2, '0') year_sep = string(timespan.first.value) * "-" * string(timespan.second.value) model_code = replace(uppercase(string(M)), "_" => "-") + model_sep = replace(uppercase(string(M)) * "/" * lowercase(string(S)), "_" => "-") scenario_code = replace(lowercase(string(S)), "_" => "-") - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/$(year_sep)/$(model_code)/$(scenario_code)/$(var_code)/" + scenario_sep = lowercase(string(S)) + root = "https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/climatologies/$(year_sep)/$(model_sep)/$(var_code)/" stem = "CHELSA_$(lowercase(model_code))_r1i1p1f1_w5e5_$(scenario_code)_$(var_code)_$(month_code)_$(replace(year_sep, "-"=>"_"))_norm.tif" return ( url = root * stem, diff --git a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v1.jl b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v1.jl index d69e6730e..75d6dd4f8 100644 --- a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v1.jl +++ b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v1.jl @@ -77,7 +77,7 @@ _var_slug(::RasterData{CHELSA1, Precipitation}) = "prec" function source(data::RasterData{CHELSA1, Precipitation}; month = Month(1)) var_code = _var_slug(data) month_code = lpad(string(month.value), 2, '0') - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V1/climatologies/$(var_code)/" + root = "https://os.zhdk.cloud.switch.ch/chelsav1/climatologies/$(var_code)/" stem = "CHELSA_$(var_code)_$(month_code)_V1.2_land.tif" return ( url = root * stem, @@ -89,7 +89,7 @@ end function source(data::RasterData{CHELSA1, T}; month = Month(1)) where {T <: CHELSA1Dataset} var_code = _var_slug(data) month_code = lpad(string(month.value), 2, '0') - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V1/climatologies/$(var_code)/" + root = "https://os.zhdk.cloud.switch.ch/chelsav1/climatologies/$(var_code)/" layer_code = (T <: AverageTemperature) ? "temp" : var_code stem = "CHELSA_$(layer_code)10_$(month_code)_1979-2013_V1.2_land.tif" return ( @@ -102,7 +102,7 @@ end function source(data::RasterData{CHELSA1, BioClim}; layer = "BIO1") var_code = (layer isa Integer) ? layer : findfirst(isequal(layer), layers(data)) var_pad = lpad(string(var_code), 2, '0') - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V1/climatologies/bio/" + root = "https://os.zhdk.cloud.switch.ch/chelsav1/climatologies/bio/" stem = "CHELSA_bio10_$(var_pad).tif" return ( url = root * stem, diff --git a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v2.jl b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v2.jl index e47e72e04..820b2dc32 100644 --- a/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v2.jl +++ b/SimpleSDMDatasets/src/providers/CHELSA/chelsa_v2.jl @@ -70,7 +70,7 @@ _var_slug(::RasterData{CHELSA2, BioClim}) = "bio" # Get the dataset source function source(data::RasterData{CHELSA2, BioClim}; layer = "BIO1") var_code = (layer isa Integer) ? layer : findfirst(isequal(layer), layers(data)) - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/1981-2010/bio/" + root = "https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/climatologies/1981-2010/bio/" stem = "CHELSA_bio$(var_code)_1981-2010_V.2.1.tif" return ( url = root * stem, @@ -82,7 +82,7 @@ end function source(data::RasterData{CHELSA2, T}; month = Month(1)) where {T <: CHELSA2Dataset} var_code = _var_slug(data) month_code = lpad(string(month.value), 2, '0') - root = "https://envicloud.wsl.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/1981-2010/$(var_code)/" + root = "https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/climatologies/1981-2010/$(var_code)/" stem = "CHELSA_$(var_code)_$(month_code)_1981-2010_V.2.1.tif" return ( url = root * stem, diff --git a/docs/src/howto/makie.jl b/docs/src/howto/makie.jl index 2b46a0eb2..b2e3ab999 100644 --- a/docs/src/howto/makie.jl +++ b/docs/src/howto/makie.jl @@ -11,7 +11,7 @@ CairoMakie.activate!(; type = "png", px_per_unit = 3.0) #hide spatial_extent = (; left = -4.87, right=9.63, bottom=41.31, top=51.14) data_prov = RasterData(CHELSA1, BioClim) -temperature = SDMLayer(data_prov; layer="BIO1", spatial_extent...) +temperature = 0.1SDMLayer(data_prov; layer="BIO1", spatial_extent...) precipitation = SDMLayer(data_prov; layer="BIO8", spatial_extent...) # ::: info Additional arguments diff --git a/docs/src/tutorials/arithmetic.jl b/docs/src/tutorials/arithmetic.jl index ae35276f0..7675c44c1 100644 --- a/docs/src/tutorials/arithmetic.jl +++ b/docs/src/tutorials/arithmetic.jl @@ -57,7 +57,7 @@ rescale!(resistance_layer) resistance_map = heatmap( resistance_layer; colormap = Reverse(:linear_protanopic_deuteranopic_kbjyw_5_95_c25_n256), - figure = (; resolution = (400, 350)), + figure = (; size = (400, 350)), axis = (; aspect = DataAspect(), xlabel = "Latitude", diff --git a/docs/src/tutorials/futureclimate.jl b/docs/src/tutorials/futureclimate.jl index 38351af44..89c84614f 100644 --- a/docs/src/tutorials/futureclimate.jl +++ b/docs/src/tutorials/futureclimate.jl @@ -116,7 +116,7 @@ end fig, ax, hm = heatmap( Δclim; colormap = :lipari, - figure = (; resolution = (800, 400)), + figure = (; size = (800, 400)), axis = (; aspect = DataAspect()), ) Colorbar(fig[:, end + 1], hm) diff --git a/docs/src/tutorials/layers_and_occurrences.jl b/docs/src/tutorials/layers_and_occurrences.jl index e15d7f6f7..7d08ad74c 100644 --- a/docs/src/tutorials/layers_and_occurrences.jl +++ b/docs/src/tutorials/layers_and_occurrences.jl @@ -44,7 +44,7 @@ end # indexing method to extract the values from the layers at the location of each # occurrence. -figure = Figure(; resolution = (800, 400)) +figure = Figure(; size = (800, 400)) envirovars = Axis(figure[1, 1]; xlabel = "Temperature (°C)", ylabel = "Precipitation (kg×m⁻²)") diff --git a/docs/src/tutorials/polygons.jl b/docs/src/tutorials/polygons.jl index 8fd1cc96b..5b6b5ce7c 100644 --- a/docs/src/tutorials/polygons.jl +++ b/docs/src/tutorials/polygons.jl @@ -41,7 +41,7 @@ SpeciesDistributionToolkit.gadmlist("FRA", 3)[1:3] # The next step is to get a layer, and so we will download the data about # deciduous broadleaf trees from [EarthEnv](/datasets/EarthEnv#landcover): -provider = RasterData(EartheEnv, LandCover) +provider = RasterData(EarthEnv, LandCover) layer = SDMLayer( provider; layer = "Deciduous Broadleaf Trees", diff --git a/docs/src/tutorials/pseudoabsences.jl b/docs/src/tutorials/pseudoabsences.jl index eda895019..67630590d 100644 --- a/docs/src/tutorials/pseudoabsences.jl +++ b/docs/src/tutorials/pseudoabsences.jl @@ -70,7 +70,7 @@ heatmap( temperature; colormap = :deep, axis = (; aspect = DataAspect()), - figure = (; resolution = (800, 500)), + figure = (; size = (800, 500)), ) heatmap!(bgmask; colormap = cgrad([:transparent, :white]; alpha = 0.3)) scatter!(presences; color = :black) @@ -87,7 +87,7 @@ heatmap( temperature; colormap = :deep, axis = (; aspect = DataAspect()), - figure = (; resolution = (800, 500)), + figure = (; size = (800, 500)), ) heatmap!(sre; colormap = cgrad([:transparent, :white]; alpha = 0.3)) scatter!(presences; color = :black) @@ -108,7 +108,7 @@ heatmap( temperature; colormap = :deep, axis = (; aspect = DataAspect()), - figure = (; resolution = (800, 500)), + figure = (; size = (800, 500)), ) heatmap!(bgmask; colormap = cgrad([:transparent, :white]; alpha = 0.3)) scatter!(presences; color = :black) diff --git a/docs/src/tutorials/statistics.jl b/docs/src/tutorials/statistics.jl index 764b18bf9..972221537 100644 --- a/docs/src/tutorials/statistics.jl +++ b/docs/src/tutorials/statistics.jl @@ -47,7 +47,7 @@ fig, ax, hm = heatmap( z_temperature; colormap = :broc, colorrange = (-2, 2), - figure = (; resolution = (800, 400)), + figure = (; size = (800, 400)), axis = (; aspect = DataAspect()), ) Colorbar(fig[:, end + 1], hm) @@ -62,7 +62,7 @@ current_figure() #hide fig, ax, hm = heatmap( rescale(precipitation, (0.0, 1.0)); colormap = :bamako, - figure = (; resolution = (800, 400)), + figure = (; size = (800, 400)), axis = (; aspect = DataAspect()), ) Colorbar(fig[:, end + 1], hm) @@ -74,7 +74,7 @@ current_figure() #hide fig, ax, hm = heatmap( quantize(precipitation, 5); colormap = :bamako, - figure = (; resolution = (800, 400)), + figure = (; size = (800, 400)), axis = (; aspect = DataAspect()), ) Colorbar(fig[:, end + 1], hm)