| Title: | Tools for Synoptic Environmental Spatial Data |
|---|---|
| Description: | Tools for reading, plotting and manipulating spatial data, particularly from remote sensing and model output. |
| Authors: | Michael D. Sumner [aut, cre], Ben Raymond [ctb] |
| Maintainer: | Michael D. Sumner <michael.sumner@aad.gov.au> |
| License: | GPL-3 |
| Version: | 0.8.0 |
| Built: | 2026-10-13 08:10:57 UTC |
| Source: | https://github.com/AustralianAntarcticDivision/raadtools |
Tools in R for reading, plotting and manipulating spatial data, originally used at the Australian Antarctic Division (AAD).
read functions like readsst will read a data set by date-time vector, with a
set of shared arguments that work the same and documented against this dummy function.
Michael D. Sumner michael.sumner@aad.gov.au
Options
Maintainer: Michael D. Sumner michael.sumner@aad.gov.au
Useful links:
Raw list of all files.
allfiles(...)allfiles(...)
... |
reserved for future use, currently ignored |
data.frame with columns fullname with all file paths
A one-row-per-date catalogue of the Antarctic altimetry time series. Each
source file found by raadfiles::altimetry_antarctica_files() holds the
whole of its own series, one band per date, so this reads the time dimension
of each and returns a row per date with the band to read within its file.
altimetry_antarctica_daily_files()altimetry_antarctica_daily_files()
data.frame of date, fullname, band and root
read_altimetry_antarctica_daily()
AMPS files
amps_d1_icefiles(data.source = "", time.resolution = "12hourly", ...)amps_d1_icefiles(data.source = "", time.resolution = "12hourly", ...)
data.source |
ignored, reserved for future use |
time.resolution |
time resolution data to read, 6hourly only for now |
... |
reserved for future use, currently ignored |
GRIB format metadata from the Antarctic Mesoscale Prediction System (AMPS) files.
amps_metadata A data frame with 8 columns. The columns
represent
Band |
the band number |
GRIB_COMMENT |
the data measured |
GRIB_ELEMENT |
the data name |
GRIB_FORECAST_SECONDS |
forecast seconds |
GRIB_REF_TIME |
text reference time |
GRIB_SHORT_NAME |
short name |
GRIB_UNIT |
text unit |
GRIB_VALID_TIME |
text valid time |
A snapshot of one 2015-era d1 file, not a current index. The band layout has
changed three times since - see the notes at the top of R/amps.R - so
readamps_d1wind and readamps_d1ice find their
bands by name in the file being read rather than by position in this table.
print(amps_metadata) ## u_wind_at_900 <- read ## unfinishedprint(amps_metadata) ## u_wind_at_900 <- read ## unfinished
Voyage track data from the Aurora Australis
aurora A data frame with 3 columns. The columns
represent
LONGITUDE_DEGEAST |
Longitude values |
LATITUDE_DEGNORTH |
Latitude values |
DATE_TIME_UTC |
Date-time values (POSIXct) |
This is a sample of the "Aurora Australis Voyage 3 2012/13 Track and Underway Data".
## Not run: ## These data were obtained like this base <- "http://gcmd.gsfc.nasa.gov/KeywordSearch/RedirectAction.do?target" b1 <- "=F4t70bSf87FLsT1TNxR9TSPS74xbHAdheLQcH5Z5PMmgzJ9t%2Bi%2FEs1e8Fl61" b2 <- "MPhKjo9qxb2f9wyA%0D%0AoE1kjJ8AMcpFlMMRH7Z6umgNLsGMnWPeQdU7mZHMp%2" b3 <- "FtqMpahIrde%2F%2B9%2FZWAkIFrh2bhIiNfl4I9J%0D%0A5KBX9g5Wf7I9JdOgqY" b4 <- "bDdpj0iM1K%2BA%3D%3D" aurora2013 <- read.csv(paste(base, b1, b2, b3, b4, collapse = ""), stringsAsFactors = FALSE) aurora2013$DATE_TIME_UTC <- as.POSIXct(aurora2013$DATE_TIME_UTC, tz = "GMT") ## get a daily sample aurora <- aurora2013[,c("LONGITUDE_DEGEAST", "LATITUDE_DEGNORTH", "DATE_TIME_UTC")] aurora <- aurora[!duplicated(format( aurora$DATE_TIME_UTC, "%Y-%j")), ] aurora <- aurora[order(aurora$DATE_TIME_UTC), ] save(aurora, file = "aurora.rda") ## End(Not run)## Not run: ## These data were obtained like this base <- "http://gcmd.gsfc.nasa.gov/KeywordSearch/RedirectAction.do?target" b1 <- "=F4t70bSf87FLsT1TNxR9TSPS74xbHAdheLQcH5Z5PMmgzJ9t%2Bi%2FEs1e8Fl61" b2 <- "MPhKjo9qxb2f9wyA%0D%0AoE1kjJ8AMcpFlMMRH7Z6umgNLsGMnWPeQdU7mZHMp%2" b3 <- "FtqMpahIrde%2F%2B9%2FZWAkIFrh2bhIiNfl4I9J%0D%0A5KBX9g5Wf7I9JdOgqY" b4 <- "bDdpj0iM1K%2BA%3D%3D" aurora2013 <- read.csv(paste(base, b1, b2, b3, b4, collapse = ""), stringsAsFactors = FALSE) aurora2013$DATE_TIME_UTC <- as.POSIXct(aurora2013$DATE_TIME_UTC, tz = "GMT") ## get a daily sample aurora <- aurora2013[,c("LONGITUDE_DEGEAST", "LATITUDE_DEGNORTH", "DATE_TIME_UTC")] aurora <- aurora[!duplicated(format( aurora$DATE_TIME_UTC, "%Y-%j")), ] aurora <- aurora[order(aurora$DATE_TIME_UTC), ] save(aurora, file = "aurora.rda") ## End(Not run)
Title
ccmp_files(time.resolution = "6hourly", ...)ccmp_files(time.resolution = "6hourly", ...)
time.resolution |
time resolution: "daily" or "monthly" |
... |
passed to underlying reader |
data frame of file paths
ccmp_files()ccmp_files()
Ocean colour palette for chlorophyll-a.
chl.pal(x, palette = FALSE, alpha = 1)chl.pal(x, palette = FALSE, alpha = 1)
x |
a vector of data values or a single number |
palette |
logical, if |
alpha |
value in 0,1 to specify opacity |
Flexible control of the chlorophyll-a palette. If x is a
single number, the function returns that many colours evenly
spaced from the palette. If x is a vector of multiple
values the palette is queried for colours matching those values,
and these are returned. If x is missing and palette
is FALSE then a function is returned that will generate n
evenly spaced colours from the palette, as per
colorRampPalette.
colours, palette, or function, see Details
Derived from http://oceancolor.gsfc.nasa.gov/DOCS/palette_chl_etc.txt.
## Not run: chl <- readchla(xylim = c(100, 110, -50, -40)) ## just get a small number of evenly space colours plot(chl, col = chl.pal(10)) ## store the full palette and work with values and colours pal <- chl.pal() ## the standard full palette plot(chl, breaks = pal$breaks, col = pal$cols) ## a custom set of values with matching colours plot(chl, col = chl.pal(pal$breaks[seq(1, length(pal$breaks), length = 10)])) ## any number of colours stored as a function myfun <- chl.pal() plot(chl, col = myfun(18)) ## just n colours plot(chl, col = chl.pal(18)) ## End(Not run)## Not run: chl <- readchla(xylim = c(100, 110, -50, -40)) ## just get a small number of evenly space colours plot(chl, col = chl.pal(10)) ## store the full palette and work with values and colours pal <- chl.pal() ## the standard full palette plot(chl, breaks = pal$breaks, col = pal$cols) ## a custom set of values with matching colours plot(chl, col = chl.pal(pal$breaks[seq(1, length(pal$breaks), length = 10)])) ## any number of colours stored as a function myfun <- chl.pal() plot(chl, col = myfun(18)) ## just n colours plot(chl, col = chl.pal(18)) ## End(Not run)
Chlorophyll-a for the Southern Ocean
chlafiles( time.resolution = c("weekly", "monthly"), product = c("johnson", "oceancolor"), platform = c("MODISA", "SeaWiFS"), ... )chlafiles( time.resolution = c("weekly", "monthly"), product = c("johnson", "oceancolor"), platform = c("MODISA", "SeaWiFS"), ... )
time.resolution |
weekly (8day) or monthly |
product |
choice of chla product, see |
platform |
one of "MODISA" or "SeaWiFS" |
... |
reserved for future use, currently ignored |
This function generates a list of available chlorophyll-a files, including SeaWiFS and MODIS.
data.frame
Coastline data set as SpatialPolygons, currently not supported.
coastmap( map = c("world", "world2", "ant_coast", "ant_coast01", "ant_coast10", "Countries_hires", "world1", "world360", "cst00_polygon", "cst01_polygon", "cst10_polygon"), ... )coastmap( map = c("world", "world2", "ant_coast", "ant_coast01", "ant_coast10", "Countries_hires", "world1", "world360", "cst00_polygon", "cst01_polygon", "cst10_polygon"), ... )
map |
A named map source |
... |
arguments passed to worker functions |
This function reads and returns a coastline polygon data set, either from the source or serialized cache (.Rdata). Data source locations are controlled by options.
The following named data sets were available.
"world", "world2" - Atlantic and Pacific versions of maptools wrld_simpl ("world1", "world360" are aliases) "ant_coast", "ant_coast01", "ant_coast10" - AAD Antartic coast in full, "1 mill", and "10 mill" resolution ("cst00_polygon", "cst01_polygon", and "cst10_polygon" are aliases) "Countries_hires" - the "CIA" world map exported from the Manifold GIS data set
SpatialPolygonsDataFrame or SpatialPolygons (world1/2)
Each element can be looked up by name, see Examples
commonprojectionscommonprojections
This should be use only for a convenient reference to look up the projection strings commonly in use. There's no guarantee that this would be appropriate and you should seek cartographic expertise.
http://www.spatialreference.org
names(commonprojections) commonprojections[["polar"]]names(commonprojections) commonprojections[["polar"]]
These were an experiment provided by Stuart Corney of UTAS, consider deprecated.
cpolarfiles(...)cpolarfiles(...)
... |
ignored |
data frame of fullname, date
cpolarfiles()cpolarfiles()
Load file names and dates of AVISO current data
currentsfiles(time.resolution = c("daily", "weekly"), ...)currentsfiles(time.resolution = c("daily", "weekly"), ...)
time.resolution |
time resolution to load |
... |
reserved for future use, currently ignored |
A data.frame of file names and dates
data.frame of file names and dates
This function loads the latest cache of stored files for these products, which are available from http://webdav.data.aad.gov.au/data/environmental/derived/antarctic/
derivaadcfiles(products, ...)derivaadcfiles(products, ...)
products |
which derived product |
... |
reserved for future use, currently ignored |
data.frame of file and date
readderivaadc and derivaadcproducts
(prods <- derivaadcproducts()) readderivaadc(sample(prods, 1L))(prods <- derivaadcproducts()) readderivaadc(sample(prods, 1L))
readderivaadc
List all derived data products available through readderivaadc
derivaadcproducts()derivaadcproducts()
character vector of product names
readderivaadc and derivaadcfiles
This function loads the latest cache of stored files for ice products, currently only daily NSIDC southern hemisphere is available.
derivicefiles(product = "time_since_melt", ...)derivicefiles(product = "time_since_melt", ...)
product |
which derived product |
... |
reserved for future use, currently ignored |
data.frame of file and date
Calculate the shortest distance (metres) to a threshold sea ice contour. If in
doubt use distance_to_ice_edge, the definition of the edge is not straightforward, especially so for
the higher resolution products and near the coast.
distance_to_ice_edge computes a single "main" edge at continental scale
distance_to_ice computes all distances to any ice at threshold concentration
distance_to_ice_edge( date, threshold = 0.15, xylim = NULL, hemisphere = c("south", "north"), product = c("cdr", "nsidc"), min_length = NULL, returnfiles = FALSE, inputfiles = NULL, latest = TRUE, ... ) distance_to_ice( date, threshold = 0.15, xylim = NULL, hemisphere = c("south", "north"), product = c("cdr", "nsidc"), returnfiles = FALSE, inputfiles = NULL, latest = TRUE, ... )distance_to_ice_edge( date, threshold = 0.15, xylim = NULL, hemisphere = c("south", "north"), product = c("cdr", "nsidc"), min_length = NULL, returnfiles = FALSE, inputfiles = NULL, latest = TRUE, ... ) distance_to_ice( date, threshold = 0.15, xylim = NULL, hemisphere = c("south", "north"), product = c("cdr", "nsidc"), returnfiles = FALSE, inputfiles = NULL, latest = TRUE, ... )
date |
date or dates of data to read |
threshold |
the sea ice concentration threshold to contour at, as a fraction - 0.15 is the conventional 15 percent ice edge |
xylim |
spatial extents to crop, or a SpatRaster (or Raster*) template
to warp onto when |
hemisphere |
"north" or "south", default is "south" |
product |
"cdr" (default) for the Climate Data Record, or "nsidc" for NSIDC-0051 v2 |
min_length |
if set, keep every contour line longer than this many metres rather than only the single longest one |
returnfiles |
if TRUE, return file catalog |
inputfiles |
optional pre-filtered file catalog |
latest |
if TRUE and date missing, return latest available |
... |
passed to underlying reader |
The distance is always positive, use readice in the usual way to determine if a
location is inside or out of the ice field itself. (If inside means zero distance to ice
for you then set it explicitly based on the concentration a point is in.)
The contour is measured as lines, so the distance reported for a cell is its distance to the edge itself and not to the nearest contour vertex.
The sea ice product contoured is whatever readice reads, which is the
NOAA/NSIDC Climate Data Record by default; pass product = "nsidc" for
NSIDC-0051 v2. Both are 25km products on which a single min_length free
distance_to_ice_edge gives a clean continental edge. Finer products (AMSR2
at 3km, say) break the edge into many pieces and are better served by setting
min_length to drop the short ones - but they are not available through
readice, so contour them directly with terra::as.contour.
Future work may generalize this to other data sources.
SpatRaster of distances (metres) to this date's sea ice edge
beware that any queried location outside of this layer's range will be undetermined, and the external boundary of this layer is not constant with respect to the pole, and that in general a location may be closer to ice in the opposite hemisphere.
The argument hemisphere may be north or south (default is south), but this will only work if your locations
are on the actual map, so it's not possible to request the distance to ice in both poles for any point.
## Not run: terra::plot(distance_to_ice(latest = TRUE)) terra::plot(distance_to_ice_edge(latest = TRUE)) ## every piece of the edge longer than 500km, rather than just the longest terra::plot(distance_to_ice_edge(min_length = 5e5)) extract(distance_to_ice, aurora[17:25, ]) extract(distance_to_ice, aurora[17:25, ], hemisphere = "south") # library(trip) # extract(distance_to_ice_edge, walrus818[seq(50, 400, by = 20), ], hemisphere = "north") ## End(Not run)## Not run: terra::plot(distance_to_ice(latest = TRUE)) terra::plot(distance_to_ice_edge(latest = TRUE)) ## every piece of the edge longer than 500km, rather than just the longest terra::plot(distance_to_ice_edge(min_length = 5e5)) extract(distance_to_ice, aurora[17:25, ]) extract(distance_to_ice, aurora[17:25, ], hemisphere = "south") # library(trip) # extract(distance_to_ice_edge, walrus818[seq(50, 400, by = 20), ], hemisphere = "north") ## End(Not run)
Extract values from a raadtools reader at points that each carry their own
date-time. x is a read function such as readsst(), y a data.frame of
longitude, latitude and date-time in that column order.
## S4 method for signature 'function,data.frame' extract(x, y, ctstime = FALSE, when = "previous", ...)## S4 method for signature 'function,data.frame' extract(x, y, ctstime = FALSE, when = "previous", ...)
x |
a raadtools read function |
y |
a data.frame of longitude, latitude, date-time |
ctstime |
interpolate between the two slices bracketing each point
( |
when |
which slice a point takes its value from when |
... |
passed to |
Only the time slices the points actually need are read, and each is read
once. The work is done by xyt::extract_xyt(); this is the raadtools front
door onto it, so that extract(readsst, xyt) goes on meaning what it has
always meant.
xyt takes further arguments that are passed through here: method for the
spatial interpolation, fact to aggregate each slice before reading,
tolerance to return NA for points that fall too far from any slice in
time, and map to spread the reads over mirai daemons. See
xyt::extract_xyt().
a numeric vector, one value per row of y
when = "previous" is the default here rather than xyt's own
"nearest", because that is what the old findInterval() implementation
did and it is what existing results were computed with. The documentation
always said "nearest in time", so the two have disagreed for years.
Changing the default should be a deliberate decision, not a side effect of
this move.
a <- structure(list(x = c(174, 168, 156, 111, 99, 64, 52, 46, -4, -15, -30, -38, -47, -62, -87, -127, -145, -160, -161), y = c(-72, -39, -50, -58, -35, -38, -48, -60, -48, -35, -37, -51, -68, -72, -69, -54, -40, -49, -54)), .Names = c("x", "y"), row.names = c(NA, -19L), class = "data.frame") a$time <- structure(c(5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5489, 5529, 5529, 5529, 5579, 5579, 5579, 5579), class = "Date") extract(readsst, a) extract(readsst, a, method = "bilinear") a$time <- sort(as.Date("2005-01-01") + sample(c(0, 0, 0, 8, 20, 50), nrow(a), replace = TRUE)) extract(readsst, a)a <- structure(list(x = c(174, 168, 156, 111, 99, 64, 52, 46, -4, -15, -30, -38, -47, -62, -87, -127, -145, -160, -161), y = c(-72, -39, -50, -58, -35, -38, -48, -60, -48, -35, -37, -51, -68, -72, -69, -54, -40, -49, -54)), .Names = c("x", "y"), row.names = c(NA, -19L), class = "data.frame") a$time <- structure(c(5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5479, 5489, 5529, 5529, 5529, 5579, 5579, 5579, 5579), class = "Date") extract(readsst, a) extract(readsst, a, method = "bilinear") a$time <- sort(as.Date("2005-01-01") + sample(c(0, 0, 0, 8, 20, 50), nrow(a), replace = TRUE)) extract(readsst, a)
Provided by Alex Fraser
fasticefiles(...)fasticefiles(...)
... |
ignored |
This function wraps a raadfiles function fasticefiles, but expands the file list out to individual bands.
data.frame of fullname, date and band
fraser_fasticefiles()fraser_fasticefiles()
Load spatial map of fronts data.
frontsmap(map = c("park", "orsi"))frontsmap(map = c("park", "orsi"))
map |
name of map to load |
Currently ORSI or PARK is the only supported layers.
"park" = Southern Ocean fronts as determined by Park and Durand, doi: 10.17882/59800
"orsi" - the ORSI fronts derived from the files provided by the WOCE Atlas, see References
SpatialLinesDataFrame
http://woceatlas.tamu.edu/Sites/html/atlas/SOA_DATABASE_DOWNLOAD.html
Data frame of file names and dates.
ghrsstfiles()ghrsstfiles()
data.frame
This function loads the latest cache of stored files for ice products.
icefiles( time.resolution = "daily", product = c("cdr", "nsidc"), hemisphere = c("south", "north"), ... )icefiles( time.resolution = "daily", product = c("cdr", "nsidc"), hemisphere = c("south", "north"), ... )
time.resolution |
daily or monthly files? |
product |
choice of sea ice product, see |
hemisphere |
north or south |
... |
reserved for future use, currently ignored |
The 'fullname' is the path to the source file.
product = "cdr" (the default) is the NOAA/NSIDC Climate Data Record,
G02202 V6. product = "nsidc" is NSIDC-0051 v2, which is what
icefiles used to return and what read_nsidc_ice_daily
still reads.
data.frame of file and date
## Not run: icf <- icefiles() icf[nrow(icf), ] ## End(Not run)## Not run: icf <- icefiles() icf[nrow(icf), ] ## End(Not run)
Read map images.
imagemap(map = c("ibcso_background_hq"), fact = 1L)imagemap(map = c("ibcso_background_hq"), fact = 1L)
map |
name of the map to load |
fact |
resize factor, see |
The ancient lost art of cartography.
ibcso_background: The IBCSO RGB-map rasterlayer in high resolution
SpatRaster, with R G B bands
http://www.ibcso.org/data.html
Voyage track data from the Nuyina
aurora A data frame with 9 columns. The columns represent
longitude latitude date_time_utc air_pressure port_longwave_irradiance port_air_temperature precipitation_rate sea_water_salinity sea_water_temperature
This is a sample of the Nuyina underway in 2023.
see data-raw for extraction
range(nuyina$date_time_utc)range(nuyina$date_time_utc)
This function loads the latest cache of stored files for NASA ocean colour products.
ocfiles( time.resolution = c("daily", "weekly", "monthly", "weekly32"), product = c("MODISA", "SeaWiFS", "VIIRS"), varname = c("CHL", "RRS", "POC", "KD490", "NPP_PAR", "SNPP_CHL", "SNPP_RRS"), type = c("L3m", "L3b"), bz2.rm = TRUE, ext = c("nc", "main"), ... )ocfiles( time.resolution = c("daily", "weekly", "monthly", "weekly32"), product = c("MODISA", "SeaWiFS", "VIIRS"), varname = c("CHL", "RRS", "POC", "KD490", "NPP_PAR", "SNPP_CHL", "SNPP_RRS"), type = c("L3m", "L3b"), bz2.rm = TRUE, ext = c("nc", "main"), ... )
time.resolution |
daily or monthly files? |
product |
choice of ocean colour sensor |
varname |
which variable (or set of variables) |
type |
which level of data |
bz2.rm |
ignore files that are compressed |
ext |
which extension, e.g. "nc" or "main" |
... |
reserved for future use, currently ignored |
data.frame of file and date
Create a grid of query values for of longitude, latitude, and date.
query_grid(lon, lat, date)query_grid(lon, lat, date)
lon |
vector of longitudes in the grid |
lat |
vector of latitudes in the grid |
date |
vector of dates in the grid |
This be used as the second argument to extract() for general
'point-in-time' value extraction.
The ouput is a data frame of the grid expanded, a row for every combination of longitude, latitude, date - so can be quite large (!) so be careful with very fine resolution or long series.
lon <- c(100, 110, 120) lat <-seq(-60, -40, by = 5) dts <- seq(as.Date("2002-03-03"), by = "5 days", length.out = 10) qd <- query_grid(lon = lon, lat = lat, date = dts) ## use bilinear to ensure we get an interpolate value in the grid qd$sst <- extract(readsst, qd, method = "bilinear") ## ssha qd$ssha <- extract(readssh, qd, ssha = TRUE, method = "bilinear") qd$wind_mag <- extract(readwind, qd, magonly = TRUE, method = "bilinear")lon <- c(100, 110, 120) lat <-seq(-60, -40, by = 5) dts <- seq(as.Date("2002-03-03"), by = "5 days", length.out = 10) qd <- query_grid(lon = lon, lat = lat, date = dts) ## use bilinear to ensure we get an interpolate value in the grid qd$sst <- extract(readsst, qd, method = "bilinear") ## ssha qd$ssha <- extract(readssh, qd, ssha = TRUE, method = "bilinear") qd$wind_mag <- extract(readwind, qd, magonly = TRUE, method = "bilinear")
Dummy function
raadtools( date, time.resolution = "daily", lon180 = TRUE, setNA = TRUE, latest = FALSE, returnfiles = FALSE, ... )raadtools( date, time.resolution = "daily", lon180 = TRUE, setNA = TRUE, latest = FALSE, returnfiles = FALSE, ... )
date |
date or dates of data to read, |
time.resolution |
time resoution data to read, daily or monthly |
lon180 |
defaults to TRUE, to "rotate" Pacific view [0, 360] data to Atlantic view [-180, 180] |
setNA |
mask out land values (only applies to monthly time.resolution) |
latest |
if TRUE (and date not supplied) return the latest time available |
returnfiles |
ignore options and just return the file names and dates |
... |
passed to |
xylim |
spatial extents to crop from source data, can be anything accepted by |
inputfiles |
input the files data base to speed up initialization |
This function loads the latest cache of stored files for rapid response products.
rapid_responsefiles(product = c("aqua", "terra"), ...)rapid_responsefiles(product = c("aqua", "terra"), ...)
... |
reserved for future use, currently ignored |
We acknowledge the use of Rapid Response imagery from the Land Atmosphere Near-real time Capability for EOS (LANCE) system operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.
data.frame of file and date
## Not run: rf <- rapid_responsefiles() range(rf$date) ## End(Not run)## Not run: rf <- rapid_responsefiles() range(rf$date) ## End(Not run)
Read one or more dates of gridded Antarctic sea level anomaly, catalogued by
altimetry_antarctica_daily_files().
read_altimetry_antarctica_daily( date, xylim = NULL, varname = c("sla", "std_sla", "number_sla"), latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_altimetry_antarctica_daily( date, xylim = NULL, varname = c("sla", "std_sla", "number_sla"), latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read, |
xylim |
spatial extents to crop from source data, can be anything accepted by |
varname |
variable to read: |
latest |
if TRUE (and date not supplied) return the latest time available |
returnfiles |
ignore options and just return the file names and dates |
... |
passed to |
inputfiles |
input the files data base to speed up initialization |
The source has no georeference of its own, so the extent and CRS are
asserted here: a square of 8750000 m about the pole, in Lambert azimuthal
equal area on +lat_0=-90 +lon_0=-90.
SpatRaster with one layer per date, or a data.frame of files if
returnfiles = TRUE
altimetry_antarctica_daily_files()
## Not run: read_altimetry_antarctica_daily(latest = TRUE) ## End(Not run)## Not run: read_altimetry_antarctica_daily(latest = TRUE) ## End(Not run)
Read Antarctic sea ice concentration from AMSR2 sensor at 3.125km resolution.
read_amsr_ice_3k_daily( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_amsr2_3k_ice( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_amsr_ice_3k_daily( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_amsr2_3k_ice( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop (in polar stereographic coordinates), or NULL. |
setNA |
logical, mask flag values (above 1) as NA? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Data are in Antarctic polar stereographic projection. This is the highest resolution passive microwave sea ice product, available from 2012 onwards. Concentration is returned as a fraction (0-1).
SpatRaster with time dimension set.
read_amsr_ice_daily for longer time series at 6km
Read Antarctic sea ice concentration from combined AMSR-E (2002-2011) and AMSR2 (2012+) sensors at 6.25km resolution.
read_amsr_ice_daily( date, xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_amsr_ice( date, xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_amsr_ice_daily( date, xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_amsr_ice( date, xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop (in polar stereographic coordinates), or NULL. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Data are in Antarctic polar stereographic projection. Both sensor eras are combined into a continuous time series. Concentration is returned as a fraction (0-1); the files that store percentages are scaled down to match.
SpatRaster with time dimension set.
read_amsr_ice_3k_daily for higher resolution AMSR2 data
Using the TIF files (these are 2012 onwards)
read_amsr2_ice( date, xylim = NULL, latest = TRUE, ..., setNA = TRUE, returnfiles = FALSE, inputfiles = NULL )read_amsr2_ice( date, xylim = NULL, latest = TRUE, ..., setNA = TRUE, returnfiles = FALSE, inputfiles = NULL )
date |
date or dates of data to read |
xylim |
spatial extents to crop, or a SpatRaster (or Raster*) template
to warp onto when |
latest |
if TRUE and date missing, return latest available |
... |
passed to underlying reader |
setNA |
mask special values as NA |
returnfiles |
if TRUE, return file catalog |
inputfiles |
optional pre-filtered file catalog |
This function relies on the file-listing of raadfiles::amsr2_daily_files().
Concentration is returned as a fraction (0-1).
SpatRaster
raadfiles::amsr2_daily_files
Using the TIF files (these are 2012 onwards)
read_amsre_ice( date, xylim = NULL, latest = TRUE, ..., returnfiles = FALSE, inputfiles = NULL )read_amsre_ice( date, xylim = NULL, latest = TRUE, ..., returnfiles = FALSE, inputfiles = NULL )
date |
date or dates of data to read |
xylim |
spatial extents to crop, or a SpatRaster (or Raster*) template
to warp onto when |
latest |
if TRUE and date missing, return latest available |
... |
passed to underlying reader |
returnfiles |
if TRUE, return file catalog |
inputfiles |
optional pre-filtered file catalog |
This function relies on the file-listing of raadfiles::amsre_daily_files().
Concentration is returned as a fraction (0-1).
SpatRaster
raadfiles::amsre_daily_files read_amsr2_ice
read_ccmp picks a sensible default and returns a terra
SpatRaster. For the historical defaults pinned explicitly, see
read_ccmp_wind_6hourly.
read_ccmp( date, time.resolution = c("6hourly"), xylim = NULL, lon180 = FALSE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, nobsonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_ccmp( date, time.resolution = c("6hourly"), xylim = NULL, lon180 = FALSE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, nobsonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
time resolution, currently only "6hourly" |
xylim |
spatial extents to crop |
lon180 |
if TRUE, use Atlantic-centered longitude (default FALSE) |
magonly |
return wind speed only |
dironly |
return wind direction only |
uonly |
return U component only |
vonly |
return V component only |
nobsonly |
return number of observations only |
latest |
if TRUE and date missing, return latest |
returnfiles |
if TRUE, return file catalog |
... |
passed to underlying reader |
inputfiles |
optional pre-filtered file catalog |
SpatRaster, or tibble if returnfiles = TRUE
read_ccmp_wind_6hourly for modern terra-based reader
Read wind velocity from RSS Cross-Calibrated Multi-Platform (CCMP) products.
read_ccmp_wind_6hourly( date, time.resolution = "6hourly", xylim = NULL, lon180 = FALSE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, nobsonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_ccmp_wind_6hourly( date, time.resolution = "6hourly", xylim = NULL, lon180 = FALSE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, nobsonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
time.resolution |
time resolution, currently only "6hourly" supported. |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default FALSE (Pacific-centered). |
magonly |
logical, return wind speed only? |
dironly |
logical, return wind direction only? |
uonly |
logical, return U (eastward) component only? |
vonly |
logical, return V (northward) component only? |
nobsonly |
logical, return number of observations only? |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog (from |
CCMP provides RSS VAM 6-hour analyses starting from NCEP GFS wind analyses. Data contain U (eastward) and V (northward) wind components as subdatasets in the same file. By default both components are returned as a 2-layer SpatRaster. Use the component arguments to return derived quantities:
magonly = TRUE: wind speed (magnitude), sqrt(U^2 + V^2)
dironly = TRUE: wind direction (degrees, meteorological: N=0, E=90, S=180, W=270)
uonly = TRUE: U component only
vonly = TRUE: V component only
nobsonly = TRUE: number of observations only
Only one of these flags may be TRUE. When reading multiple dates with the default (both U and V), only one timestep can be read at a time.
Data are 6-hourly on a global 0.25 degree grid.
SpatRaster. If default (no component flag), 2 layers named "U", "V".
With a component flag, single layer per date. Time dimension is set.
read_ccmp for legacy interface, ccmp_files
for file catalog
## Not run: # Latest wind (U and V) uv <- read_ccmp_wind_6hourly() # Wind speed - can read multiple dates speed <- read_ccmp_wind_6hourly(c("2023-01-15", "2023-01-15 06:00"), magonly = TRUE) # Number of observations nobs <- read_ccmp_wind_6hourly("2023-01-15", nobsonly = TRUE) ## End(Not run)## Not run: # Latest wind (U and V) uv <- read_ccmp_wind_6hourly() # Wind speed - can read multiple dates speed <- read_ccmp_wind_6hourly(c("2023-01-15", "2023-01-15 06:00"), magonly = TRUE) # Number of observations nobs <- read_ccmp_wind_6hourly("2023-01-15", nobsonly = TRUE) ## End(Not run)
Read Antarctic sea ice concentration from CERSAT SSM/I at 12.5km resolution.
read_cersat_ice_daily( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_cersat_ice( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cersat_ice_daily( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_cersat_ice( date, xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop (in polar stereographic coordinates), or NULL. |
setNA |
logical, mask flag values (above 1) as NA? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Data are in Antarctic polar stereographic projection. This is the longest passive microwave sea ice record, available from 1991 onwards. Concentration is returned as a fraction (0-1).
SpatRaster with time dimension set.
read_amsr_ice_daily for AMSR data
read_chla_daily picks a sensible default and returns a terra
SpatRaster. For the historical defaults pinned explicitly, see
read_oc_chl_daily.
read_chla_daily( date, time.resolution = "daily", xylim = NULL, lon180 = TRUE, varname = "chlor_a", setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_chla_weekly( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_chla_monthly( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_par( date, time.resolution = "8D", xylim = NULL, lon180 = FALSE, nobsonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_chla_daily( date, time.resolution = "daily", xylim = NULL, lon180 = TRUE, varname = "chlor_a", setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_chla_weekly( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_chla_monthly( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_par( date, time.resolution = "8D", xylim = NULL, lon180 = FALSE, nobsonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
time.resolution |
ignored, use specific functions for different resolutions |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
varname |
subdataset to read, default "chlor_a". |
setNA |
ignored (for backward compatibility) |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog (from |
SpatRaster
Read absolute dynamic topography (ADT) from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_adt_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_adt_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_adt_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_adt_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
readssh for legacy interface
Read geostrophic current direction derived from ugos and vgos components of CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_current_direction_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_current_direction_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Direction is computed using oceanographic convention: direction the current is flowing TO, in degrees where N=0, E=90, S=180, W=270.
SpatRaster with time dimension set. Values in degrees (0-360).
readcurr for legacy interface
Read geostrophic current speed (magnitude) derived from ugos and vgos components of CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_current_speed_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_current_speed_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Speed is computed as sqrt(ugos^2 + vgos^2).
SpatRaster with time dimension set. Values in m/s.
readcurr for legacy interface
Read formal mapping error from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_err_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_err_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_err_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_err_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
Read sea level anomaly (SLA) from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_sla_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_sla_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_sla_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_sla_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
readssh for legacy interface
Read eastward geostrophic current velocity (ugos) from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_ugos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_ugos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_ugos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_ugos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
readcurr for legacy interface with U/V decomposition options
Read eastward geostrophic current anomaly (ugosa) from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_ugosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_ugosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_ugosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_ugosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
Read northward geostrophic current velocity (vgos) from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_vgos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_vgos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_vgos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_vgos_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
readcurr for legacy interface with U/V decomposition options
Read northward geostrophic current anomaly (vgosa) from CMEMS SEALEVEL_GLO_PHY_L4 product.
read_cmems_vgosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_vgosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_cmems_vgosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_vgosa_daily( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension set.
Read geostrophic current velocity from Copernicus/AVISO altimetry products.
read_copernicus_current_daily( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_aviso_current_daily( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_copernicus_current_daily( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_aviso_current_daily( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, ensure Atlantic-centered longitude? Default TRUE. |
magonly |
logical, return current speed only? |
dironly |
logical, return current direction only? |
uonly |
logical, return U (eastward) component only? |
vonly |
logical, return V (northward) component only? |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Data contain U (eastward) and V (northward) velocity components. By default both components are returned as a 2-layer SpatRaster. Use the component arguments to return derived quantities instead:
magonly = TRUE: current speed (magnitude), sqrt(U^2 + V^2)
dironly = TRUE: current direction (degrees, oceanographic convention)
uonly = TRUE: U component only
vonly = TRUE: V component only
Only one of these flags may be TRUE. When reading multiple dates with the default (both U and V), only one date can be read at a time - use a component flag to read time series.
Data are on a global 0.25 degree grid. Source orientation varies by file; use
lon180 = TRUE (default) to ensure Atlantic-centered output (-180 to 180).
SpatRaster. If default (no component flag), 2 layers named "U", "V".
With a component flag, single layer per date. Time dimension is set.
readcurr for legacy interface
## Not run: # Latest currents (U and V) uv <- read_copernicus_current_daily() # Current speed only - can read multiple dates speed <- read_copernicus_current_daily(c("2023-01-15", "2023-06-15"), magonly = TRUE) # Direction dir <- read_copernicus_current_daily("2023-01-15", dironly = TRUE) ## End(Not run)## Not run: # Latest currents (U and V) uv <- read_copernicus_current_daily() # Current speed only - can read multiple dates speed <- read_copernicus_current_daily(c("2023-01-15", "2023-06-15"), magonly = TRUE) # Direction dir <- read_copernicus_current_daily("2023-01-15", dironly = TRUE) ## End(Not run)
Global 2.5 Minute Geoid Undulations, a big raster from multiple files. We just create a temporary virtual raster from the source files, and return as a SpatRaster.
read_geoid(xylim = NULL, force = FALSE)read_geoid(xylim = NULL, force = FALSE)
xylim |
an extent, in longlat, or an object that provides one |
force |
if TRUE ignore cached virtual saved file, and recompute (try this if it otherwise fails) |
Each file is an ESRI GRID raster data set of 2.5-minute geoid undulation values covering a 45 x 45 degree area. Each raster file has a 2.5-minute cell size and is a subset of the global 2.5 x 2.5-minute grid of pre-computed geoid undulation point values found on the EGM2008-WGS 84 Version web page. This ESRI GRID format represents a continuous surface of geoid undulation values where each 2.5-minute raster cell derives its value from the original pre-computed geoid undulation point value located at the SW corner of each cell.
SpatRaster, longitude latitue grid of geoid level
## Not run: geoid <- read_geoid() ## End(Not run)## Not run: geoid <- read_geoid() ## End(Not run)
Average Lead-Frequency for the Arctic for winter months November-April 2002/03-2018/19 based on daily lead composites as derived from MOD/MYD-29 IST 5 min granules
read_leads_clim_south(xylim = NULL) read_leads_clim_north(xylim = NULL) read_leads_clim(hemisphere = c("south", "north"), xylim = NULL, ...)read_leads_clim_south(xylim = NULL) read_leads_clim_north(xylim = NULL) read_leads_clim(hemisphere = c("south", "north"), xylim = NULL, ...)
F. Reiser, S. Willmes, G. Heinemann (2020), A new algorithm for daily sea ice lead identification in the Arctic and Antarctic winter from thermal-infrared satellite imagery, Data subm.
read_leads_clim() read_leads_clim_north(xylim = terra::ext(c(-1, 1, -1, 1) * 50000)) south <- read_leads_clim_south() ## hone in on Mawson pt <- reproj::reproj_xy(cbind(62 + 52/60, -(67 + 36/60)), terra::crs(south), source = "+proj=longlat") lead <- read_leads_clim_south(xylim = terra::ext(pt[1] + c(-1, 1) * 250000, pt[2] + c(-1, 1) * 250000)) plot(lead, col = grey.colors(100)) abline(v = pt[1], h = pt[2])read_leads_clim() read_leads_clim_north(xylim = terra::ext(c(-1, 1, -1, 1) * 50000)) south <- read_leads_clim_south() ## hone in on Mawson pt <- reproj::reproj_xy(cbind(62 + 52/60, -(67 + 36/60)), terra::crs(south), source = "+proj=longlat") lead <- read_leads_clim_south(xylim = terra::ext(pt[1] + c(-1, 1) * 250000, pt[2] + c(-1, 1) * 250000)) plot(lead, col = grey.colors(100)) abline(v = pt[1], h = pt[2])
Read the Sallee et al. (2013) Southern Ocean Mixed Layer Depth climatology.
read_mld_climatology(date, xylim = NULL, returnfiles = FALSE, ...) readmld(date, xylim = NULL, returnfiles = FALSE, ...)read_mld_climatology(date, xylim = NULL, returnfiles = FALSE, ...) readmld(date, xylim = NULL, returnfiles = FALSE, ...)
date |
date(s) to select month from. Default returns all 12 months. |
xylim |
extent to crop, anything acceptable to |
returnfiles |
if TRUE, return file info instead of data. |
... |
currently ignored. |
This is a monthly climatology (12 layers, one per month) covering the Southern Ocean south of 30S. Data represent typical mixed layer depth for each month, not actual dates.
When a date is provided, the corresponding month is extracted. Multiple dates will return multiple layers (one per unique month).
SpatRaster with one layer per month requested.
Sallee, J.-B., et al. (2013). Assessment of Southern Ocean mixed-layer depths in CMIP5 models: Historical bias and forcing response. Journal of Geophysical Research: Oceans, 118.
## Not run: # All 12 months mld <- read_mld_climatology() # Just January mld_jan <- read_mld_climatology("2020-01-15") # Summer months mld_summer <- read_mld_climatology(c("2020-12-01", "2020-01-01", "2020-02-01")) ## End(Not run)## Not run: # All 12 months mld <- read_mld_climatology() # Just January mld_jan <- read_mld_climatology("2020-01-15") # Summer months mld_summer <- read_mld_climatology(c("2020-12-01", "2020-01-01", "2020-02-01")) ## End(Not run)
Read wind velocity from NCEP2 reanalysis products.
read_ncep2_wind_6hourly( date, time.resolution = "6hourly", xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_ncep2_wind_6hourly( date, time.resolution = "6hourly", xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
time.resolution |
time resolution, currently only "6hourly" supported. |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, ensure Atlantic-centered longitude? Default TRUE. |
magonly |
logical, return wind speed only? |
dironly |
logical, return wind direction only? |
uonly |
logical, return U (eastward) component only? |
vonly |
logical, return V (northward) component only? |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog (from |
Data contain U (eastward) and V (northward) wind components stored in separate files. By default both components are returned as a 2-layer SpatRaster. Use the component arguments to return derived quantities:
magonly = TRUE: wind speed (magnitude), sqrt(U^2 + V^2)
dironly = TRUE: wind direction (degrees, meteorological: N=0, E=90, S=180, W=270)
uonly = TRUE: U component only
vonly = TRUE: V component only
Only one of these flags may be TRUE. When reading multiple dates with the default (both U and V), only one timestep can be read at a time.
Data are 6-hourly on a global 2.5 degree grid (144x73 cells).
SpatRaster. If default (no component flag), 2 layers named "U", "V".
With a component flag, single layer per date. Time dimension is set.
readwind for legacy interface, windfiles
for file catalog
## Not run: # Latest wind (U and V) uv <- read_ncep2_wind_6hourly() # Wind speed - can read multiple dates speed <- read_ncep2_wind_6hourly(c("2023-01-15", "2023-01-15 06:00"), magonly = TRUE) # Direction dir <- read_ncep2_wind_6hourly("2023-01-15", dironly = TRUE) ## End(Not run)## Not run: # Latest wind (U and V) uv <- read_ncep2_wind_6hourly() # Wind speed - can read multiple dates speed <- read_ncep2_wind_6hourly(c("2023-01-15", "2023-01-15 06:00"), magonly = TRUE) # Direction dir <- read_ncep2_wind_6hourly("2023-01-15", dironly = TRUE) ## End(Not run)
Read the NOAA/NSIDC Climate Data Record of passive microwave sea ice concentration (G02202 V6, 25km) for a single hemisphere.
read_nsidc_cdr_daily( date, hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_nsidc_cdr_daily( date, hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
hemisphere |
"south" (default) or "north". |
xylim |
extent to crop (in native projection coordinates), or NULL. |
setNA |
logical, mask special values (land, coast, missing) to NA? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
The CDR is what readice and icefiles reach for
by default. read_nsidc_ice_daily reads NSIDC-0051 v2 instead,
which is the historical default.
A CDR file holds eight subdatasets and concentration is not the first of
them - band 1 is cdr_seaice_conc_interp_spatial_flag. This reader
addresses cdr_seaice_conc by name, so a positional read cannot
silently return a flag layer.
Values are sea ice concentration as a fraction (0-1). When
setNA = TRUE, any residual flag value (above 1) is masked; open
water is a legitimate 0 and is kept.
The projection is taken from the file. The CDR grids are the same 25km polar stereographic grids as NSIDC-0051, and only if the file declares no CRS at all does this reader fall back to EPSG:3976 (south) or EPSG:3413 (north).
SpatRaster with time dimension, or tibble if returnfiles = TRUE.
read_nsidc_ice_daily for NSIDC-0051 v2,
icefiles for the file listing
## Not run: ice <- read_nsidc_cdr_daily() ice_n <- read_nsidc_cdr_daily("2023-03-15", hemisphere = "north") ## End(Not run)## Not run: ice <- read_nsidc_cdr_daily() ice_n <- read_nsidc_cdr_daily("2023-03-15", hemisphere = "north") ## End(Not run)
Read NSIDC passive microwave sea ice concentration (25km) for a single hemisphere.
read_nsidc_ice_daily( date, hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_nsidc_ice_daily( date, hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
hemisphere |
"south" (default) or "north". |
xylim |
extent to crop (in native projection coordinates), or NULL. |
setNA |
logical, mask special values (land, coast, missing) to NA? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
Data are returned in the native polar stereographic projection:
South: EPSG:3976 (WGS 84 / NSIDC Sea Ice Polar Stereographic South)
North: EPSG:3413 (WGS 84 / NSIDC Sea Ice Polar Stereographic North)
Values are sea ice concentration as a fraction (0-1), as the files store
them. When setNA = TRUE, any residual flag value (land, coast,
missing, polar hole) is masked to NA; open water is a legitimate 0 and is
kept.
The NSIDC archive contains some dates with placeholder files (no ice variable). These are automatically filtered out using an internal index of known bad files. When multiple sensor variables exist in a file, the first is used.
For combined hemisphere output or reprojection to a custom grid, use the legacy
readice function with hemisphere = "both".
SpatRaster with time dimension, or tibble if returnfiles = TRUE.
readice for legacy interface with hemisphere = "both" support,
read_nsidc_ice_monthly for monthly data
## Not run: # Latest southern hemisphere ice ice <- read_nsidc_ice_daily() # Specific date, northern hemisphere ice_n <- read_nsidc_ice_daily("2023-03-15", hemisphere = "north") # Multiple dates ice <- read_nsidc_ice_daily(c("2023-01-15", "2023-06-15")) # Without NA masking (keeps special values as raw integers) ice_raw <- read_nsidc_ice_daily("2023-01-15", setNA = FALSE) ## End(Not run)## Not run: # Latest southern hemisphere ice ice <- read_nsidc_ice_daily() # Specific date, northern hemisphere ice_n <- read_nsidc_ice_daily("2023-03-15", hemisphere = "north") # Multiple dates ice <- read_nsidc_ice_daily(c("2023-01-15", "2023-06-15")) # Without NA masking (keeps special values as raw integers) ice_raw <- read_nsidc_ice_daily("2023-01-15", setNA = FALSE) ## End(Not run)
Read NSIDC passive microwave sea ice concentration (25km) monthly data.
read_nsidc_ice_monthly( date, hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_nsidc_ice_monthly( date, hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
hemisphere |
"south" (default) or "north". |
xylim |
extent to crop (in native projection coordinates), or NULL. |
setNA |
logical, mask special values (land, coast, missing) to NA? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog. |
SpatRaster with time dimension, or tibble if returnfiles = TRUE.
read_nsidc_ice_daily for daily data
## Not run: # Latest monthly ice ice <- read_nsidc_ice_monthly() ## End(Not run)## Not run: # Latest monthly ice ice <- read_nsidc_ice_monthly() ## End(Not run)
Read NASA ocean colour chlorophyll-a from L3m (mapped) products. Combines data from SeaWiFS (1997-2010), MODISA (2002+), and VIIRS (2012+) into a continuous time series.
read_oc_chl_daily( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_oc_chl_8day( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_oc_chl_monthly( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_oc_chl_daily( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_oc_chl_8day( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) read_oc_chl_monthly( date, xylim = NULL, lon180 = TRUE, varname = "chlor_a", latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
varname |
subdataset to read, default "chlor_a". |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog (from |
Data are 4km global mapped products from NASA Ocean Biology Processing Group. When sensor eras overlap, one observation per date is returned (typically MODISA).
To read from a specific sensor only, use ocfiles() to get the file
catalog and pass it via inputfiles.
SpatRaster with time dimension set.
ocfiles for file catalog,
read_oc_chl_8day, read_oc_chl_monthly
## Not run: # Latest chlorophyll chl <- read_oc_chl_daily() # Earliest (should be SeaWiFS era) chl_sw <- read_oc_chl_daily(latest = FALSE) # Specific sensor only modis_files <- ocfiles("daily", product = "MODISA", varname = "CHL", type = "L3m") chl_modis <- read_oc_chl_daily("2020-01-15", inputfiles = modis_files) ## End(Not run)## Not run: # Latest chlorophyll chl <- read_oc_chl_daily() # Earliest (should be SeaWiFS era) chl_sw <- read_oc_chl_daily(latest = FALSE) # Specific sensor only modis_files <- ocfiles("daily", product = "MODISA", varname = "CHL", type = "L3m") chl_modis <- read_oc_chl_daily("2020-01-15", inputfiles = modis_files) ## End(Not run)
Read Photosynthetically Available Radiation from NASA MODISA L3m products.
read_oc_par_8day( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_oc_par_8day( date, xylim = NULL, lon180 = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, use Atlantic-centered longitude? Default TRUE. |
latest |
if TRUE and date missing, return latest; if FALSE, earliest. |
returnfiles |
if TRUE, return file catalog instead of data. |
... |
currently ignored. |
inputfiles |
optional pre-filtered file catalog (from |
SpatRaster with time dimension set.
Read NOAA Optimum Interpolation Sea Surface Temperature (OISST) v2.1 daily data.
read_oisst_daily( date, xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_oisst_daily( date, xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). If missing,
returns earliest or latest depending on |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, convert from Pacific (0,360) to Atlantic (-180,180) view?
Default |
varname |
variable to read: one of "sst", "anom", "err", "ice". |
latest |
if |
returnfiles |
if |
... |
currently ignored. |
inputfiles |
optionally provide a pre-filtered file catalog (tibble with
|
OISST files contain four variables:
sst - sea surface temperature (Celsius)
anom - SST anomaly from climatology (Celsius)
err - estimated error standard deviation (Celsius)
ice - sea ice concentration (percent)
Data are on a global 0.25 degree grid (1440x720). Source files use Pacific-centered
longitude (0-360); use lon180 = TRUE (default) to convert to
Atlantic-centered (-180 to 180).
Date matching uses a 1.5-day tolerance window - if no file exists within 1.5 days of a requested date, an error is raised.
SpatRaster with time dimension set to file dates, or tibble if
returnfiles = TRUE.
readsst for legacy interface (returns raster objects)
## Not run: # latest SST sst <- read_oisst_daily() # specific dates sst <- read_oisst_daily(c("2023-01-15", "2023-06-15")) # SST anomaly, cropped to Southern Ocean anom <- read_oisst_daily("2023-01-15", varname = "anom", xylim = c(-180, 180, -80, -40)) # just get the file list files <- read_oisst_daily(returnfiles = TRUE) ## End(Not run)## Not run: # latest SST sst <- read_oisst_daily() # specific dates sst <- read_oisst_daily(c("2023-01-15", "2023-06-15")) # SST anomaly, cropped to Southern Ocean anom <- read_oisst_daily("2023-01-15", varname = "anom", xylim = c(-180, 180, -80, -40)) # just get the file list files <- read_oisst_daily(returnfiles = TRUE) ## End(Not run)
Read NOAA Optimum Interpolation Sea Surface Temperature (OISST) v2.1 monthly data.
read_oisst_monthly( date, xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_oisst_monthly( date, xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (character, Date, or POSIXct). If missing,
returns earliest or latest depending on |
xylim |
extent to crop, anything acceptable to |
lon180 |
logical, convert from Pacific (0,360) to Atlantic (-180,180) view?
Default |
varname |
variable to read: one of "sst", "anom", "err", "ice". |
latest |
if |
returnfiles |
if |
... |
currently ignored. |
inputfiles |
optionally provide a pre-filtered file catalog (tibble with
|
Monthly files contain the same variables as daily files. Date matching uses a 28-day tolerance window.
SpatRaster with time dimension set to file dates, or tibble if
returnfiles = TRUE.
read_oisst_daily for daily data
## Not run: # latest monthly SST sst <- read_oisst_monthly() # specific months sst <- read_oisst_monthly(c("2023-01-01", "2023-06-01")) ## End(Not run)## Not run: # latest monthly SST sst <- read_oisst_monthly() # specific months sst <- read_oisst_monthly(c("2023-01-01", "2023-06-01")) ## End(Not run)
Read the index of Reference Elevation Model of Antarctica (REMA) tiles, as
polygon outlines. Use read_topo with one of the 'rema_'
data sets to read the elevation data itself.
read_rema_tiles(...)read_rema_tiles(...)
... |
reserved for future use, ignored currently |
SpatVector of REMA tile outlines
Model data read from files managed by
sose_monthly_files. Dates are matched to file names by finding
the nearest match in time within a short duration. If date
is greater than length 1 then the sorted set of unique matches is
returned.
read_sose( date, time.resolution = c("monthly"), varname = "", level = 1L, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )read_sose( date, time.resolution = c("monthly"), varname = "", level = 1L, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date to read, the nearest match is used |
time.resolution |
monthly, the only resolution available |
varname |
variable to return from the data files, default is whatever first value
from |
level |
defaults to 1L - there are 52 |
setNA |
unused, kept for backwards compatibility; terra applies the file's own _FillValue |
latest |
if TRUE (and date not supplied) return the latest time available, otherwise the earliest |
returnfiles |
ignore options and just return the file names and dates |
... |
currently ignored |
inputfiles |
input the files data base to speed up initialization |
This function doesn't support xylim, lon180, or more than one date being read.
SpatRaster, one layer per requested level
## Not run: read_sose(varname = "Uvel", level = 1) read_sose(varname = "SeaIceArea", level = 1, latest = FALSE) read_sose(varname = "Chl", level = 10, latest = FALSE) ## End(Not run)## Not run: read_sose(varname = "Uvel", level = 1) read_sose(varname = "SeaIceArea", level = 1, latest = FALSE) read_sose(varname = "Chl", level = 10, latest = FALSE) ## End(Not run)
Read data from various topography/bathymetry sources.
read_topo( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... ) read_bathy( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... ) readtopo( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... ) readbathy( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... )read_topo( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... ) read_bathy( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... ) readtopo( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... ) readbathy( topo = c("gebco_23", "gebco_21", "gebco_19", "gebco_14", "gebco_08", "etopo1", "etopo2", "ibcso", "ibcso_is", "ibcso_bed", "smith_sandwell", "kerguelen", "cryosat2", "ramp", "rema_8m", "rema_100m", "rema_200m", "rema_1km", "lake_superior", "macrie1100m", "macrie2100m"), xylim = NULL, lon180 = TRUE, polar = FALSE, resample = "bilinear", returnfiles = FALSE, ... )
topo |
character, dataset name (see Details) |
xylim |
extent to crop, or SpatRaster template for warping.
Accepts anything |
lon180 |
logical, return Atlantic-centered [-180,180] view? Default TRUE. |
polar |
logical, for IBCSO return polar stereographic version? |
resample |
character, resampling method for warping (default "bilinear") |
returnfiles |
logical, return file path instead of data? |
... |
currently ignored |
The following datasets are available via the topo argument:
GEBCO 2023 grid (ice surface), 15 arc-second global
GEBCO 2021 grid
GEBCO 2019 grid
GEBCO 2014 grid
GEBCO 2008 grid, 30 arc-second
ETOPO1 1 arc-minute global relief
ETOPO2 (historic, deprecated)
IBCSO v2 ice surface, 500m Antarctic
IBCSO v2 bedrock
Global seafloor from satellite altimetry
Kerguelen Plateau bathymetric grid
CryoSat-2 Antarctic DEM
RADARSAT Antarctic DEM v2
REMA Antarctic DEMs
Lake Superior bathymetry
Macquarie Ridge 100m grids
SpatRaster, or character file path if returnfiles = TRUE
topofile for file paths only
## Not run: # Read GEBCO 2023 bathy <- read_topo("gebco_23") # Crop to region bathy <- read_topo("gebco_23", xylim = c(100, 150, -60, -40)) # Warp to template raster template <- terra::rast(nrows = 100, ncols = 100, xmin = 100, xmax = 150, ymin = -60, ymax = -40, crs = "EPSG:4326") bathy <- read_topo("gebco_23", xylim = template) ## End(Not run)## Not run: # Read GEBCO 2023 bathy <- read_topo("gebco_23") # Crop to region bathy <- read_topo("gebco_23", xylim = c(100, 150, -60, -40)) # Warp to template raster template <- terra::rast(nrows = 100, ncols = 100, xmin = 100, xmax = 150, ymin = -60, ymax = -40, crs = "EPSG:4326") bathy <- read_topo("gebco_23", xylim = template) ## End(Not run)
The ICEC field of the AMPS d1 forecast files, as a fraction. This reads
from the 00UT and 12UT analysis files only, which is what
amps_d1_icefiles selects: the later forecast hours of the
pre-2018 files carry no surface fields at all.
readamps_d1ice( date, time.resolution = "12hourly", xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readamps_d1ice( date, time.resolution = "12hourly", xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
ignored, kept for backward compatibility |
xylim |
spatial extents to crop from source data, anything acceptable
to |
latest |
if TRUE (and date not supplied) return the latest time available, otherwise the earliest |
returnfiles |
ignore options and just return the file names and dates |
... |
passed to |
inputfiles |
input the files data base to speed up initialization |
SpatRaster, or the file catalogue if returnfiles = TRUE
readamps_d1wind for the wind fields on the same grid
## Not run: terra::plot(readamps_d1ice(latest = TRUE)) ## End(Not run)## Not run: terra::plot(readamps_d1ice(latest = TRUE)) ## End(Not run)
Read from The Antarctic Mesoscale Prediction System (AMPS) files.
readamps_d1wind reads the "d1" level wind (defaults to 1).
readamps_d1wind( date, time.resolution = "4hourly", xylim = NULL, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, level = 1, ..., inputfiles = NULL ) readamps_d2wind( date, time.resolution = "4hourly", xylim = NULL, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, level = 1, ..., inputfiles = NULL )readamps_d1wind( date, time.resolution = "4hourly", xylim = NULL, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, level = 1, ..., inputfiles = NULL ) readamps_d2wind( date, time.resolution = "4hourly", xylim = NULL, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, level = 1, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
ignored, kept for backward compatibility |
xylim |
spatial extents to crop from source data, anything acceptable
to |
magonly |
return wind magnitude only |
dironly |
return wind direction only |
uonly |
return the u component only |
vonly |
return the v component only |
latest |
if TRUE (and date not supplied) return the latest time available, otherwise the earliest |
returnfiles |
ignore options and just return the file names and dates |
level |
1 for the 10 m wind, 2 onwards for the isobaric levels |
... |
passed to |
inputfiles |
input the files data base to speed up initialization |
readamps_d2wind reads the same fields from the finer "d2" domain.
level 1 is the 10 m wind; 2 onwards are the isobaric levels in file
order, starting at 1000 hPa and working up. How many there are varies with
the file, and an out of range level is an error rather than a silent
substitution.
See amps_metadata for a description of the bands of one
2015-era file. It is a snapshot, not an index: the band layout has changed
three times since, so these readers find their bands by name in the file at
hand rather than by position in that table.
Data http://www2.mmm.ucar.edu/rt/amps/wrf_grib/, and contain gridded forecast data from the AMPS-WRF model.
The 'd1' (domain 1) files were on a 30km grid and are now 24km, while the 'd2' (domain 2) files
were 10km and are now 8km; the change happened around 2018-11-16 and the grid comes from each file.
The grid domains are shown at http://polarmet.osu.edu/AMPS/ - d2 extends out to southern Australia and the tip of South America, and
d1 covers just Antarctica (including Davis) and parts of the Southern Ocean.
There are two forecast cycles, starting at 00UT and 12UT daily. Forecasts are for +00, +03, +06, +09, +12 and +15 hours.
These steps can be used to see how the wind field is forecast as changing, and to obtain two different data sets each
3 hour timestep (e.g. the +15h forecast for the 00UT run is at the same time as the +03h forecast from the 12UT run).
The 00UT and 12UT runs of the pre-2018 files are the only ones that carry the surface fields, so
readamps_d1ice reads from those alone.
SpatRaster, or the file catalogue if returnfiles = TRUE
## Not run: af <- amps_d1files() w <- readamps_d1wind(latest = TRUE, inputfiles = af) vlen <- function(a, b) sqrt(a * a + b * b) terra::plot(vlen(w[[1]], w[[2]])) ## the 850 hPa wind rather than the 10 m wind readamps_d1wind(latest = TRUE, inputfiles = af, level = 8) ## End(Not run)## Not run: af <- amps_d1files() w <- readamps_d1wind(latest = TRUE, inputfiles = af) vlen <- function(a, b) sqrt(a * a + b * b) terra::plot(vlen(w[[1]], w[[2]])) ## the 850 hPa wind rather than the 10 m wind readamps_d1wind(latest = TRUE, inputfiles = af, level = 8) ## End(Not run)
I don't remember what these are but they were at https://orca.science.oregonstate.edu/
readcafe( date, time.resolution = c("monthly"), xylim = NULL, lon180 = TRUE, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readcafe( date, time.resolution = c("monthly"), xylim = NULL, lon180 = TRUE, setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read, |
time.resolution |
time resoution data to read, daily or monthly |
xylim |
spatial extents to crop from source data, can be anything accepted by |
lon180 |
defaults to TRUE, to "rotate" Pacific view [0, 360] data to Atlantic view [-180, 180] |
setNA |
mask out land values (only applies to monthly time.resolution) |
latest |
if TRUE (and date not supplied) return the latest time available |
returnfiles |
ignore options and just return the file names and dates |
... |
passed to |
inputfiles |
input the files data base to speed up initialization |
Files are found with raadfiles::cafe_monthly_files().
readcafe(date = "2010-01-15")readcafe(date = "2010-01-15")
Ocean colour Chlorophyll-a from the NASA L3m (mapped) products, across the
SeaWiFS, MODISA and VIIRS eras. This is the legacy front door onto
read_oc_chl_daily; use that directly, or
read_oc_chl_8day and read_oc_chl_monthly, to
pin a particular temporal resolution.
readchla( date, product = c("any", "MODISA", "SeaWiFS", "VIIRS"), xylim = NULL, algorithm = c("nasa"), latest = TRUE, grid = NULL, ..., returnfiles = FALSE, inputfiles = NULL )readchla( date, product = c("any", "MODISA", "SeaWiFS", "VIIRS"), xylim = NULL, algorithm = c("nasa"), latest = TRUE, grid = NULL, ..., returnfiles = FALSE, inputfiles = NULL )
date |
date or dates of data to read |
product |
sensor to read from, or "any" to draw on all three eras |
xylim |
spatial extents to crop from source data, anything acceptable
to |
algorithm |
nasa only |
latest |
if TRUE (and date not supplied) return the latest time available, otherwise the earliest |
grid |
template |
... |
currently ignored |
returnfiles |
ignore options and just return the file names and dates |
inputfiles |
input the files data base to speed up initialization |
One layer is returned per date. Earlier versions of this function averaged
every requested date down into a single layer; to get that, average the
result yourself with terra::mean() or terra::app().
SpatRaster
read_oc_chl_daily for the reader this calls,
ocfiles for the repository of data files
## Not run: d <- readchla(c("2003-01-01", "2003-06-01"), xylim = terra::ext(100, 150, -70, -30)) ## End(Not run)## Not run: d <- readchla(c("2003-01-01", "2003-06-01"), xylim = terra::ext(100, 150, -70, -30)) ## End(Not run)
readcurr picks a sensible default and returns a terra
SpatRaster. For the historical defaults pinned explicitly, see the
CMEMS current readers:
read_cmems_ugos_daily - U component
read_cmems_vgos_daily - V component
read_cmems_current_speed_daily - current speed
read_cmems_current_direction_daily - current direction
readcurr( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) readcurrents( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readcurr( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) readcurrents( date, xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read |
xylim |
spatial extents to crop |
lon180 |
if TRUE (default), use Atlantic-centered longitude |
magonly |
return current speed only |
dironly |
return current direction only |
uonly |
return U component only |
vonly |
return V component only |
latest |
if TRUE and date missing, return latest |
returnfiles |
if TRUE, return file catalog |
... |
passed to underlying reader |
inputfiles |
optional pre-filtered file catalog |
SpatRaster, or tibble if returnfiles = TRUE
read_cmems_ugos_daily, read_cmems_vgos_daily,
read_cmems_current_speed_daily, read_cmems_current_direction_daily
Derived data are read from files managed by derivaadcfiles.
readderivaadc(products, xylim = NULL, returnfiles = FALSE, ...)readderivaadc(products, xylim = NULL, returnfiles = FALSE, ...)
products |
choice of products, see |
xylim |
spatial extents to crop from source data, can be anything accepted by |
returnfiles |
ignore options and just return the file names |
... |
passed on, primarily for |
SpatRaster
http://data.aad.gov.au/aadc/metadata/metadata.cfm?entry_id=Polar_Environmental_Data
derivaadcfiles for details on the repository of
data files
## Not run: prods <- c("bathymetry","chl_summer_climatology") x <- readderivaadc(prods) ## End(Not run)## Not run: prods <- c("bathymetry","chl_summer_climatology") x <- readderivaadc(prods) ## End(Not run)
Derived sea ice data is read from files managed by derivicefiles.
readderivice( date, time.resolution = c("daily"), product = c("time_since_melt"), xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readderivice( date, time.resolution = c("daily"), product = c("time_since_melt"), xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read, see Details |
time.resolution |
time resoution data to read, daily or monthly |
product |
choice of sea ice product, see Details |
xylim |
spatial extents to crop from source data, can be anything accepted by |
latest |
if TRUE and date input missing, return the latest time available, otherwise the earliest |
returnfiles |
ignore options and just return the file names and dates |
... |
passed on, primarily for |
inputfiles |
input the file set to avoid rescanning that (for extract point-in-time) |
Currently available products are
Dates are matched to file names by finding the nearest match in
time within a short duration. If date is greater than
length 1 then the sorted set of unique matches is returned.
time_since_melt
32767 (treated as missing data)
32766 = land
32765 = open-ocean zone
-32768 = ice that hasn't melted during the data period
In terms of missing data 32767, in the nc file, so should be NA once read into R): these are either open water in the sea ice zone that hasn't re-frozen during the data period, or missing sea ice data that couldn't be interpolated.
SpatRaster
derivicefiles for details on the repository of
data files
Fast ice data
readfastice( date, product = c("circum_fast_ice"), xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readfastice( date, product = c("circum_fast_ice"), xylim = NULL, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates to read (can be character, POSIXt, or Date) |
product |
'circum_fast_ice' or 'binary_fast_ice' |
xylim |
extent in native space of the grid |
latest |
if TRUE (and date not supplied) return the latest time available, otherwise the earliest |
returnfiles |
return the file details only |
... |
passed on, primarily for |
inputfiles |
input the files data base to speed up initialization |
time.resolution |
fixed, the underlying time step is 15 days |
High-resolution mapping of circum-Antarctic landfast sea ice distribution, 2000-2018.
Fast ice data on original polar stereographic grid, the product "circum_fast_ice" is 1000m resolution published in Alex Fraser et al. (2020).
SpatRaster, see Details
Classified surface type:
0: pack ice or ocean
1: continent
2: islands
3: ice shelf
4: fast ice
5: manual fast ice edge
6: auto fast ice edge
## read a particular date, it's circumpolar grid with 7 discrete numerc classes fice <- readfastice("2015-10-01") ## hone in on Davis ex <- c(1742836L, 3315135L, 129376L, 1136611L) davis_ice <- terra::crop(fice, terra::ext(1742836, 3315135, 129376, 1136611)) plot(davis_ice >= 4) #, col = c("brown", "white", grey(c(0.2, 0.5, 0.8))), breaks = c(0, 1, 3, 4, 5, 6)) ## compare 5 years change davis_ice2 <- terra::crop(readfastice("2010-10-01"), terra::ext(ex)) par(mfrow = c(2, 1)) plot(davis_ice >= 4) plot(davis_ice2 >= 4)## read a particular date, it's circumpolar grid with 7 discrete numerc classes fice <- readfastice("2015-10-01") ## hone in on Davis ex <- c(1742836L, 3315135L, 129376L, 1136611L) davis_ice <- terra::crop(fice, terra::ext(1742836, 3315135, 129376, 1136611)) plot(davis_ice >= 4) #, col = c("brown", "white", grey(c(0.2, 0.5, 0.8))), breaks = c(0, 1, 3, 4, 5, 6)) ## compare 5 years change davis_ice2 <- terra::crop(readfastice("2010-10-01"), terra::ext(ex)) par(mfrow = c(2, 1)) plot(davis_ice >= 4) plot(davis_ice2 >= 4)
Sokolov Rintoul
readfronts( date, time.resolution = c("weekly"), product = c("sokolov"), xylim = NULL, lon180 = TRUE, setNA = FALSE, trim = TRUE, returnfiles = FALSE, RAT = TRUE, ... )readfronts( date, time.resolution = c("weekly"), product = c("sokolov"), xylim = NULL, lon180 = TRUE, setNA = FALSE, trim = TRUE, returnfiles = FALSE, RAT = TRUE, ... )
date |
date or dates of data to read, see Details |
time.resolution |
time resoution data to read, daily or monthly |
product |
choice of product, see Details |
xylim |
spatial extents to crop from source data, can be anything accepted by |
lon180 |
if TRUE, data originally in Pacific view will be returned in Atlantic view (-180:180) |
setNA |
is |
trim |
if |
returnfiles |
ignore options and just return the file names and dates |
RAT |
if |
... |
reserved for future use, currently ignored |
SpatRaster
## Not run: b <- readfronts(c("1993-01-01", "2005-01-02"), lon180 = FALSE) ## End(Not run)## Not run: b <- readfronts(c("1993-01-01", "2005-01-02"), lon180 = FALSE) ## End(Not run)
Daily files This dataset contains Backward-in-time FSLE product deduced from DT merged Global Ocean Gridded Absolute Geostrophic Velocities SSALTO/Duacs L4 product (version 2018).
readfsle( date, time.resolution = c("daily"), xylim = NULL, latest = TRUE, varname = c("fsle_max", "theta_max"), returnfiles = FALSE, verbose = TRUE, ..., inputfiles = NULL )readfsle( date, time.resolution = c("daily"), xylim = NULL, latest = TRUE, varname = c("fsle_max", "theta_max"), returnfiles = FALSE, verbose = TRUE, ..., inputfiles = NULL )
date |
date or dates of data to read, see Details |
time.resolution |
time resolution to read (only daily) |
xylim |
spatial extents to crop from source data, can be anything accepted by |
latest |
if TRUE and input date is missing return the latest time available, otherwise the earliest |
varname |
either |
returnfiles |
ignore options and just return the file names and dates |
verbose |
print messages on progress etc. |
... |
|
inputfiles |
input the files data base to speed up initialization |
SpatRaster, or a data.frame of files if returnfiles = TRUE
SST in Kelvin
readghrsst( date, time.resolution = c("daily"), xylim = NULL, lon180 = TRUE, varname = c("analysed_sst", "analysis_error", "mask", "sea_ice_fraction"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readghrsst( date, time.resolution = c("daily"), xylim = NULL, lon180 = TRUE, varname = c("analysed_sst", "analysis_error", "mask", "sea_ice_fraction"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
datetime |
time.resolution |
daily |
xylim |
spatial extents to crop from source data, can be anything accepted by |
lon180 |
currently ignored |
varname |
one of "analysed_sst", "analysis_error", "mask", "sea_ice_fraction" |
setNA |
ignored |
latest |
if TRUE (and date not supplied) return the latest time available |
returnfiles |
ignore options and just return the file names and dates |
... |
arguments passed to raster brick |
inputfiles |
input the files data base to speed up initialization |
SpatRaster, or a data.frame of files if returnfiles = TRUE
readice picks a sensible default and returns a terra
SpatRaster. That default is now the NOAA/NSIDC Climate Data Record
(G02202 V6), read by read_nsidc_cdr_daily. For the historical
defaults pinned explicitly, see read_nsidc_ice_daily and
read_nsidc_ice_monthly, which stay on NSIDC-0051 v2.
The hemisphere = "both" functionality (warping both hemispheres to a
common grid) is only available through this function.
readice( date, time.resolution = "daily", product = c("cdr", "nsidc"), hemisphere = c("south", "north", "both"), xylim = NULL, setNA = TRUE, rescale = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL, resample = "bilinear" ) readice_daily( date, time.resolution = "daily", product = c("cdr", "nsidc"), hemisphere = c("south", "north", "both"), xylim = NULL, setNA = TRUE, rescale = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL, resample = "bilinear" ) readice_monthly( date, time.resolution = "monthly", product = "nsidc", hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, rescale = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readice( date, time.resolution = "daily", product = c("cdr", "nsidc"), hemisphere = c("south", "north", "both"), xylim = NULL, setNA = TRUE, rescale = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL, resample = "bilinear" ) readice_daily( date, time.resolution = "daily", product = c("cdr", "nsidc"), hemisphere = c("south", "north", "both"), xylim = NULL, setNA = TRUE, rescale = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL, resample = "bilinear" ) readice_monthly( date, time.resolution = "monthly", product = "nsidc", hemisphere = c("south", "north"), xylim = NULL, setNA = TRUE, rescale = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
deprecated, use |
product |
"cdr" (default) for the Climate Data Record, or "nsidc" for NSIDC-0051 v2 |
hemisphere |
"south", "north", or "both" |
xylim |
spatial extents to crop, or a SpatRaster (or Raster*) template
to warp onto when |
setNA |
mask special values as NA |
rescale |
ignored (v2 data is already scaled) |
latest |
if TRUE and date missing, return latest available |
returnfiles |
if TRUE, return file catalog |
... |
passed to underlying reader |
inputfiles |
optional pre-filtered file catalog |
resample |
resampling method for warper (when hemisphere = "both") |
SpatRaster, or tibble if returnfiles = TRUE
read_nsidc_cdr_daily for the Climate Data Record reader
read_nsidc_ice_daily for the NSIDC-0051 v2 daily reader
read_nsidc_ice_monthly for the monthly reader
Read the NSIDC pixel-area files for either hemisphere. Only 25km product is supported. Tool name "psn25area_v3.dat and pss25area_v3.dat": http://nsidc.org/data/polar-stereo/tools_geo_pixel.html#pixel_area.
readice_area(product = "nsidc", hemisphere = "south", ...)readice_area(product = "nsidc", hemisphere = "south", ...)
product |
"nsidc" the 25km NSIDC passive microwave |
hemisphere |
south (default) or north |
... |
ignored |
SpatRaster with the area of the cells in m^2
readice
readice_area() readice_area(hemisphere = "north")readice_area() readice_area(hemisphere = "north")
Read MODIS Rapid Response RGB images
readrapid_response( date, product = c("aqua", "terra"), latest = TRUE, returnfiles = FALSE, ... )readrapid_response( date, product = c("aqua", "terra"), latest = TRUE, returnfiles = FALSE, ... )
date |
date of image to load |
latest |
if TRUE and date input is missing return the latest time available, otherwise the earliest |
returnfiles |
return just the list of files |
... |
|
MODIS Rapid Response, Antarctica
SpatRaster
SMAP surface salinity data read from files managed by
salfiles.
readsal( date, time.resolution = c("daily"), xylim = NULL, lon180 = TRUE, varname = c("sss_smap", "nobs", "sss_ref", "gland", "gice", "surtep"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readsal( date, time.resolution = c("daily"), xylim = NULL, lon180 = TRUE, varname = c("sss_smap", "nobs", "sss_ref", "gland", "gice", "surtep"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read, |
time.resolution |
time resoution data to read, daily or monthly |
xylim |
spatial extents to crop from source data, can be anything accepted by |
lon180 |
defaults to TRUE, to "rotate" Pacific view [0, 360] data to Atlantic view [-180, 180] |
varname |
variable to return from the data files, default is "sss_smap", also available is "nobs", "sss_ref", "gland", "gice", "surtep" |
setNA |
mask out land values (only applies to monthly time.resolution) |
latest |
if TRUE (and date not supplied) return the latest time available |
returnfiles |
ignore options and just return the file names and dates |
... |
passed to |
inputfiles |
input the files data base to speed up initialization |
readall |
FALSE by default |
SpatRaster, or a data.frame of files if returnfiles = TRUE
readssh picks a sensible default and returns a terra
SpatRaster. For the historical defaults pinned explicitly, see
read_cmems_adt_daily and read_cmems_sla_daily.
readssh( date, time.resolution = c("daily"), xylim = NULL, lon180 = TRUE, ssha = FALSE, latest = TRUE, returnfiles = FALSE, verbose = TRUE, ..., inputfiles = NULL )readssh( date, time.resolution = c("daily"), xylim = NULL, lon180 = TRUE, ssha = FALSE, latest = TRUE, returnfiles = FALSE, verbose = TRUE, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
time resolution (only "daily" supported) |
xylim |
spatial extents to crop |
lon180 |
if TRUE (default), use Atlantic-centered longitude |
ssha |
if TRUE, return sea level anomaly; if FALSE (default), return ADT |
latest |
if TRUE and date missing, return latest |
returnfiles |
if TRUE, return file catalog |
verbose |
ignored (for backward compatibility) |
... |
passed to underlying reader |
inputfiles |
optional pre-filtered file catalog |
SpatRaster, or tibble if returnfiles = TRUE
read_cmems_adt_daily, read_cmems_sla_daily
readsst picks a sensible default and returns a terra
SpatRaster. For the historical defaults pinned explicitly, see
read_oisst_daily and read_oisst_monthly.
readsst( date, time.resolution = c("daily", "monthly"), xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) readsst_daily( date, xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readsst( date, time.resolution = c("daily", "monthly"), xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL ) readsst_daily( date, xylim = NULL, lon180 = TRUE, varname = c("sst", "anom", "err", "ice"), setNA = TRUE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
time resolution: "daily" or "monthly" |
xylim |
spatial extents to crop from source data |
lon180 |
if TRUE (default), convert Pacific (0,360) to Atlantic (-180,180) view |
varname |
variable to read: "sst", "anom", "err", or "ice" |
setNA |
mask out land values (ignored in new implementation, kept for API compatibility |
latest |
if TRUE and date missing, return latest available |
returnfiles |
if TRUE, return the file catalog instead of data |
... |
passed to underlying reader |
inputfiles |
optional pre-filtered file catalog |
SpatRaster, or tibble if returnfiles = TRUE
read_oisst_daily for the modern terra-based daily reader
read_oisst_monthly for the modern terra-based monthly reader
## Not run: # sensible default sst <- readsst("2023-01-15") class(sst) # SpatRaster, one layer # historical default pinned explicitly sst <- read_oisst_daily("2023-01-15") class(sst) # SpatRaster ## End(Not run)## Not run: # sensible default sst <- readsst("2023-01-15") class(sst) # SpatRaster, one layer # historical default pinned explicitly sst <- read_oisst_daily("2023-01-15") class(sst) # SpatRaster ## End(Not run)
readwind picks a sensible default and returns a terra
SpatRaster. For the historical defaults pinned explicitly, see
read_ncep2_wind_6hourly.
readwind( date, time.resolution = c("6hourly"), xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )readwind( date, time.resolution = c("6hourly"), xylim = NULL, lon180 = TRUE, magonly = FALSE, dironly = FALSE, uonly = FALSE, vonly = FALSE, latest = TRUE, returnfiles = FALSE, ..., inputfiles = NULL )
date |
date or dates of data to read |
time.resolution |
time resolution, currently only "6hourly" |
xylim |
spatial extents to crop |
lon180 |
if TRUE (default), use Atlantic-centered longitude |
magonly |
return wind speed only |
dironly |
return wind direction only |
uonly |
return U component only |
vonly |
return V component only |
latest |
if TRUE and date missing, return latest |
returnfiles |
if TRUE, return file catalog |
... |
passed to underlying reader |
inputfiles |
optional pre-filtered file catalog |
SpatRaster, or tibble if returnfiles = TRUE
read_ncep2_wind_6hourly for modern terra-based reader
Load file names and dates of SMAP sea surface salinity
salfiles(time.resolution = c("daily"), ...)salfiles(time.resolution = c("daily"), ...)
time.resolution |
time resolution read |
... |
reserved for future use, currently ignored |
A data frame of file names and dates.
Only a short period of daily data is available, from '2015-03-27' to '2018-10-21'.
data.frame of file names and dates
This is a convenience wrapper around the corresponding admin functions in the raadfiles package, so that most users will not need to use those functions directly.
This function tells raadtools where to look for its data files, (by default) will build the necessary file list cache if it does not exist, and loads that cache into memory so that raadtools can use it.
set_data_roots(..., build_cache_if_missing = TRUE, refresh_cache = FALSE) get_data_roots()set_data_roots(..., build_cache_if_missing = TRUE, refresh_cache = FALSE) get_data_roots()
... |
strings: one or more paths to directories containing data |
build_cache_if_missing |
logical: |
refresh_cache |
logical: for each path, should the file collection be re-scanned and the cache rebuilt? (May be slow) |
TRUE (invisibly) on success
## Not run: ## assume that we have downloaded some data files to c:/my/data library(raadtools) set_data_roots("c:/my/data") ## see the README/vignette for more detail ## End(Not run)## Not run: ## assume that we have downloaded some data files to c:/my/data library(raadtools) set_data_roots("c:/my/data") ## see the README/vignette for more detail ## End(Not run)
Available variable names from SOSE.
sose_monthly_varnames(iteration = "")sose_monthly_varnames(iteration = "")
iteration |
SOSE iteration, passed to |
These varnames can be used in read_sose(varname = ).
They come from the file names and are what selects a file. The variable
inside the file may be spelt differently - the SeaIceArea files hold a
variable called SIarea - so read_sose() works that out from the file
rather than from the name.
character vector
sose_monthly_varnames()sose_monthly_varnames()
Load file names and dates of AVISO SSH/SSHA data
sshfiles(time.resolution = c("daily"), ...)sshfiles(time.resolution = c("daily"), ...)
time.resolution |
set to daily only |
... |
reserved for future use, currently ignored |
A data.frame of file names and dates
data.frame of file names and dates
SST colours
sst.pal(x, palette = FALSE, alpha = 1)sst.pal(x, palette = FALSE, alpha = 1)
x |
a vector of data values or a single number |
palette |
logical, if |
alpha |
value in 0,1 to specify opacity |
colours, palette, or function, see Details
Derived from "http://oceancolor.gsfc.nasa.gov/DOCS/palette_sst.txt.
Load file names and dates of OISST sea surface temperature data
sstfiles(time.resolution = c("daily", "monthly"), ...)sstfiles(time.resolution = c("daily", "monthly"), ...)
time.resolution |
time resolution read |
... |
reserved for future use, currently ignored |
A data frame of file names and datres
data.frame of file names and dates
In polar stereographic, with longitude and latitude and name as attributes.
Obtained with antanym
plot(readice()) plot(stations, add = TRUE)plot(readice()) plot(stations, add = TRUE)
Read meridional and zonal components of surface currents (m/s) from altimetry products. Input
is optional, with date and xylim. As with the grid reading functions read_ugos_daily and read_vgos_daily
this by default will return the latest data available and for the entire world.
table_uvgos( date, xylim = NULL, ..., xy = TRUE, cell = FALSE, na.rm = TRUE, latest = TRUE, res = NULL )table_uvgos( date, xylim = NULL, ..., xy = TRUE, cell = FALSE, na.rm = TRUE, latest = TRUE, res = NULL )
date |
dates to read |
xylim |
extent of data to read |
... |
arguments passed to read functions (only |
xy |
include coordinates of cell in the output, |
cell |
include cell index in the output, |
na.rm |
by default missing values are removed, set to |
Please note that the coordinates are in longitude latitude, but the velocity components are in m/s. You cannot meaningfully transform the x,y coordinates and use the velocity components without taking into account rotation in the transformation (we might write some helpers for this ...).
Argument lon180 may be used to specify Pacific or Atlantic orientation.
data frame of u, v, x,y (longitude,latitude), cell, and date
uv <- table_uvgos("2001-01-01", xylim = terra::ext(60, 120, -60, -10)) plot(range(uv$x), range(uv$y), type = "n", asp = 1.1) scal <- function(x) (x - min(x, na.rm = TRUE))/diff(range(x, na.rm = TRUE)) nn <- 56 arrows(uv$x, uv$y, uv$x + uv$u, uv$y + uv$v, col = grey.colors(nn)[scal(sqrt(uv$u^2 + uv$v^2)) * (nn-1) + 1], length = 0)uv <- table_uvgos("2001-01-01", xylim = terra::ext(60, 120, -60, -10)) plot(range(uv$x), range(uv$y), type = "n", asp = 1.1) scal <- function(x) (x - min(x, na.rm = TRUE))/diff(range(x, na.rm = TRUE)) nn <- 56 arrows(uv$x, uv$y, uv$x + uv$u, uv$y + uv$v, col = grey.colors(nn)[scal(sqrt(uv$u^2 + uv$v^2)) * (nn-1) + 1], length = 0)
Conversion to POSIXct ensuring no local time zone applied. Currently supported is character, Date and
anything understood by as.POSIXct.
timedateFrom(x, ...)timedateFrom(x, ...)
x |
input date-time stamp, character, Date or other supported type. |
... |
ignored |
the vector x converted (if necessary) to POSIXct
Return the full path, or GDAL data source name, for a topography or
bathymetry data set. Use read_topo to read the data itself.
topofile( topo = c("gebco_23", "gebco_08", "ibcso", "etopo1", "etopo2", "kerguelen", "smith_sandwell", "gebco_14", "macrie1100m", "macrie2100m", "cryosat2", "lake_superior", "ramp", "ibcso_is", "ibcso_bed", "rema_1km", "rema_200m", "rema_100m", "rema_8m", "gebco_19", "gebco_21"), polar = FALSE, lon180 = TRUE, ... )topofile( topo = c("gebco_23", "gebco_08", "ibcso", "etopo1", "etopo2", "kerguelen", "smith_sandwell", "gebco_14", "macrie1100m", "macrie2100m", "cryosat2", "lake_superior", "ramp", "ibcso_is", "ibcso_bed", "rema_1km", "rema_200m", "rema_100m", "rema_8m", "gebco_19", "gebco_21"), polar = FALSE, lon180 = TRUE, ... )
topo |
Data source, see |
polar |
Flag for returning the polar version of the IBCSO data. |
lon180 |
Flag for returning data in Atlantic [-180, 180] rather than Pacific [0, 360] view. |
... |
reserved for future use, ignored currently |
The available data sets, and what each one is, are listed in the Details
section of read_topo.
character string of the full path to a file name
read_topo to read the data
NCEP2 wind files
windfiles(data.source = "", time.resolution = c("6hourly"), ...)windfiles(data.source = "", time.resolution = c("6hourly"), ...)
data.source |
ignored, reserved for future use |
time.resolution |
time resolution data to read, 6hourly only for now |
... |
reserved for future use, currently ignored |
Files containing NCEP2 wind vector data
data.frame of file names and dates