from radiation import plt #latitudes = np.concatenate([[0, 1], np.arange(2, 61, 2)]) * ureg.deg #latitudes = np.arange(0, 61, 2) * ureg.deg latitudes = np.concatenate([[0, 1], np.arange(2, 61, 2)]) * ureg.deg #latitudes = np.arange(0, 61, 1) * ureg.deg days = np.linspace(0, 365) * ureg.day #days = np.linspace(0, 365, 10) * ureg.day betas = np.linspace(-35, 70, 101) * ureg.deg #betas = np.linspace(-35, 70, 301)*ureg.deg #betaFraction = np.linspace(0, 1.8, 21) gammas = 0 * ureg.deg rb = Radiation(latitudes, days, betas, gammas) rb.contour_irradiance('Latitude', 'Beta', 'TotalAnnualPerDay', [2, 3, 4, 5, 6, 7]) max_I_tmA_ind = np.argmax(rb.I_tmA, 1) plt.plot(rb.latitudes.magnitude, rb.betas[max_I_tmA_ind].magnitude, linestyle='--', color='w') plt.figure(2) misalignment = 30 * ureg.deg normalize_file = 1 rb.contour_tilt_misalignment(misalignment, normalize_file) plt.ylim([.88, 1]) #plt.ylim([.94, 1]) plt.xlim([-30, 30]) plt.show(block=True)
from radiation import ureg from radiation import Radiation import numpy as np latitudes = 40 * ureg.degree days = np.linspace(0, 365, 40) * ureg.day betas = np.linspace(-10, 85, 301) * ureg.degree #betas = 0 * ureg.degree gammas = [0] * ureg.degree rb = Radiation(latitudes, days, betas, gammas) rb.contour_irradiance('Days', 'Beta', 'TotalD', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
color='#1f77b4') l2 = plt.Line2D([x0,y0+width], [0.3*height,0.3*height], color='#ff7f0e') return [l1, l2] latitudes = 60 * ureg.degree days = np.linspace(0, 365, 40) * ureg.day betas = np.linspace(-10, 85, 301) * ureg.degree #betas = 0 * ureg.degree gammas = [0] * ureg.degree #fig, ax = plt.subplots() rb1 = Radiation(latitudes, days, betas, gammas) [fig, ax] = rb1.contour_irradiance('Days', 'Beta','TotalDay', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) display_months(ax, 'x_axis') #rb.contour_irradiance('Beta', 'Gamma','TotalAnnualPerDay', [500 1000 1500 2000],'RadialTickSpacing', [10:10:90], 'RadLabels', 8); #ax.xaxis.set_minor_formatter #ax.xaxis.get_label().set_fontsize(10) ax.tick_params(which ='minor', labelsize = 12) plt.title('') plt.savefig("irradianceContour_day_tilt_latitudes"+str(latitudes.magnitude)+".png",bbox_inches='tight')
import numpy as np from scipy import interpolate from radiation import plt from display_months import display_months latitudes = [90] * ureg.degree days = np.linspace(0, 365, 30) * ureg.day betas = np.linspace(0, 90, 40) * ureg.degree gammas = np.linspace(-180, 180, 60) * ureg.degree rb = Radiation(latitudes, days, betas, gammas) #fig, ax = plt.subplots() cs = rb.contour_irradiance('Beta', 'Gamma', 'TotalAnnualPerDay', [0, 1, 2, 3, 4, 5, 6, 7], 'polar') #display_months(ax, 'x_axis') #plt.clim(0, 8); plt.title('') #plt.clim(cs, 0, 10) #plt.colorbar(cs) plt.savefig('contour_irradiance_orientation' + str(latitudes[0].magnitude)) normalized = 1 cs = rb.contour_irradiance('Beta', 'Gamma', 'TotalAnnualPerDay', np.arange(0, 1.05, 0.05), 'polar', normalized) plt.title('') plt.savefig('contour_irradiance_orientation_normalized' + str(latitudes[0].magnitude)) plt.figure(3)
from radiation import ureg from radiation import Radiation import numpy as np from radiation import plt latitudes = np.concatenate([[0, 1], np.arange(2, 61, 2)]) * ureg.deg #latitudes = np.arange(0, 61, 2) * ureg.deg days = np.linspace(0, 365) * ureg.day betaFraction = np.linspace(0, 1.8, 301) betaFractionFlag = 1 gammas = 0 * ureg.deg rb = Radiation(latitudes, days, betaFraction, gammas, betaFractionFlag) rb.contour_irradiance('Latitude', 'BetaFraction', 'TotalAnnualPerDay', [2, 3, 4, 5, 6, 7, 8]) plt.title('') max_I_tmA_ind = np.argmax(rb.I_tmA, 1) plt.plot(rb.latitudes[1:].magnitude, rb.betas[max_I_tmA_ind[1:]].magnitude, linestyle='--', color='w') plt.show(block=True)