Skip to content

Commit

Permalink
cope with NRT oceancolor mapped files v0.15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondben committed Jul 26, 2024
1 parent 2c6e202 commit 6c94751
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bowerbird
Type: Package
Title: Keep a Collection of Sparkly Data Resources
Version: 0.15.2
Version: 0.15.3
Authors@R: c(person("Ben", "Raymond", email = "ben.raymond@aad.gov.au", role = c("aut", "cre")),
person("Michael", "Sumner", role = "aut"),
person("Miles", "McBain", email = "miles.mcbain@gmail.com", role = c("rev", "ctb")),
Expand Down
6 changes: 3 additions & 3 deletions R/oceandata.R
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ oceandata_url_mapper <- function(this_url,path_only=FALSE,sep=.Platform$file.sep
assert_that(is.string(sep))
if (grepl("\\.L3m[_\\.]",this_url)) {
## mapped file
url_parts <- str_match(this_url,"/([ASTCV]|AQUA_MODIS|SEASTAR_SEAWIFS_GAC|TERRA_MODIS|NIMBUS7_CZCS|SNPP_VIIRS|JPSS1_VIIRS)\\.?([[:digit:]_]+)\\.(L3m)[_\\.]([[:upper:][:digit:]]+)[_\\.](.*?)[_\\.](9|4)(km)?\\.(bz2|nc)")
url_parts <- str_match(this_url,"/([ASTCV]|AQUA_MODIS|SEASTAR_SEAWIFS_GAC|TERRA_MODIS|NIMBUS7_CZCS|SNPP_VIIRS|JPSS1_VIIRS)\\.?([[:digit:]_]+)\\.(L3m)[_\\.]([[:upper:][:digit:]]+)[_\\.](.*?)[_\\.](9|4)(km)?\\..*?(bz2|nc)")
## e.g. [1,] "https://oceandata.sci.gsfc.nasa.gov/ob/getfile/A2002359.L3m_DAY_CHL_chlor_a_9km"
## [,2] [,3] [,4] [,5] [,6] [,7]
## "A" "2002359" "L3m" "DAY" "CHL_chlor_a" "9"
url_parts <- as.data.frame(url_parts,stringsAsFactors=FALSE)
colnames(url_parts) <- c("full_url","platform","date","type","timeperiod","parm","spatial","spatial_unit")
url_parts <- as.data.frame(url_parts, stringsAsFactors = FALSE)
colnames(url_parts) <- c("full_url", "platform", "date", "type", "timeperiod", "parm", "spatial", "spatial_unit", "ext")
## map back to old sensor abbreviations, at least temporarily
url_parts$platform <- oceandata_platform_to_abbrev(url_parts$platform)
} else if (grepl("\\.L3b[_\\.]",this_url)) {
Expand Down

0 comments on commit 6c94751

Please sign in to comment.