|
| 1 | +#!/bin/bash |
| 2 | +# Script to download individual .nc files from the ORNL |
| 3 | +# Daymet server at: http://daymet.ornl.gov |
| 4 | +# |
| 5 | +# NOTE: Compressed tar.gz files containing all .nc files for |
| 6 | +# a tile are separately available at the above address. |
| 7 | +# Downloading the tar.gz files is far faster should you |
| 8 | +# require all available data for a tile. |
| 9 | +# |
| 10 | +# Tile IDs must be provided either as a range |
| 11 | +# of values, or as a space seperated list. Tile IDs may |
| 12 | +# be determined from the Daymet mask of the conterminous |
| 13 | +# United States, visible for example at: |
| 14 | +# http://daymet.ornl.gov/gridded |
| 15 | +# |
| 16 | +# Methods using wget and curl are shown. Each uses a resaonable |
| 17 | +# rate limit for downloading data. Users attempting to download |
| 18 | +# data at higher rates may be rate limited by the server. |
| 19 | +# |
| 20 | +# The example downloads the vp.nc file for given year and tile |
| 21 | +# ranges. You may change vp.nc to be any of the following: |
| 22 | +# vp.nc, tmin.nc, tmax.nc, swe.nc, srad.nc, prcp.nc, dayl.nc |
| 23 | +# |
| 24 | +# Data is also available via the THREDDS web interface at: |
| 25 | +# http://daymet.ornl.gov/thredds/catalog/allcf/catalog.html |
| 26 | +# |
| 27 | +# Citation Information is available at: |
| 28 | +# http://daymet.ornl.gov/sites/default/files/Daymet_Reference_Citation.pdf |
| 29 | +# |
| 30 | +# Pete Eby |
| 31 | +# Oak Ridge National Lab |
| 32 | + |
| 33 | + |
| 34 | +# For ranges use {start..end} |
| 35 | +# for individul vaules, use: 1 2 3 4 |
| 36 | +for year in {2002..2003} |
| 37 | +do |
| 38 | + for tile in {1159..1160} |
| 39 | + do wget --limit-rate=3m http://daymet.ornl.gov/thredds/fileServer/allcf/${year}/${tile}_${year}/vp.nc -O ${tile}_${year}_vp.nc |
| 40 | + # An example using curl instead of wget |
| 41 | + #do curl --limit-rate 3M -o ${tile}_${year}_vp.nc http://daymet.ornl.gov/thredds/fileServer/allcf/${year}/${tile}_${year}/vp.nc |
| 42 | + done |
| 43 | +done |
0 commit comments