biopsichas / svatools

SWAT+ model input data preparation helper
https://biopsichas.github.io/svatools/
MIT License
5 stars 1 forks source link

get_atmo_dep() error -- Monthly and Daily #2

Closed moritzshore closed 1 year ago

moritzshore commented 1 year ago

get_atmo_dep() works for annual values, yet throws an error if t_ext is set to "month"

catchment_boundary_path <- paste0(buildr_path, "basin.shp")

 atm_dep_df_monthly <- svatools::get_atmo_dep(
+   catchment_boundary_path,
+   t_ext = "month",
+   start_year = 2016,
+   end_year = 2019
+ )
[1] "Working on year 2016"
Error in apply(var.get.nc(r, "DDEP_OXN_m2Grid")[ilon, ilat, ] * 4.4268/100,  : 
  'MARGIN' does not match dim(X)

The same error applies for "day"

Something wrong with the coordinate reference system of the catchment boundary maybe? Its using EPSG:25832

Also just a small side note, in the documentation, it states that t_ext can be set to "hour", yet the function does not support it!

Error: "Wrong t_ext!!! Should be one of these strings: 'year', 'month' or 'day'."

biopsichas commented 1 year ago

Thanks Mo for the feedback. Please update package, it should be fixed now. I removed day and hour options as they should not be working on an average computer as files are huge (>20Gb link here )