<div dir="ltr"><div><div><div><div>Hi,<br><br></div>I am currently trying to query ECMWF data (<a href="http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=sfc/">http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=sfc/</a>) for a point (lon,lat) ~ (-71.5333,-32.7723). I query an area around this point as showed below:<br></div><img alt="Inline image 1" src="cid:ii_153ec1a8d5c1a8de" height="320" width="530"><br></div>Then, I use R to open the grip file: <br><br>library(rgdal)<br>library(maptools)<br>library(raster)<br>library(RCurl)<br>library(stringr)<br><br>setwd("XXXXXX")<br>#Initialize raster stack<br>rs<-stack()<br><br>#Get filenames in the folder<br>filePath<-"YYY"<br>fileNms<-list.files(filePath)<br><br>#Define Point of interest lon / lat<br>point <- cbind(-71.5333,-32.7723)<br><br># DB loading<br>grib <- readGDAL(paste(filePath,fileNms[1], sep=""))<br><br># Selection of significant height of total swell = param 237 (<a href="http://www.ecmwf.int/sites/default/files/elibrary/2011/8174-era-interim-archive-version-20.pdf">http://www.ecmwf.int/sites/default/files/elibrary/2011/8174-era-interim-archive-version-20.pdf</a>)<br>rLayer<-raster(grib, 237)<br>rLayer<br><br><br></div>I get the following results:<br><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)"><span class="" style="color:blue;white-space:pre">> </span><span class="" style="color:blue">summary(rLayer)
</span> band62
Min. 10.25290
1st Qu. 10.33603
Median 10.41916
3rd Qu. 10.41916
Max. 10.41916
NA's 15.00000
<span class="" style="color:blue;white-space:pre">> </span><span class="" style="color:blue">summary(rasterToPoints(rLayer))
</span> x y band62
Min. :288.0 Min. :-33.75 Min. :10.25
1st Qu.:288.0 1st Qu.:-33.00 1st Qu.:10.34
Median :288.0 Median :-32.25 Median :10.42
Mean :288.2 Mean :-32.75 Mean :10.36
3rd Qu.:288.4 3rd Qu.:-32.25 3rd Qu.:10.42
Max. :288.8 Max. :-32.25 Max. :10.42 <br><br></pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">My problems are the following:<br>1) Latitude is similar from what I expected but not the longitude.<br></pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">2) Data about date does not appear<br><br></pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">Thank you so much for your help !<br><br></pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">Sebastien<br></pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:"Lucida Console";font-size:10pt!important;outline:medium none;border:medium none;margin:0px;white-space:pre-wrap!important;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)"><br></pre><br></div>