from evaluation import datawash from evaluation import directions as di from evaluation import percents from evaluation import hour from evaluation import gp import termcolor from plotcheck import pl from evaluation import baynetwork from evaluation import bino path = "/home/bwei/PycharmProjects/data lib/pvtotal.csv" #windset = rd(path) #name = raw_input('the name of data set?') #realwindset = windset[name] pointsperday = 288 # CHANGE HERE FOR DIFFERENT RESOLUTION realwindset = readcsv.rd(path) #realwindset=hour(realwindset)############# windsetoriginal = realwindset realwindset.shape = (len(realwindset), ) #data reading is done succ = [] action = [] ranges = np.arange(9000, 26100) for iters in ranges: def ma(data, days_to_keep, points_per_day, alpha=0.2): days_covered = int(np.floor(len(data) / points_per_day)) points_covered = days_covered * points_per_day daysdata = [] onedaydata = data[len(data) - points_covered:len(data) - points_covered + points_per_day]
import numpy as np import readcsv import matplotlib.pyplot as plt from plotcheck import pl #read 2016: path_2016 = "/home/bwei/PycharmProjects/data lib/pv_2016.csv" dataset_2016 = readcsv.rd(path_2016) dataset_2016[np.where(dataset_2016 > 50)] = 0 #read_2017: path_2017 = "/home/bwei/PycharmProjects/data lib/pv_2017.csv" dataset_2017 = readcsv.rd(path_2017) dataset_2017[np.where(dataset_2017 > 50)] = 0 #read_2018: path_2018 = "/home/bwei/PycharmProjects/data lib/pv_2018.csv" dataset_2018 = readcsv.rd(path_2018) points_per_day = 288 rounds = len(dataset_2016) / points_per_day # sum up func: def sumup(data, rounds, point_per_day=288): sum_vector = [] for n in np.arange(rounds): sum_vector_one = np.sum(data[n * point_per_day:(n + 1) * point_per_day]) sum_vector.append(sum_vector_one) return np.array(sum_vector)
from plotcheck import pl import GPy from matplotlib import pyplot as plt from pydmd import HODMD aaa = np.array([1, 2, 3, 4, 5, 6, 8, 19, 30]) bbb = np.array([2, 10, 4, 5, 12, 7]) ccc = np.array([3, 4, 5, 6, 7, 8]) imfs = np.array([]) kkkk = np.array([aaa, bbb, ccc]) Percentile = np.percentile(aaa, [0, 25, 50, 75, 100]) IQR = Percentile[3] - Percentile[1] UpLimit = Percentile[3] + IQR * 1.5 DownLimit = Percentile[1] - IQR * 1.5 aaa[np.where(aaa > UpLimit)] = UpLimit avvv = [{}] * 3 path = "/home/bwei/PycharmProjects/data lib/PVhourly6months.csv" realwindset = readcsv.rd(path, datawashflag=1) pointsperday = 24 days = 2 hodmd = HODMD(svd_rank=0, exact=True, opt=True, d=pointsperday).fit(realwindset[-48:]) hodmd.reconstructed_data.shape hodmd.plot_eigs() hodmd.dmd_time['tend'] = (days + 1) * pointsperday - 1 # since it starts from zero