From haksaeng at live.unc.edu Wed Sep 3 14:23:04 2014
From: haksaeng at live.unc.edu (Daniel Bowman)
Date: Wed, 3 Sep 2014 12:23:04 +0000
Subject: [Rnomads-user] rNOMADS 2.0.2 released
Message-ID: <1409747015271.19069@live.unc.edu>
Hi All,
Yesterday, I uploaded rNOMADS 2.0.2 to CRAN. I added a function for reading GRIB inventories and a plotting utility for showing wind profiles. I did a few other minor tweaks that you can read about in the NEWS document. For an example of the wind profile plot, have a look at the release note on my blog:
http://bovineaerospace.wordpress.com/2014/09/03/rnomads-2-0-2-released/
[http://bovineaerospace.files.wordpress.com/2014/09/winds1.png]
rNOMADS 2.0.2 released | Bovine Aerospace
I uploaded the newest version of rNOMADS to CRAN yesterday. This one has a new plotting function for wind altitude azimuth, and magnitude (see below for plot and source code). I also added a functi...
Read more...
Best,
Danny
Daniel C. Bowman
Doctoral Candidate in Geophysics
Mitchell 315
Department of Geological Sciences
The University of North Carolina at Chapel Hill
phone: 575-418-8555
email: daniel.bowman at unc.edu
web:http://geosci.unc.edu/page/daniel-c-bowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From akssimkowski at sbcglobal.net Mon Sep 8 21:31:11 2014
From: akssimkowski at sbcglobal.net (Adam Simkowski)
Date: Mon, 8 Sep 2014 12:31:11 -0700
Subject: [Rnomads-user] issues on retreveing specific location data in
rNOMADS
Message-ID: <1410204671.14316.YahooMailNeo@web181402.mail.ne1.yahoo.com>
Hi all,
I have been attempting to pull ?dswrfsfc?
(incoming solar radiation) at a specific latitude and longitude from the historical NAM data set available through rNOMADS. I followed
the example shown in various parts of the package notes where data is pulled
for Chapel Hill, NC. I am attempting to pull data for a location not too far from
Chapel Hill (Murfreesboro, NC). However, when I attempt to pull either solar
radiation or 2 meter temperature data for a given hour, I get 24 rows of data
with a longitude far away from my desired location and a latitude somewhat
nearby. I was under the impression that I should only get one row of data
closest to my desired location since I?m only querying for one specific hour. I
am not completely sure I understand the code to query data closest to a
desired location given a latitude and longitude... I have included this code in the attached items with my specific lat and lon ( file name: rNOMADS lat-lon code). Could someone please explain code here a little more in-depth than is shown in on the package vignette?
I
have also attached my script that I wrote to retrieve point specific model data for
Murfreesboro (Murphy solar) and an example of the 24 row data frame that it creates. The
script was written as a function where the input is a specific number assigned to a url
from the historical NAM list. An example input would be 1473 which is the url
for NAM runs on September 1st, 2014. I am hoping to fix the code so that it only returns one row of data instead of 24. I have also written a script
that pulls more than one model at a time using a for loop, but this lat lon
issue seems to be inhibiting me from creating a proper final output data frame
with good data. Once I figure out the lat lon issue here, I will certainly share this code for all to use!
Thank you,
Adam Simkowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rNOMADS lat-lon code.png
Type: image/png
Size: 13482 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getHistNAMdata.R
Type: application/octet-stream
Size: 1425 bytes
Desc: not available
URL:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solar data test.csv
Type: application/vnd.ms-excel
Size: 5761 bytes
Desc: not available
URL:
From haksaeng at live.unc.edu Tue Sep 9 02:52:54 2014
From: haksaeng at live.unc.edu (Daniel Bowman)
Date: Tue, 9 Sep 2014 00:52:54 +0000
Subject: [Rnomads-user] FW: issues on retreveing specific location data
in rNOMADS
In-Reply-To: <1410222665666.93329@live.unc.edu>
References: <1410204671.14316.YahooMailNeo@web181402.mail.ne1.yahoo.com>,
<1410222665666.93329@live.unc.edu>
Message-ID: <1410223974287.25800@live.unc.edu>
Daniel C. Bowman
Doctoral Candidate in Geophysics
Mitchell 315
Department of Geological Sciences
The University of North Carolina at Chapel Hill
phone: 575-418-8555
email: daniel.bowman at unc.edu
web:http://geosci.unc.edu/page/daniel-c-bowman
________________________________
From: Daniel Bowman
Sent: Monday, September 8, 2014 8:31 PM
To: Adam Simkowski
Subject: RE: [Rnomads-user] issues on retreveing specific location data in rNOMADS
Hi Adam,
The issue here is the North American Mesoscale (NAM) model. The package vignettes were written specifically to interface with the Global Forecast System (GFS) model. The GFS is discretized into 0.5 x 0.5 degree cells, thus there are 720 longitude values and 180 latitude values. That is the origin of the following lines in the vignette:
lons <- seq(0, 359.5, by = 0.5)
lats <- seq(-90, 90, by = 0.5)
So...we need to figure out how the NAM model is set up before we can figure out how to get the data you want.
When I run
GetDODSModelRunInfo(model.url, NAM.model.run)
I find:
"Longitude: -153.00000000000?E to -49.30000000000?E (1038 points, avg. res. 0.1?)"
[4] "Latitude: 12.00000000000?N to 61.90000000000?N (500 points, avg. res. 0.1?)"
It is important to make sure each point is in fact 0.1 degrees apart (some models have variable grid spacings)...so I have to download the *entire model* and check:
everything <- DODSGrab(model.url, NAM.model.run, "dswrfsfc", time, c(0, 1037), c(0, 499))
diff(everything$lat)
diff(everything$lon)
Well, looks like we are lucky and everything is in fact 0.1 degrees apart. So let's redefine our indices:
lat <- 36.424789 #lat at Murphy Solar
lon <- -77.062891 #lon at Murphy Solar
#Get nearest model nodes
lons <- seq(-153, -49.3, by = 0.1)
lats <- seq(12, 61.9, by = 0.1)
lon.diff <- abs(lon - lons)
lat.diff <- abs(lat - lats)
model.lon.ind <- which(lon.diff == min(lon.diff))
model.lat.ind <- which(lat.diff == min(lat.diff))
Okay, now let's try getting the data for that specific point.
time <- c(0,0) #Model status at initialization
lon.inds <- c(model.lon.ind - 2, model.lon.ind + 2)
lat.inds <- c(model.lat.ind - 2, model.lat.ind + 2)
solar.data <- DODSGrab(model.url, NAM.model.run, "dswrfsfc", time, lon.inds, lat.inds)# pull surface downward short wave flux [w/m^2] from the model
According to the coordinates in solar.data, we've captured the point we want. Anyway, the take home message is that each *model* is unique, and you have to investigate each one individually.
Hope this helps!
Danny
Daniel C. Bowman
Doctoral Candidate in Geophysics
Mitchell 315
Department of Geological Sciences
The University of North Carolina at Chapel Hill
phone: 575-418-8555
email: daniel.bowman at unc.edu
web:http://geosci.unc.edu/page/daniel-c-bowman
________________________________
From: rnomads-user-bounces at lists.r-forge.r-project.org on behalf of Adam Simkowski
Sent: Monday, September 8, 2014 3:31 PM
To: rnomads-user at lists.r-forge.r-project.org
Subject: [Rnomads-user] issues on retreveing specific location data in rNOMADS
Hi all,
I have been attempting to pull ?dswrfsfc? (incoming solar radiation) at a specific latitude and longitude from the historical NAM data set available through rNOMADS. I followed the example shown in various parts of the package notes where data is pulled for Chapel Hill, NC. I am attempting to pull data for a location not too far from Chapel Hill (Murfreesboro, NC). However, when I attempt to pull either solar radiation or 2 meter temperature data for a given hour, I get 24 rows of data with a longitude far away from my desired location and a latitude somewhat nearby. I was under the impression that I should only get one row of data closest to my desired location since I?m only querying for one specific hour. I am not completely sure I understand the code to query data closest to a desired location given a latitude and longitude... I have included this code in the attached items with my specific lat and lon ( file name: rNOMADS lat-lon code). Could someone please explain code here a little more in-depth than is shown in on the package vignette?
I have also attached my script that I wrote to retrieve point specific model data for Murfreesboro (Murphy solar) and an example of the 24 row data frame that it creates. The script was written as a function where the input is a specific number assigned to a url from the historical NAM list. An example input would be 1473 which is the url for NAM runs on September 1st, 2014. I am hoping to fix the code so that it only returns one row of data instead of 24.
I have also written a script that pulls more than one model at a time using a for loop, but this lat lon issue seems to be inhibiting me from creating a proper final output data frame with good data. Once I figure out the lat lon issue here, I will certainly share this code for all to use!
Thank you,
Adam Simkowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: