コード例 #1
0
albcs = np.array(fkernel['albcs'])

fd1 = cdms2.open(os.path.join(data_dir, fdata1))
fd2 = cdms2.open(os.path.join(data_dir, fdata2))

hist1 = fd1['histogram']
hist1 = hist1[:, ::-1, :, :, :]
hist2 = fd2['histogram']
hist2 = hist2[:, ::-1, :, :, :]

lon = fd1['lon']

change = hist2 - hist1
[a, b, c, d, e] = change.shape
dpctau = MV2.masked_array(1e20 * np.ones((12, b, c, d, e), 'float64'))
for mm in xrange(12):
    mm_val = change[mm::12, :, :, :, :]
    dpctau[mm, :, :, :, :] = MV2.average(mm_val, 0)

tmp = dpctau.swapaxes(1, 2)
dpctau = tmp

f_albedo = 'albedo_clim_xalll_uacdg.nc'
falb = cdms2.open(os.path.join(data_dir, f_albedo))
albedo = np.array(falb['rsuscs'])

f_dtas = 'dtas_clim_glob_xalll_uacdg.nc'
fdtas = cdms2.open(os.path.join(data_dir, f_dtas))
dtas = fdtas['tas']
コード例 #2
0
albcs = np.array(fkernel['albcs'])

fd1 = cdms2.open(os.path.join(data_dir, fdata1))
fd2 = cdms2.open(os.path.join(data_dir, fdata2))

hist1 = fd1['histogram']
hist1 = hist1[:, ::-1, :, :, :]
hist2 = fd2['histogram']
hist2 = hist2[:, ::-1, :, :, :]

lon = fd1['lon']
e = len(lon)
print a, b, c, d, e
change = hist2 - hist1

dpctau = MV2.masked_array(1e20 * np.ones((12, b, c, d, e), 'float64'))
for mm in xrange(12):
    mm_val = change[mm::12, :, :, :, :]
    dpctau[mm, :, :, :, :] = MV2.average(mm_val, 0)
tmp = dpctau.swapaxes(1, 2)
dpctau = tmp

f_albedo = 'albedo_clim_xallf_xalua.nc'
falb = cdms2.open(os.path.join(data_dir, f_albedo))
albedo = np.array(falb['rsuscs'])

f_dtas = 'dtas_clim_glob_xallf_xalua.nc'
fdtas = cdms2.open(os.path.join(data_dir, f_dtas))
dtas = fdtas['tas']

LWkernel = np.ma.masked_invalid(LWkernel)