diff --git a/src/downloads/downloads.jl b/src/downloads/downloads.jl index 41f7d31..0cd5b8b 100644 --- a/src/downloads/downloads.jl +++ b/src/downloads/downloads.jl @@ -24,7 +24,7 @@ Arguments - `overwrite` : `false` by default. If set to true, existing data will be overwritten. """ function download( - e5ds :: Union{ERA5Hourly,ERA5Monthly}, + e5ds :: ERA5CDStore, evar :: SingleVariable, ereg :: ERA5Region; ispy :: Bool = false, @@ -32,6 +32,8 @@ function download( overwrite :: Bool = false ) + downloadcheckereg(ereg) + if ispy pythonprint(e5ds,evar,ereg) else; cdsretrieve(e5ds,evar,ereg,grib,overwrite) @@ -63,12 +65,13 @@ Arguments - `overwrite` : `false` by default. If set to true, existing data will be overwritten. """ function download( - e5ds :: Union{ERA5Hourly,ERA5Monthly}, + e5ds :: ERA5CDStore, evar :: Vector{SingleVariable}, ereg :: ERA5Region; overwrite :: Bool = false ) + downloadcheckereg(ereg) cdsretrieve(e5ds,evar,ereg,overwrite) end @@ -119,6 +122,8 @@ function download( overwrite :: Bool = false ) + downloadcheckereg(ereg) + if ispy pythonprint(e5ds,evar,ereg) else @@ -150,6 +155,18 @@ function downloadcheckhPa( end +function downloadcheckereg( + ereg :: ERA5Region +) + + if !(ereg.geo <: RectRegion) + + error("$(modulelog()) - ERA5Reanalysis is not yet set up to download GeoRegions that are not RectRegions. Check back in a later update for more.") + + end + +end + function downloadcheckplvl( pall :: Bool, ptop :: Int,