Skip to content

Commit

Permalink
Update NOAA url, fixes #11 fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarperpinan committed Nov 19, 2018
1 parent 361dcb7 commit 59e0a0b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 24 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Package: meteoForecast
Type: Package
Title: Numerical Weather Predictions
Version: 0.52
Date: 2018-04-05
Version: 0.53
Authors@R: c(person("Oscar", "Perpinan Lamigueiro", email="oscar.perpinan@gmail.com", role=c('cre', 'aut')), person("Marcelo", "Pinho Almeida", email= "marcelopa@iee.usp.br", role='ctb'))
Description: Access to several Numerical Weather Prediction services both in raster format and as a time series for a location. Currently it works with GFS, MeteoGalicia, NAM, and RAP.
URL: http://github.com/oscarperpinan/meteoForecast
Expand Down
10 changes: 6 additions & 4 deletions R/composeURL.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ urlMG <- function(var, day, run, spatial, timeFrame, resolution, ...){
##################################################################
## Global Forecast
##################################################################
urlNOAA <- 'https://www.ncei.noaa.gov/thredds/ncss/grid'

urlGFS <- function(var, day, run, spatial, timeFrame, vertical, ...) {
Ym <- format(day, format='%Y%m')
mainURL <- 'https://nomads.ncdc.noaa.gov/thredds/ncss/grid/gfs-004/'
mainURL <- paste0(urlNOAA, '/gfs-004-files/')
run <- paste0(run, '00')
timeFrame <- sprintf('%03d', timeFrame)
URL0 <- paste0(mainURL, Ym, '/', ymd(day), '/',
Expand All @@ -118,11 +120,11 @@ urlNAM <- function(var, day, run, spatial, timeFrame, vertical, ...) {
Ym <- format(day, format='%Y%m')
## NAM stores the last year results under the category "Near Real-Time"
if (today - day < 365) {
mainURL <- 'https://nomads.ncdc.noaa.gov/thredds/ncss/grid/nam218/'
mainURL <- paste0(urlNOAA, '/nam218/')
servId <- 'nam_218'
} else {
## Previous results can be found under "Analysis only"
mainURL <- 'https://nomads.ncdc.noaa.gov/thredds/ncss/grid/namanl/'
mainURL <- paste0(urlNOAA, '/namanl/')
servId <- 'namanl_218'
}

Expand All @@ -147,7 +149,7 @@ urlNAM <- function(var, day, run, spatial, timeFrame, vertical, ...) {
##################################################################
urlRAP <- function(var, day, run, spatial, timeFrame, vertical, ...) {
Ym <- format(day, format='%Y%m')
mainURL <- 'https://nomads.ncdc.noaa.gov/thredds/ncss/grid/rap130/'
mainURL <- paste0(urlNOAA, '/rap130/')
run <- paste0(run, '00')
timeFrame <- sprintf('%03d', timeFrame)
URL0 <- paste0(mainURL, Ym, '/', ymd(day), '/',
Expand Down
7 changes: 4 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ grepVar('cloud', service = 'gfs')
#+end_src

#+begin_example
[1] "Cloud_water" "Cloud_mixing_ratio"
[1] "Cloud_water_entire_atmosphere_single_layer"
[2] "Cloud_mixing_ratio_isobaric"
#+end_example

However, you may be interested in the variables available in previous versions. It that is the case, choose a certain day to get this information:

#+begin_src R
grepVar('cloud', service = 'gfs', day = as.Date('2014-09-15'))
grepVar('cloud', service = 'meteogalicia', day = as.Date('2016-09-15'))
#+end_src

#+BEGIN_EXAMPLE
[1] "Total_cloud_cover" "Cloud_water" "Cloud_mixing_ratio"
[1] "cft" "cfm" "cfl" "cfh"
#+END_EXAMPLE

You can use the empty string to retrieve the full list of variables provided by the service.
Expand Down
2 changes: 1 addition & 1 deletion man/getPoint.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ These functions download data from the MeteoGalicia and NCEP (GFS, RAP, NAM) ser

## Vertical coordinates
tempK1000 <- getPoint(c(101,6),
vars = "Temperature",
vars = "Temperature_surface",
day = testDay,
service ="gfs", vertical = 1000)

Expand Down
14 changes: 7 additions & 7 deletions man/getRaster.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ checkDays(start, end, vars, remote = FALSE,
\references{
\url{http://www.meteogalicia.es/web/modelos/threddsIndex.action}

\url{http://nomads.ncdc.noaa.gov/thredds/catalog/gfs-004/catalog.html}
\url{https://www.ncei.noaa.gov/thredds/catalog/gfs-004-files/catalog.html}

\url{http://nomads.ncdc.noaa.gov/thredds/catalog/rap130/catalog.html}
\url{https://www.ncei.noaa.gov/thredds/catalog/rap130/catalog.html}

\url{http://nomads.ncdc.noaa.gov/thredds/catalog/nam218/catalog.html}
\url{https://www.ncei.noaa.gov/thredds/catalog/nam218/catalog.html}

}

Expand Down Expand Up @@ -117,19 +117,19 @@ hovmoller(wrf)

## Using box and frames specification
mfExtent('gfs')
cloudGFS <- getRaster('Total_cloud_cover',
cloudGFS <- getRaster('Temperature_surface',
day = testDay,
box = c(-10, 10, -10, 10),
service = 'gfs')

mfExtent('nam')
cloudNAM <- getRaster('Total_cloud_cover',
cloudNAM <- getRaster('Temperature_surface',
day = testDay,
box = c(-100, -80, 30, 50),
frames = 10,
service = 'nam')
mfExtent('rap')
cloudRAP <- getRaster('Total_cloud_cover',
cloudRAP <- getRaster('Temperature_surface',
day = testDay,
box = c(-100, -80, 30, 50),
frames = 10,
Expand All @@ -150,7 +150,7 @@ levelplot(wrfDays, layout = c(1, 1), par.settings = BTCTheme)
## Hövmoller graphic
hovmoller(wrfDays, par.settings = BTCTheme, contour = TRUE, cuts = 10)

NAMDays <- getRasterDays('Total_cloud_cover',
NAMDays <- getRasterDays('Temperature_surface',
start = testDay - 3,
end = testDay + 2,
box = c(-100, -80, 30, 50),
Expand Down
7 changes: 3 additions & 4 deletions man/meteo-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
\references{
\url{http://www.meteogalicia.es/web/modelos/threddsIndex.action}

\url{http://nomads.ncdc.noaa.gov/thredds/catalog/gfs-004/catalog.html}
\url{http://www.ncei.noaa.gov/thredds/catalog/gfs-004-files/catalog.html}
\url{http://www.ncei.noaa.gov/thredds/catalog/nam218/catalog.html}

\url{http://nomads.ncdc.noaa.gov/thredds/catalog/nam218/catalog.html}

\url{http://nomads.ncdc.noaa.gov/thredds/catalog/rap130/catalog.html}
\url{http://www.ncei.noaa.gov/thredds/catalog/rap130/catalog.html}

}

Expand Down
6 changes: 3 additions & 3 deletions man/vars.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ a variable with the argument \code{var} of \code{\link{getRaster}} and
\source{
MeteoGalicia: \url{http://www.meteogalicia.es/web/modelos/threddsIndex.action}

GFS: \url{http://nomads.ncdc.noaa.gov/thredds/catalog/gfs-004/catalog.html}
GFS: \url{https://www.ncei.noaa.gov/thredds/catalog/gfs-004-files/catalog.html}

NAM: \url{http://nomads.ncdc.noaa.gov/thredds/catalog/nam218/catalog.html}
NAM: \url{http://www.ncei.noaa.gov/thredds/catalog/nam218/catalog.html}

RAP: \url{http://nomads.ncdc.noaa.gov/thredds/catalog/rap130/catalog.html}
RAP: \url{http://www.ncei.noaa.gov/thredds/catalog/rap130/catalog.html}
}

\examples{
Expand Down

0 comments on commit 59e0a0b

Please sign in to comment.