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
to make it easy for scripts in other directories to use the cached data.
The file is downloaded with
download.file(). Please read the
‘History’ section for important details on how
read.amsr() have had be altered over the years, to deal
with changes in the directory structure and file format on the
server from which files are downloaded.
download.amsr( year = NULL, month, day, destdir = ".", server = "https://data.remss.com/amsr2/ocean/L3/v08.2", type = "3day", debug = 0 )
a specification of the desired observation time.
There are 3 choices for this specification. (a) If
year is an object
as.Date(), then that specifies the time, and so
day are ignored. This scheme can be convenient for creating a
sequence of images, starting at a particular date, because adding 1
to an object of class
Date increases the time by 1 day, saving
the user from having to know how many days are in any given month.
year is an integer, then it is taken to be the year, and
the user must also specify
day, also integers. (c)
year is NULL (which is the default), then the focus is set to
the most recent date, but this depends on the value of
type (see next). If
or just the first two of them if
"monthly". If these
things are provided, then they just match exactly the values in the
sought-after file on the remote server. If
year is NULL, then
download.amsr() constructs a URL that ought to be the most recent
available file: 3 days prior to the present date (if
"daily"), the Saturday two weeks prior to the
present date (if
"weekly"), or two months in the
A string naming the directory in which to cache the downloaded file.
The default is to store in the present directory, but many users find it more
helpful to use something like
"~/data/amsr" for this, to collect all
downloaded amsr files in one place.
A string naming the server from which data are to be acquired. See “History”.
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.
an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many
oce functions. Generally, setting
turns off the printing, while higher values suggest that more information
be printed. If one function calls another, it usually reduces the value of
debug first, so that a user can often obtain deeper debugging
by specifying higher
download.amsr returns a character value holding the full pathname
of the downloaded file.
Until 25 March 2017, the default server was
"ftp.ssmi.com/amsr2/bmaps_v07.2", but this was changed when the author
discovered that this FTP site had been changed to require users to create
accounts to register for downloads. The default was changed to
"http://data.remss.com/amsr2/bmaps_v07.2" on the named date.
This site was found by a web search, but it seems to provide proper data.
It is assumed that users will do some checking on the best source.
On 23 January 2018, it was noticed that the server-url naming convention
had changed, e.g.
On 26 July 2023, it was noticed that the server-url naming convention
had changed again, requiring not only the alteration of the default
server value but also the addition of a new parameter named
Worse yet -- much worse -- the file format is now changed from a gzipped
format to a NetCDF format, and this will require a complete rewriting
Other functions that plot oce data: