plt.figure() plt.hist(D.flatten(), bins=50, label='D') #plt.hist(al.flatten(),bins= 50,label='al') plt.hist(am1.flatten(), bins=50, label='am1') # plt.xlim([0, 1]) plt.ylim([0, 3500]) plt.xlim([0, 2]) plt.legend() plt.ylabel('count') plt.xlabel('value') #%% Comparison output InputFolder_py = 'out/SICE_2020_py/' InputFolder_fortran = 'out/SICE_2020_py - Kopi/' #InputFolder_fortran = 'out/SICE_2020_py//' tmp = bl.heatmap( rio.open(InputFolder_py + 'diagnostic_retrieval.tif').read(1), 'isnow_py') isnow = rio.open(InputFolder_py + 'diagnostic_retrieval.tif').read(1) ind_all_clean = np.logical_or(isnow == 0, isnow == 7) var_list = ('albedo_bb_planar_sw', 'albedo_bb_spherical_sw') for i in range(len(var_list)): var_py = rio.open(InputFolder_py + var_list[i] + '.tif').read(1) var_f = rio.open(InputFolder_fortran + var_list[i] + '.tif').read(1) diff = var_f - var_py diff[~ind_all_clean] = np.nan plt.figure(figsize=(10, 15)) bl.heatmap(diff, 'Approximation - Integration', col_lim=(-0.01, 0.01), cmap_in='seismic') plt.title(var_list[i])
output_sice_f(OutputFolder+"boar.dat",'rBRR_'+str(i+1),4+i) #%% plotting oulooks try: os.mkdir(OutputFolder+'plots') except: print('folder exist') import matplotlib.pyplot as plt # fig,ax=bl.heatmap_discrete(rio.open(OutputFolder+'diagnostic_retrieval.tif').read(1), # 'diagnostic_retrieval ') # ax.set_title(OutputFolder) # fig.savefig(OutputFolder+'plots/diagnostic_retrieval.png',bbox_inches='tight') var_list = ('albedo_bb_planar_sw','albedo_bb_spherical_sw') for i in range(len(var_list)): var_1 = rio.open(OutputFolder+var_list[i]+'.tif').read(1) plt.figure(figsize=(10,15)) bl.heatmap(var_1,var_list[i], col_lim=(0, 1) ,cmap_in='jet') plt.title(OutputFolder) plt.savefig(OutputFolder+'plots/'+var_list[i]+'_diff.png',bbox_inches='tight') plt.ioff() for i in np.append(np.arange(11), np.arange(21)): var_name = 'albedo_spectral_spherical_'+ str(i+1).zfill(2) var_1 = rio.open(OutputFolder+var_name+'.tif').read(1) plt.figure(figsize=(10,15)) bl.heatmap(var_1,var_name, col_lim=(0, 1) ,cmap_in='jet') plt.title(OutputFolder) plt.savefig(OutputFolder+'plots/'+var_name+'.png',bbox_inches='tight') plt.ion()
os.mkdir(InputFolder + 'plots') except: print('folder exist') fig, ax = bl.heatmap_discrete( rio.open(InputFolder + 'diagnostic_retrieval.tif').read(1), 'diagnostic_retrieval ') ax.set_title(InputFolder) fig.savefig(InputFolder + 'plots/diagnostic_retrieval.png', bbox_inches='tight') var_list = ('albedo_bb_planar_sw', 'albedo_bb_spherical_sw', 'r0') for i in range(len(var_list)): var_1 = rio.open(InputFolder + var_list[i] + '.tif').read(1) plt.figure(figsize=(10, 15)) bl.heatmap(var_1, var_list[i], col_lim=(0, 1), cmap_in='jet') plt.title(InputFolder) plt.savefig(InputFolder + 'plots/' + var_list[i] + '.png', bbox_inches='tight') plt.close() var_list = ('O3_SICE', 'grain_diameter', 'snow_specific_area', 'al', 'conc') for i in range(len(var_list)): var_1 = rio.open(InputFolder + var_list[i] + '.tif').read(1) plt.figure(figsize=(10, 15)) bl.heatmap(var_1, var_list[i], cmap_in='jet') plt.title(InputFolder) plt.savefig(InputFolder + 'plots/' + var_list[i] + '.png', bbox_inches='tight') plt.close()