Learn R Programming

oce (version 0.9-20)

download.amsr: Download and Cache an amsr File

Description

If the file is already present in destdir, then it is not downloaded again. The default destdir is the present directory, but it probably makes more sense to use something like "~/data/amsr" to make it easy for scripts in other directories to use the cached data.

Usage

download.amsr(year, month, day, destdir = ".", server = "ftp.ssmi.com/amsr2/bmaps_v07.2")

Arguments

year, month, day
Numerical values of the year, month, and day of the desired dataset. Note that one file is archived per day, so these three values uniquely identify a dataset. If day and month are not provided but day is, then the time is provided in a relative sense, based on the present date, with day indicating the number of days in the past. Owing to issues with timezones and the time when the data are uploaded to the server, day=3 may yield the most recent available data. For this reason, there is a third option, which is to leave day unspecified, which works as though day=3 had been given.
destdir
String naming the directory in which to cache resultant files.
server
String naming the server from which data are to be acquired.

Value

A character value indicating the filename of the result; if there is a problem of any kind, the result will be the empty string.

Warning

All of the download.* functions are subject to change through the autumn of 2016. The plan is to create individual functions as needs arise in everyday work, thereby discovering patterns of arguments that might make sense more generally. Therefore, it is likely that argument order (and even name) may change up until approximately December 2016. Users are advised to refer to arguments by name, i.e. not to rely on their order, and they are asked for patience, because argument names and defaults may vary through the early development.

Details

This function relies on the system utility ftp, and also on local directories being separated by forward slashes in the file system. That means it will probably only work on unix-like systems.

See Also

Other functions that download files: download.coastline, download.topo

Other things related to amsr data: [[<-,amsr-method, amsr-class, composite,amsr-method, plot,amsr-method, read.amsr, subset,amsr-method, summary,amsr-method