Skip to content

Instantly share code, notes, and snippets.

@mrocklin
Created February 12, 2015 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrocklin/26d8323f9a8a6a75fce0 to your computer and use it in GitHub Desktop.
Save mrocklin/26d8323f9a8a6a75fce0 to your computer and use it in GitHub Desktop.
Download temperature data for 2014
import pandas as pd
dates = pd.date_range('2014-01-01', '2014-12-31', freq='D')
dates = [str(d).split()[0] for d in dates]
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
for date in dates:
server.retrieve({
'stream' : "oper",
'levtype' : "sfc",
'param' : "165.128/166.128/167.128",
'dataset' : "interim",
'step' : "00",
'grid' : "0.25/0.25",
'time' : "00/06/12/18",
'date' : date,
'type' : "an",
'class' : "ei",
'target' : date + ".nc3",
'format' : "netcdf" })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment