def fetch_nrel_data(self, turbine_id, year,\
        columns=['date','speed','power_output','score','corrected_score'], data_home = None):

        #todo assert that year is in [2004,2005,2006] and turbine_id is valid, too
        data_home = os.getenv("HOME") + "/nrel_data/"+str(year)+"/"
        archive_file_name = str(turbine_id) +".npy"
        DATA_URL = self.BASE_URL + str(year)+"/"+str(turbine_id)+".csv"
        if not os.path.exists(data_home):
            os.makedirs(data_home)
        archive_file = os.path.join(data_home, archive_file_name)
        if not os.path.exists(archive_file):
            print ("downloading NREL wind measurements from from %s to %s"
                   % (DATA_URL, data_home))
            buf = self.download_with_progress_bar(DATA_URL, return_buffer=True)
            reader=csv.reader(buf, delimiter=',')
            data = []
            reader.next() # skip first, header of csv
            i=0
            for row in reader:
                point=[]
                #convert datetime to unix timestamp
                fmt = "%Y-%m-%d %H:%M:%S"
                timestamp=int(time.mktime(datetime.datetime.strptime(row[0], fmt).timetuple()))
                point.append(timestamp)
                point.append(float(row[1]))
                point.append(float(row[2]))
                point.append(float(row[3]))
                point.append(float(row[4]))
                data.append(point)
                i=i+1
            # abcde stuff for "TypeError: expected a readable buffer object"
            # todo maybe better solution possible...
            data_arr=np.array([(a,b,c,d,e) for (a,b,c,d,e) in data], dtype=self.NREL_DATA_DTYPE)
            data_arr.setflags(align=True)
            np.save(archive_file, data_arr)
        else:
            data = np.load(archive_file)
            data_arr = np.array(data, dtype=self.NREL_DATA_DTYPE)
        return data_arr[columns]
Loader for NREL wind measurements.
dataset/ETHPy150Open cigroup-ol/windml/windml/datasets/nrel.py/NREL.fetch_nrel_data