コード例 #1
0
ファイル: trends.py プロジェクト: sjl421/code-2
trends[3, ...] = trend(time[3 * n:-1], hpfilt4)

# smooth fields (sigma between 0.6-7)
print 'smoothing fields...'
trends = ap.gfilter2d(trends, 0.7)

# plot time series: (1,161), (2,161), (3,161)
if PLOT:
    plt.imshow(trends[3], origin='lower', interpolation='nearest')
    plt.show()
    sys.exit()

# regrid fields
print 'regridding fields...'
inc = 3
trends, xx, yy = ap.regrid2d(trends, lon, lat, inc_by=inc)

# create 3d coordinates of nodes (x,y,z)
xed = np.linspace(xed.min(), xed.max(), inc * len(lon) + 1)
yed = np.linspace(yed.min(), yed.max(), inc * len(lat) + 1)
xx, yy = np.meshgrid(xed, yed)
lon = xx.ravel()
lat = yy.ravel()
xyz = np.column_stack(ap.sph2xyz(lon, lat))

#---------------------------------------------------------------------
# save data
#---------------------------------------------------------------------

print 'saving data...'
ff = tb.openFile(DIR + 'elev.h5', 'a')
コード例 #2
0
    plt.show()
    sys.exit()

    plt.xlim(1992, 2012)
    plt.legend().draw_frame(False)
    #plt.ylabel('elevation (m)')
    #ap.intitle('(D) lon, lat = %.1f, %.1f' % (a, b), 4)
    #plt.savefig('totten_d2.png')
    plt.show()
    sys.exit()


# regrid fields
print 'regridding fields...'
inc = 3
hpfilt, xx, yy = ap.regrid2d(hpfilt.values, lon, lat, inc_by=inc)
hpfilt_grad, xx, yy = ap.regrid2d(hpfilt_grad.values, lon, lat, inc_by=inc)

# create 3d coordinates of nodes (x,y,z)
xed = np.linspace(xed.min(), xed.max(), inc * len(lon) + 1)
yed = np.linspace(yed.min(), yed.max(), inc * len(lat) + 1)
xx, yy = np.meshgrid(xed, yed)
lon = xx.ravel()
lat = yy.ravel()
xyz = np.column_stack(ap.sph2xyz(lon, lat))

#---------------------------------------------------------------------
# save data 
#---------------------------------------------------------------------

print 'saving data...'
コード例 #3
0
# smooth fields (sigma between 0.6-7)
print "smoothing fields..."
trends = ap.gfilter2d(trends, 0.7)


# plot time series: (1,161), (2,161), (3,161)
if PLOT:
    plt.imshow(trends[3], origin="lower", interpolation="nearest")
    plt.show()
    sys.exit()


# regrid fields
print "regridding fields..."
inc = 3
trends, xx, yy = ap.regrid2d(trends, lon, lat, inc_by=inc)

# create 3d coordinates of nodes (x,y,z)
xed = np.linspace(xed.min(), xed.max(), inc * len(lon) + 1)
yed = np.linspace(yed.min(), yed.max(), inc * len(lat) + 1)
xx, yy = np.meshgrid(xed, yed)
lon = xx.ravel()
lat = yy.ravel()
xyz = np.column_stack(ap.sph2xyz(lon, lat))

# ---------------------------------------------------------------------
# save data
# ---------------------------------------------------------------------

print "saving data..."
ff = tb.openFile(DIR + "elev.h5", "a")
コード例 #4
0
ファイル: fit_and_regrid.py プロジェクト: sjl421/code-2
    #plt.plot(time, annual[:,i,j], 'k', linewidth=2, label='h: annual')
    plt.show()
    sys.exit()

    plt.xlim(1992, 2012)
    plt.legend().draw_frame(False)
    #plt.ylabel('elevation (m)')
    #ap.intitle('(D) lon, lat = %.1f, %.1f' % (a, b), 4)
    #plt.savefig('totten_d2.png')
    plt.show()
    sys.exit()

# regrid fields
print 'regridding fields...'
inc = 3
hpfilt, xx, yy = ap.regrid2d(hpfilt.values, lon, lat, inc_by=inc)
hpfilt_grad, xx, yy = ap.regrid2d(hpfilt_grad.values, lon, lat, inc_by=inc)

# create 3d coordinates of nodes (x,y,z)
xed = np.linspace(xed.min(), xed.max(), inc * len(lon) + 1)
yed = np.linspace(yed.min(), yed.max(), inc * len(lat) + 1)
xx, yy = np.meshgrid(xed, yed)
lon = xx.ravel()
lat = yy.ravel()
xyz = np.column_stack(ap.sph2xyz(lon, lat))

#---------------------------------------------------------------------
# save data
#---------------------------------------------------------------------

print 'saving data...'