#rs1[ind_all_clean]=s1/sol1_clean ## near-infrared (0.7-2.4micron) #rp2[ind_all_clean]=p2/sol2 #rs2[ind_all_clean]=s2/sol2 ## shortwave(0.3-2.4 micron) #rp3[ind_all_clean]=(p1+p2)/sol3_clean #rs3[ind_all_clean]=(s1+s2)/sol3_clean # approximation # planar albedo #rp1 and rp2 not derived anymore rp3[ind_all_clean] = sl.plane_albedo_sw_approx(D[ind_all_clean], cos_sza[ind_all_clean]) # spherical albedo #rs1 and rs2 not derived anymore rs3[ind_all_clean] = sl.spher_albedo_sw_approx(D[ind_all_clean]) # calculation of the BBA for the polluted snow rp1[ind_pol], rp2[ind_pol], rp3[ind_pol] = sl.BBA_calc_pol( rp[:, ind_pol], asol, sol1_pol, sol2, sol3_pol) rs1[ind_pol], rs2[ind_pol], rs3[ind_pol] = sl.BBA_calc_pol( alb_sph[:, ind_pol], asol, sol1_pol, sol2, sol3_pol) #%% Output if os.path.isfile(sys.argv[1]): print('\nText file output') # data_in = pd.read_csv(sys.argv[1]) data_out = data_in data_out['grain_diameter'] = D data_out['snow_specific_area'] = area
p1, p2, s1, s2 = BBA_v(al[ind_all_clean], ak1[ind_all_clean]) # shortwave(0.3-2.4 micron) rp3[ind_all_clean] = (p1 + p2) / sol3_clean rs3[ind_all_clean] = (s1 + s2) / sol3_clean rs3[~ind_all_clean] = np.nan rs3[~ind_all_clean] = np.nan # approximation # planar albedo #rp1 and rp2 not derived anymore1 rp3_2 = rp3 rp3_2[ind_all_clean] = sl.plane_albedo_sw_approx(D[ind_all_clean], am1[ind_all_clean]) # spherical albedo #rs1 and rs2 not derived anymore rs3_2 = rs3 rs3_2[ind_all_clean] = sl.spher_albedo_sw_approx(D[ind_all_clean]) #%% Check of planar and spherical shortwave albedo fig, ax = plt.subplots(2, 2, figsize=(15, 8)) plt.subplots_adjust(wspace=0.4, hspace=0.4) ax[0, 0].scatter(D[ind_all_clean], rs3[ind_all_clean], label='integrated') ax[0, 0].set_xlabel('D') ax[0, 0].set_ylabel('SW spherical albedo') x = np.linspace(np.nanmin(D), np.nanmax(D), 100) ax[0, 0].plot(x, sl.spher_albedo_sw_approx(x), label='approximated') ax[0, 0].legend() ax[0, 1].scatter(rs3[ind_all_clean], rs3_2[ind_all_clean], label='integrated') ax[0, 1].set_xlabel('integrated') ax[0, 1].set_ylabel('approximated') ax[0, 1].set_title('SW spherical albedo')