In [41]:
from noaaclass import noaaclass
from datetime import datetime, timedelta
import os
username = os.environ['NOAA_USERNAME']
password = os.environ['NOAA_PASSWORD']
noaa = noaaclass.connect(username, password)
start_time = datetime(2014, 4, 1, 4, 0, 1) #start on one second after 4am April 1st, 2014
end_time = datetime(2014, 4, 1, 21, 59, 59) #end on one second before 10am April 2st, 2014
request_data = []
for i in range(0,183): #6 months of data
request_data.append(
{
'id': '+',
'enabled': True,
'name': 'colorado'+str(start_time.date()),
'north': 41.00,
'south': 38.00,
'west': -106.00,
'east': -103.00,
'coverage': ['NH'],
'schedule': ['R'],
'satellite': ['G15'],
'channel': range(1, 7),
'format': 'NetCDF',
'start': start_time,
'end': end_time
}
)
noaa.request.gvar_img.set(request_data, async=True, append_files=True)
noaa.request.gvar_img.get(request_data, async=True, append_files=True)
start_time += timedelta(days=1)
end_time += timedelta(days=1)
In [ ]:
# data = noaa.request.gvar_img.set(data, async=True, append_files=True)
# data
In [52]:
start_time = datetime(2014, 4, 1, 0, 0, 1) #generates 6 months of days
for i in range(0,183): #ten days data
print 'colorado'+str(start_time.date())+'_'+str(channel)
start_time += timedelta(days=1)
In [ ]: