Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This parameter is optional. If set, the downloaded file will be copied to the given location. The whole target path must be given, including the file name, and the parent directory must already exist.  If running from an interactive session, a relative path will be relative to the folder containing the macro; when running in batch mode, the path will be relative to where the metview command was run from.

Example usage

Code Block
languagepy
# download the data and assign to a variable
data = download(url : "http://download.ecmwf.org/test-data/metview/gallery/2m_temperature.grib")
print('Values range from ', minvalue(data), ' to ', maxvalue(data))
write('local_copy_of_file.grib', data)

# example which uses the Target parameter to directly save the file
download(url: "http://download.ecmwf.org/test-data/grib_api/data/budg.md5", target: 'local_md5.txt')