Skip to contents

This function downloads AMSR data.

Usage

dod.amsr(
  year,
  month,
  day,
  destdir = ".",
  age = 365,
  server = "https://data.remss.com/amsr2/ocean/L3/v08.2",
  type = "3day",
  debug = 0
)

Arguments

year, month, day

integer values indicating the desired observation time. All three are required for server values of "3day" and "daily", but day is not required (and is ignored) for the other two choices of server. If these values are not provided, reasonable defaults are chosen. For the "3day" and "daily" cases, this default is 3 days prior to the present date. For the "weekly" case, it is two Saturdays previous to the present date. And for the "monthly" case, it is two months previous to today's month (e.g. it is 5, if today is in July). Users who choose to specify values for year, month, and day for either weekly or monthly data are advised to examine the server with a web browser to discover the year-month-day values of the available files.

destdir

character giving destination directory (defaults to ".", the present directory). The directory must exist. (The author uses "~/data/amsr".)

age

integer giving the number of days old a local file has to be, for it to be regarded as in need of replacement. This defaults to a year.

server

character value indicating the base server location. The default value ought to be used unless the data provider changes their web scheme ... but in that case, it is hoped that users will contact the developers so that the package can be updated.

type

character value indicating where to get the data. This may be "3day" (the default), for a composite covering 3 days of observation, which removes most viewing-path and cloud blanks, "daily" for a daily reading, "weekly" for a composite covering a week, or "monthly" for a composite covering a month. In the "daily" case, the data arrays are 3D, with the third dimension representing ascending and descending traces, but in all the other cases, the arrays are 2D.

debug

integer giving debugging level (defaults to 0, to make the function work without much output).

Value

character value indicating the full pathname to the downloaded file.

Details

This works by constructing URLs based on the arguments provided. The author is unaware of any documentation that specifies the directory structure on the server, and so the construction is based on examining the server with a web browser. Obviously, this is a fragile approach that will lead to failed downloads if the remote directory structure changes. Indeed, dod.amsr() was completely rewritten in July 2023, because a previous version was seen to fail on that date. Users are asked to report any failed downloades they encounter.

Historical note

In July 2023, the author noticed major changes in the organization of the remove server, and also of the data files provided. This required major changes to dod.amsr(), especially in regard to the server argument and the newly-added type argument. Users are asked to be on the lookout for problems. Also note that oce::read.amsr() will need adjustment to read the new file format.

Author

Dan Kelley