Skip to content

Commit

Permalink
version 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycbowman authored and cran-robot committed Mar 4, 2019
1 parent 4b6038e commit 10e1452
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 36 deletions.
13 changes: 6 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ Package: rNOMADS
Type: Package
Title: An R Interface to the NOAA Operational Model Archive and
Distribution System
Version: 2.4.0
Date: 2019-12-3
Version: 2.4.1
Date: 2019-3-2
Authors@R: c(person(given="Daniel C.",family="Bowman", role=c("aut", "cre"),
email="danny.c.bowman@gmail.com"))
Depends: R (>= 3.4.0), rvest (>= 0.3.2)
Imports: scrapeR (>= 0.1.6), stringr (>= 1.2.0), fields (>= 9.0),
GEOmap (>= 2.3-5), MBA, RCurl (>= 1.95-4.7), XML (>= 3.98.1.9),
xml2 (>= 1.1.1), uuid (>= 0.1-2)
Imports: stringr (>= 1.2.0), fields (>= 9.0), GEOmap (>= 2.3-5), MBA,
RCurl (>= 1.95-4.7), XML (>= 3.98.1.9), uuid (>= 0.1-2)
Description: An interface to the National Oceanic and Atmospheric Administration's Operational Model Archive and Distribution System (NOMADS, see <http://nomads.ncep.noaa.gov/> for more information) that allows R users to quickly and efficiently download global and regional weather model data for processing. rNOMADS currently supports a variety of models ranging from global weather data to an altitude of over 40 km, to high resolution regional weather models, to wave and sea ice models. It can also retrieve archived NOMADS models. rNOMADS can retrieve binary data in grib format as well as import ascii data directly into R by interfacing with the GrADS-DODS system.
License: GPL (>= 3)
Maintainer: Daniel C. Bowman <danny.c.bowman@gmail.com>
Expand All @@ -18,7 +17,7 @@ URL: <https://bovineaerospace.wordpress.com/category/r/ >,
<https://r-forge.r-project.org/projects/rnomads/ >,
<https://www.r-project.org >
NeedsCompilation: no
Packaged: 2019-01-04 05:45:07 UTC; dantayaga
Packaged: 2019-03-02 05:37:58 UTC; dantayaga
Author: Daniel C. Bowman [aut, cre]
Repository: CRAN
Date/Publication: 2019-01-04 12:50:03 UTC
Date/Publication: 2019-03-04 08:00:03 UTC
16 changes: 8 additions & 8 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
c84a8d1ad5509457e1c936a0700f0cae *DESCRIPTION
69283f19afa5c1146f5e410660e7f39b *DESCRIPTION
390e84088e5d6fef202002db75860464 *NAMESPACE
d6c8b95fea8537f78af8444b37e674c1 *NEWS
25d1b075adf63d775b2003a6b13f7f3c *R/GetArchiveGrib.R
e89307f8c0a73afc7e9f67e5e08c9c3c *R/GetDODS.R
8a29fb48bd1a036dcafedb75489dc19d *NEWS
a11f6e0f930740109ae9b34335796b21 *R/GetArchiveGrib.R
3d3616ae851730c99ca81b34c9add562 *R/GetDODS.R
56c60352d659f91659a3c2f0fce4671a *R/GetRealTimeGrib.R
04648b3e7a07182dd44d850e01f3c645 *R/Models.R
de13ba34ff7f328e9dc3097c982d1f50 *R/Models.R
08d02247d80a9e7f3368d7f3582f056c *R/RNomadsTools.R
7c474ab346a5149f4c40c020d625752d *R/ReadGrib.R
d9a48be054af6f67860d0a807bd23487 *R/onAttach.R
0f253778c7757b7016e434fec3a542aa *R/onAttach.R
e1094799c652a311619b92483183a5fc *inst/CITATION
81c30cc1ca803cde5a9e254641a31d46 *man/ArchiveGribGrab.Rd
a4ae1bccff1f268c029a9aec22fce458 *man/BuildProfile.Rd
2687f4e7fef1b34c66e3f921e9588e54 *man/CheckNOMADSArchive.Rd
ebd0ee4708d5a85a8645f8fcc80735e5 *man/CrawlModels.Rd
bb19e9e08bfc08e27a6163bd0dd3c5d2 *man/DODSGrab.Rd
44390881baa1d0ce506540797eba7e9d *man/GetClosestForecasts.Rd
953f540c591b10a874b375a08123ae95 *man/GetDODSDates.Rd
131601b6148940425cbc29b683d0a979 *man/GetDODSDates.Rd
144215941c318d0bb88a2e98c4dd7da4 *man/GetDODSModelRunInfo.Rd
44bb20ad1cfdaa35e3e296d4d2f01dcb *man/GetDODSModelRuns.Rd
24cf81c99f723afb6d6c3e7e48ce7bc7 *man/GribGrab.Rd
Expand All @@ -24,7 +24,7 @@ bb19e9e08bfc08e27a6163bd0dd3c5d2 *man/DODSGrab.Rd
43004dfb2d645efdba52442e8e94bea1 *man/MagnitudeAzimuth.Rd
8c88218e349bb746e3f1220bf23f6099 *man/ModelGrid.Rd
df43cf3706870565770577a17e4ec5a1 *man/NOMADSArchiveList.Rd
06901461bc9e81520775e11f45397d27 *man/NOMADSRealTimeList.Rd
1e667734aa55857940f563b6c1ac6a50 *man/NOMADSRealTimeList.Rd
6518b5982569da84448dbe13263fb7de *man/ParseModelPage.Rd
eadc8897225fe1915cb3a846e37fcc73 *man/PlotWindProfile.Rd
1d8571c81e1e843e50dcd7c96b14d581 *man/ReadGrib.Rd
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,7 @@ Big plans for 2-4.1 have been deferred; this is a release to fix a bug in wgrib
2-4.0
Fixed real time grib download issues related to NCEP switching to https.
DODS (openDAP-alt) remains nonfunctioning, but decided to release a new version ASAP to help those who depend on it to run websites, etv.

