#bins_borders = np.concatenate((bins,bins2)) #bins = np.arange(0,6001,deltaBelow) #bins2 = np.arange(7000,10001,1000) #bins_centred = np.concatenate((bins,bins2)) # delta = 1000 deltaBelow = 1000 bins_borders = np.arange(-500, 10501, 1000) bins_centred = np.arange(0, 10001, 1000) print(bins_borders) print(bins_centred) folder = '../08_lwp_and_clustering' name = 'cloud_vertical_' + domainName out = loadObj(folder, name) vars = ['CT', 'CB', 'TH'] for res in ress: for mode in modes: for var in vars: vals = out[res + mode][var]['vals'] vals = vals[vals != -999] hist_vals = np.histogram(vals, bins_borders)[0] # ADJUST FOR DIFFERENT RESOLUTION hist_vals[bins_centred > 6000] = hist_vals[bins_centred > 6000]/ \ (1000/deltaBelow) #### add lower values to 6000 for transition from high resolution to low #val6000 = hist_vals[bins_centred == 6000]
matplotlib.use('Agg') import matplotlib.pyplot as plt var = 'Fqv' titleVar = 'WV Flux' unit = 'Fqv [1E9*kg/h]' # PREAPRE DATA FOR PLOTTING out = {} out['hrs'] = np.arange(0, 25) max = -np.Inf min = np.Inf for res in ress: for mode in modes[0:2]: name = var + '_' + res + mode obj = loadObj(folder1, name) vals1 = obj[var] / 1E9 * 3600 name = var + '_' + res + mode obj = loadObj(folder2, name) vals2 = obj[var] / 1E9 * 3600 vals = vals1 - vals2 dates = obj['time'].astype(datetime) # MEAN DIURNAL hrs = np.arange(0, 24) hrVals = np.full(len(hrs), np.nan) for hr in hrs: inds = [i for i in range(0, len(dates)) if dates[i].hour == hr] hrVals[hr] = np.mean(vals[inds])
titlesize = 14 Area = None # PREAPRE DATA FOR PLOTTING out = {} out['hrs'] = np.arange(0,25) max = -np.Inf min = np.Inf for res in ress: for mode in modes[0:2]: if i_MODE == 'SUM': vals = None for i_wall in i_walls: name = var+'_'+i_wall+'_'+res+mode obj = loadObj(folder,name) if res == '4' and Area is None: #print(obj) Area = obj['Area']*1E6 if vals is None: #vals = obj[var]/1E6 vals = obj[var]/Area*3600 else: #vals = vals + obj[var]/1E6 #if (i_wall == 'top') or (i_wall == 'bottom'): # vals = vals + obj[var]/Area*3600 #else: vals = vals + obj[var]/Area*3600 else: name = var+'_'+i_MODE+'_'+res+mode obj = loadObj(folder,name)
titleVar = 'WV Flux' unit = 'Fqv [1E9*kg/h]' # PREAPRE DATA FOR PLOTTING out = {} out['hrs'] = np.arange(0, 25) max = -np.Inf min = np.Inf for res in ress: for mode in modes[0:2]: # VERTICAL WALL vertVals = None for i_wall in i_walls: name = var + '_' + i_wall + '_' + res + mode obj = loadObj(wallFolder, name) if vertVals is None: vertVals = obj[var] / 1E9 * 3600 else: vertVals = vertVals + obj[var] / 1E9 * 3600 vals = vertVals # HORIZONTAL SLAB BELOW if 'slab1Folder' in locals(): name = var + '_' + res + mode obj = loadObj(slab1Folder, name) horVals = obj[var] / 1E9 * 3600 vals = vals + horVals # HORIZONTAL SLAB ABOVE