oscarperpinan / meteoForecast

A package to access outputs from Numerical Weather Prediction models both in raster format and as a time series for a location
GNU General Public License v3.0
51 stars 25 forks source link

length of 'dimnames' [2] not equal to array extent #28

Closed neilcharles closed 9 months ago

neilcharles commented 1 year ago

I'm really happy to discover your package but I'm having problems when I try to access GFS. Temperature from GFS works fine but getPoint for wind variables is throwing an error.

library(meteoForecast)

mfService('gfs')

vars_available <- grepVar('wind', service = 'gfs')
> vars_available
[1] "u-component_of_wind_isobaric" "v-component_of_wind_height_above_ground" "u-component_of_wind_height_above_ground"
[4] "v-component_of_wind_isobaric" 
getPoint(c(-2.61796, 53.89987), vars = 'u-component_of_wind_height_above_ground')
> length of 'dimnames' [2] not equal to array extent
oscarperpinan commented 12 months ago

Hello. This variable has a vertical coordinate that was not properly parsed by the getPoint function. With the last commit you should get the data with the next command:

uv <- getPoint(c(-2.61796, 53.89987),
               vars = c('u-component_of_wind_height_above_ground',
                        'v-component_of_wind_height_above_ground'),
               day = Sys.Date() - 1,
               vertical = 10)