# -*- coding: utf-8 -*-



from copylot import CoPylot
import matplotlib.pyplot as plt

cp = CoPylot()
r = cp.data_create()
cp.api_callback_create(r)
cp.data_set_string(r,
                   "ambient.0.weather_file",
                   "C:/Users/Asus/Documents/Python_Mestrado/Modules/Brazil BRA Brasilia_(Civ Mil) (INTL).csv") #weather directory

print(cp.generate_layout(r))
field = cp.get_layout_info(r)
print(cp.simulate(r))
layout_results = cp.get_layout_info(r)
print(cp.simulate(r))
flux = cp.get_fluxmap(r)
lay_res= cp.detail_results(r)
summary = cp.summary_results(r)
cp.data_free(r)  


#plot dos heliostatos

plt.scatter(field["x_location"], field["y_location"], s = 1.5)
plt.tight_layout()
plt.show()

#plot do fluxo

im = plt.imshow(flux)
plt.colorbar(im)
plt.tight_layout()
plt.show()

cp.data_get_number(r, "receiver.0.q_rec_des")

