data-retrieval: Retrieve and load data from the UNAVCO archive

data-retrievalR Documentation

Retrieve and load data from the UNAVCO archive

Description

The user should be most interested in pore.pressure and pore.temperature to get pore-fluid pressure and temperature data.

Usage

pore.pressure(sta4, year, jday, start. = NULL, end. = NULL, ...)

pore.temperature(sta4, year, jday, start. = NULL, end. = NULL, ...)

unavco_dataload(
  sta,
  year,
  jday,
  dattype = c("pp", "pt"),
  localfile = NULL,
  quiet = FALSE
)

## Default S3 method:
unavco_dataload(
  sta,
  year,
  jday,
  dattype = c("pp", "pt"),
  localfile = NULL,
  quiet = FALSE
)

unavco_temploader(file, dattype = c("pp", "pt"), ...)

## Default S3 method:
unavco_temploader(file, dattype = c("pp", "pt"), ...)

unavco_downloader(
  url.toget,
  temp,
  PLUGIN,
  quiet = FALSE,
  remove.temp = FALSE,
  ...
)

## Default S3 method:
unavco_downloader(
  url.toget,
  temp,
  PLUGIN,
  quiet = FALSE,
  remove.temp = FALSE,
  ...
)

dlCatcher(FUN)

unavco_path(sta4, year, jday, type = c("pp", "pt"), url.check = FALSE)

Arguments

sta4

character; 4-character station name (e.g. B084).

year

numeric; the year of data

jday

numeric; Julian date (the day of year)

start.

xx;

end.

xx;

...

additional parameters

sta

character;

dattype

character;

localfile

character;

quiet

logical; should the functions not be verbose?

file

character; the file to be loaded

url.toget

character; the URL to download

temp

character; file for temporary writing

PLUGIN

function (not used)

remove.temp

logical; should temporary files be deleted?

FUN

a function to try, and catch exceptions from

type

character; the type of data to generate download data for

url.check

logical; should the urls be tested for existence?

Details

pore.pressure and pore.temperature both use unavco_dataload and unavco_dataload to download, reads-in, and process data from the UNAVCO archive.

These functions will return all data for the specified year and (Julian) day(s).

unavco_temploader loads and process data downloaded from the UNAVCO archive

unavco_downloader is the downloader for the UNAVCO data archive download.file is used with cacheOK==FALSE, and mode=="w".

dlCatcher handles exceptions.

unavco_path generates the appropriate path for UNAVCO data retrieval; it returns the appropriate url to download a .txt.gz data file from the UNAVCO data archive. If url.check==TRUE the function url.exists is used to test the status of each link; this can add a substantial amount of processing time for large numbers of urls.

See Also

read.https and XXX to load data files from the source (github)

consistent

unavco-methods

Examples

## Not run: 
# Download data, also makes it consistent
xpp <- pore.pressure("B084", 2010, 94)
xpt <- pore.temperature("B084", 2010, 94)

# window in on the El Mayor quake:
st <- as.POSIXct("2010-04-04", tz='UTC') + 79200
redo <- FALSE
if (!exists('xppw') | redo) xppw <- pore.pressure("B084", 2010, 94, start.=st)
if (!exists('xptw') | redo) xptw <- pore.temperature("B084", 2010, 94, start.=st)

layout(matrix(1:4,ncol=2))
plot(xpp, type='l')
plot(xpt, type='l')
plot(xppw, type='l')
plot(xptw, type='l')
layout(matrix(1))

# Can also manually subset:
unavco_window(as.data.frame(xpp), start. = st, end. = st+10)


## End(Not run)
unavco_path("B084", 2010, 1)
unavco_path("B084", 2010, 1:10) # use vectors for multiple urls
unavco_path("B084",2010, 1:10, "pt")
# Also try:
# unavco_path("B084",2010, 1:10, "pt", TRUE)

abarbour/pborepo documentation built on April 27, 2022, 8:47 a.m.