def setGridList(self, year,month,day):
s3conn = boto.connect_s3()
bucket = s3conn.get_bucket('noaa-nexrad-level2')
keys = bucket.list(prefix= year + '/' + month + '/' + day + '/',
delimiter='/')
tmp = []
for key in keys:
tmp.append(key.name.split('/')[-2])
self.gridList = tmp
if(self.grid not in self.gridList):
print("The site selected is not available for " + year
+ ' ' + month + '/' + day + '. The site has defaulted to : ' +
self.gridList[0] +
'. Please re-select the site you would like to view')
self.selectionChangeHour(0)
self.selectionChangeMMSS(0)
self.selectionChangeGrid(0)
else:
self.currentGridIndex = np.where(np.array(self.gridList) == self.grid)[0][0]
评论列表
文章目录