def climatology_shgt_slat(self, selhgt, sellat, time_mean): shgt = np.where(self.dimdict['hgt'] >= selhgt)[0][0] slat = np.where(self.dimdict['lat'] >= sellat)[0][0] # select variable at height and latitude var = self.var[:, shgt, slat] # climatological monthly mean var_tsub, nsubyrs = basic_functions.time_subset( var, self.time0, self.tim1, self.tim2) var_seas = basic_functions.seasonal_mean(var_tsub, nsubyrs, time_mean) var_clim_seas = var_seas.mean() print var_clim_seas.shape return var_clim_seas
def climatology_lon_lat(self, time_mean): # seasonal mean then average over climatological time period clim_var = np.zeros( [len(self.dimdict['lat']), len(self.dimdict['lon'])]) for ilat in range(len(self.dimdict['lat'])): for ilon in range(len(self.dimdict['lon'])): var_tsub, nsubyrs = basic_functions.time_subset( self.var[:, ilat, ilon], self.time0, self.tim1, self.tim2) var_seas = basic_functions.seasonal_mean( var_tsub, nsubyrs, time_mean) var_clim_seas = np.mean(var_seas, axis=0) clim_var[ilat, ilon] = var_clim_seas return clim_var
def climatology_polar_hgt_mon(self): # polar cap mean (70-90N) var_amean = np.zeros( [len(self.dimdict['tim']), len(self.dimdict['hgt'])]) for itim in range(len(self.dimdict['tim'])): for ihgt in range(len(self.dimdict['hgt'])): var_amean[itim, ihgt] = basic_functions.latitude_mean( self.var[itim, ihgt, :], self.dimdict['lat'], 70, 90) # climatological monthly mean clim_var = np.zeros([12, len(self.dimdict['hgt'])]) for ihgt in range(len(self.dimdict['hgt'])): var_tsub, nsubyrs = basic_functions.time_subset( var_amean[:, ihgt], self.time0, self.tim1, self.tim2) var_seas = basic_functions.seasonal_mean(var_tsub, nsubyrs, 'clim_monthly') clim_var[:, ihgt] = var_seas return clim_var