2-4.1
DODS functionality is restored (on the NOMADS side, not my doing).
This release fixes an issue with ArchiveGribGrab.
8 changes: 6 additions & 2 deletions R/GetArchiveGrib.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@ ArchiveGribGrab <- function(abbrev, model.date, model.run, preds, local.dir = NU
link.list <- unique(LinkExtractor(download.url))

#Check if the requested file is where we think it is
if(sum(grepl(paste0(".*", file.part, "$"), link.list)) < 1) {
if(!any(grepl(file.part, link.list))) {
warning(paste("The requested data file ending in", file.part, "does not appear to be in the archive.
Try opening", download.url, "in a web browser to verify that it's missing."))
next
}

#Set up URL to file
grb.urls <- paste0(download.url, link.list[grepl(paste0(".*", file.part, "$"), link.list)])
grb.urls <- stringr::str_replace(
stringr::str_extract(
paste0(download.url, link.list[grepl(file.part, link.list)]),
paste0("^.*", file.part, "><")),
"><", "")

#Download the file
if(length(grb.urls) > 1) {
Expand Down
5 changes: 2 additions & 3 deletions R/GetDODS.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#use the GrADS-DODS capability of NOMADS to get ascii data

GetDODSDates <- function(abbrev, archive = FALSE, request.sleep = 1, https = FALSE) {
GetDODSDates <- function(abbrev, archive = FALSE, request.sleep = 1) {
#Checks the GrADS data server to see what dates and model subsets are available for model specified by ABBREV.
#INPUTS
# ABBREV - Model abbreviation
# ARCHIVE - If you're looking in the model archives (TRUE) or the real time NOMADS system (FALSE)
# REQUEST.SLEEP - Sometimes hammering the NOMADS server with a zillion HTTP requests is not a good idea.
# REQUEST.SLEEP pauses X seconds between requests to prevent timeouts.
# HTTPS - Whether to use https (TRUE) or http (FALSE)
#OUTPUTS
# AVAILABLE.DATES - A list of model URLS and dates
# $ABBREV - Model abbreviation
Expand All @@ -17,7 +16,7 @@ GetDODSDates <- function(abbrev, archive = FALSE, request.sleep = 1, https = FAL
date.pattern <- "[1-2]\\d{3}[0-1]\\d{1}[0-3]\\d{1}$"

if(!archive) {
top.url <- unique(NOMADSRealTimeList("dods", abbrev, https = https)$url)
top.url <- unique(NOMADSRealTimeList("dods", abbrev)$url)
} else {
if(grepl("anl$", abbrev)) {
stop(paste("Archived analysis models are not stored by date.",
Expand Down
9 changes: 2 additions & 7 deletions R/Models.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Descriptions of real time and archived models
NOMADSRealTimeList <- function(url.type, abbrev = NULL, https = TRUE) {
NOMADSRealTimeList <- function(url.type, abbrev = NULL) {
#Returns a list of model abbreviations for real time models, a short description, and URL for each model offered by the NOMADS server
#If a specific model abbreviation is requested, the abbreviation is checked against the model list.
#If a match is found, information is returned about that model; otherwise an error occurs
Expand All @@ -8,7 +8,6 @@ NOMADSRealTimeList <- function(url.type, abbrev = NULL, https = TRUE) {
# URL.TYPE determines which URL to return: one for downloading GRIB files (grib) or one for downloading dods data via DODS (dods)
# ABBREV is the model abbreviation that rNOMADS uses to figure out which model you want.
# if NULL, returns information on all models
# HTTPS if TRUE, use https, if FALSE, use http
#OUTPUTS
# MODEL.LIST - a list of model metadata with elements
# $ABBREV - the abbrevation used to call the model in rNOMADS
Expand All @@ -19,11 +18,7 @@ NOMADSRealTimeList <- function(url.type, abbrev = NULL, https = TRUE) {
stop("URL type must be either \"grib\" or \"dods\"!")
}

if(https) {
prefix <- "https"
} else {
prefix <- "http"
}
prefix <- "https"


base.url <- paste0(prefix, "://nomads.ncep.noaa.gov/")
Expand Down
2 changes: 1 addition & 1 deletion R/onAttach.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.onAttach <- function(libname, pkgname) {
packageStartupMessage(paste0(c("\n****\nWelcome to rNOMADS 2.4.0 \"The spice must flow\"!\n",
packageStartupMessage(paste0(c("\n****\nWelcome to rNOMADS 2.4.0 \"Latinum-plated bucket\"!\n",
"Questions? Follow @rNOMADS_r on Twitter or send a message to rnomads-user@lists.r-forge.r-project.org\n",
"Using rNOMADS as a data source for a publication? Please cite it!\n",
"I'm an early career researcher and every citation matters.\n****\n")))
Expand Down
5 changes: 1 addition & 4 deletions man/GetDODSDates.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Find available model run dates for data on the GrADS - DODS system.
This function checks the GrADS data server to see what dates and model subsets are available for model specified by ABBREV
}
\usage{
GetDODSDates(abbrev, archive=FALSE, request.sleep=1, https = FALSE)
GetDODSDates(abbrev, archive=FALSE, request.sleep=1)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand All @@ -20,9 +20,6 @@ GetDODSDates(abbrev, archive=FALSE, request.sleep=1, https = FALSE)
\item{request.sleep}{
Seconds to pause between HTTP requests when scanning model pages - this prevents timeouts. Default \code{1}.
}
\item{https}{
Whether to use HTTP or HTTPS. Default FALSE (use HTTPS)
}
}
\details{
This function determines which dates are available for download for a particular model through the GrADS - DODS system.
Expand Down
5 changes: 1 addition & 4 deletions man/NOMADSRealTimeList.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Scans the NOMADS Real Time web site to generate a list of available model produc
Users can refer to this list to find out more information about the available models, and rNOMADS uses the abbreviations to determine which URLs to scan and download.
}
\usage{
NOMADSRealTimeList(url.type, abbrev = NULL, https = TRUE)
NOMADSRealTimeList(url.type, abbrev = NULL)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand All @@ -17,9 +17,6 @@ NOMADSRealTimeList(url.type, abbrev = NULL, https = TRUE)
\item{abbrev}{
Return information about the model that this abbreviation refers to.
Defaults to \code{NULL}, in which case information about all the models available through \code{rNOMADS}.}
\item{https}{
Whether to use http or https. Default TRUE, though DODS may not work.
If that's the case, use https=FALSE.}
}

\value{
Expand Down

0 comments on commit 10e1452

Please sign in to comment.