sys.argv[1:2] = [str(x) for x in sys.argv[1:2]]
output_folder = sys.argv[1]
threshold_dir = (int)(sys.argv[2])
num_blocks = (int)(sys.argv[3])
compute_mse_current = (int)(sys.argv[4])
cycles = (int)(sys.argv[5])
max_active_set = (int)(sys.argv[6])

####load data
file = "ENEL_2014/Enel_dataset.npz"
results = Result(file, "lasso")

XTrain, YTrain, XTest, YTest = results.extract_train_test()
enel_dict = results.extract_dict()
Coord, Coord_turb, power_curve = results.extract_coords()

angles_coord_turb, _ = compute_angle(Coord, Coord_turb)

##transformation of data
X = np.concatenate((XTrain, XTest), axis=0)
enel_transf = Enel_powerCurveTransformation()

X_angle, _, _ = enel_transf.compute_angle_matrix(X)
output_dict = dict.fromkeys(np.arange(0, 49), np.array([[]], dtype="int64"))

k_levels = np.arange(0, 12).reshape([12, 1])
for key in np.arange(0, 49):
    current_values = np.arange(key * 12, key * 12 + 12).reshape([12, 1])
    output_dict[key] = np.concatenate((current_values, k_levels), axis=1)
sys.argv[1:2] = [str(x) for x in sys.argv[1:2]]
output_folder = sys.argv[1]
threshold_dir = (int)(sys.argv[2])
num_blocks = (int)(sys.argv[3])
compute_mse_current = (int)(sys.argv[4])
cycles = (int)(sys.argv[5])
max_active_set = (int)(sys.argv[6])

####load data
file = "ENEL_2014/Enel_dataset.npz"
results = Result(file, "lasso")


XTrain, YTrain, XTest, YTest = results.extract_train_test()
_, _, power_curve = results.extract_coords()
##transformation of data
X = np.concatenate((XTrain, XTest), axis = 0)
enel_transf = Enel_powerCurveTransformation()

X_speed,_, wind_direction = EnelWindSpeedTransformation().transform(X)
print("wind speed computed")

enel_transf = Enel_turbineTransformation()
X_transf, output_dict = enel_transf.transform(X_speed, power_curve)

print("transformation done")
XTrain_transf = X_transf[:XTrain.shape[0],:]
XTest_transf = X_transf[XTrain.shape[0]:,:]

##center data