Closed potterzot closed 5 years ago
thanks ! a few thigns:
gefs(var, lat, lon, date = date, forecast_time = "1800", ens_idx=2:4,
time_idx=1:8)
#> 'ens_idx' is depreciated and will be removed in future versions, please specify values (not indices) in 'ens' instead.
#> 'time_idx' is depreciated and will be removed in future versions, please specify values (not indices) in 'time' instead.
so instead change the example to use what whatever the new thing is
the last example, that is commented out, seems like it could be removed, especially since it fails, or should it stay?:
gefs(var, ens=1, time=1:12)
#> Error in round(lat, 0) : non-numeric argument to mathematical function
thanks, looks good
Change ensemble and time indices to be set according to the variable being queried rather than be fixed.
Description
ens_idx and time_idx were previously fixed by default to
but some variables have different lengths of time dimension. Now both indices are set based on the value range of the specific variable. In addition,
ens_idx
andtime_idx
were depreciated in favor ofens
andtime
, which allow the user to specify the values rather than the indices. This conforms to how the other dimension values (latitude and longitude) are set.Tests are also included to check that the new values are correctly set, that indices out of bounds return an informative error, and that indices override values if both are set (i.e. if
time = c(6,12)
andtime_idx = 1:3
, the query will return timesc(6,12,18)
that correspond to time indices1:3
).Related Issue
Fixes #320