<font color='black' size='2' face='arial'><font size="2">Hi rNOMADS users,<br>
<br>
<b>Setup</b>:<br>
-- I'm playing with rNOMADS (started with rNOMADS yesterday). <br>
-- Most likely I should be doing something wrong here but<font color="red"> what concerns me</font>, the <font color="orangered">GribGrab's 'model.domain' option</font> is <font color="red"><b>not</b> kicking in</font>...<br>
-- Here is some sample code:<br>
<br>
rm(list = ls())<br>
library(rNOMADS)<br>
<br>
#A location near my house<br>
lat <- 35.828304<br>
lon <- -79.107467<br>
<br>
#Get nearest model nodes<br>
lons <- seq(0, 359.5, by = 0.5)<br>
lats <- seq(-90, 90, by = 0.5)<br>
lon.diff <- abs(lon + 360 - lons)<br>
lat.diff <- abs(lat - lats)<br>
model.lon.ind <- which(lon.diff == min(lon.diff)) - 1 #NOMADS indexes at 0<br>
model.lat.ind <- which(lat.diff == min(lat.diff)) - 1 <br>
model_domain <- c(model.lon.ind, model.lon.ind, model.lat.ind, model.lat.ind)<br>
<br>
#Find the latest Global Forecast System model run<br>
urls.out <- CrawlModels(abbrev = "gfs_0p50", depth = 2)<br>
urls.out <- gsub("gfs_0p50", "gfs_0p25_1hr", urls.out) #this is meant to avoid the error coming from using </font><font size="2"><font size="2"> CrawlModels(abbrev = "</font></font><font size="2"><font size="2"><font size="2">gfs_0p25_1hr</font>", depth = 2)</font> <br>
<br>
latest.model <- urls.out[1]<br>
model.parameters <- ParseModelPage(latest.model)<br>
pred.ind <- c(3,4,5) #use only 3 temperature forecasts<br>
<br>
variables <- c("TMP")<br>
levels <- c("2 m above ground")<br>
grib.info <- GribGrab(urls.out[1], model.parameters$pred[pred.ind], levels, variables, model.domain = model_domain)<br>
grib.data <- ReadGrib(grib.info[[1]]$file.name, levels, variables, domain = model_domain) <br>
<br>
<b>Observations</b>:<br>
1. The region I need temperatures for is a single geographic point:<br>
model_domain <- c(562, 562, 252, 252)<br>
<br>
2. Still, GribGrab produces in this case 3 downloaded .grb files, each 1.4 MB, which seems a lot for a single temperature data point inside each one.<br>
<br>
3. The length of grib.data[[7]] is 1038240, which again confirms that GribGrabd is downloading temperatures for the whole world and not for the single geographic point with (lat, lon), given above.<br>
<br>
<b>Questions</b>:<br>
A. Am I doing anything wrong here, or the model.domain option is somehow, permanently set to NULL??<br>
<br>
B. More generally, how can I download data only for a specified location, so that not to burden unnecessarily the NOMADS server?<br>
<br>
Thank you in advance.<br>
<br>
Anguel<br>
<br>
<br>
</font></font>