Exemplo n.º 1
0
lon = fin.root.lon[:]
lat = fin.root.lat[:]
d = fin.root.dh_mean_mixed_const_xcal[:]
#d = fin.root.dg_mean_xcal[:]
#e = fin.root.dh_error_xcal[:]
#d = fin.root.n_ad_xcal[:]
nz, ny, nx = d.shape
dt = ap.year2date(time)

if 1: # load area info
    df_temp = pd.read_csv('ice_shelf_area4.csv')
    df_area = df_temp['sampled_km2']
    df_area.index = df_temp['ice_shelf']

if 1:
    time, d = ap.time_filt(time, d, from_time=1994, to_time=2013)
    #time, e = time_filt(time, e, from_time=1992, to_time=20013)

# area-average
#---------------------------------------------------------------------

df = pd.DataFrame(index=time)
df2 = pd.DataFrame(index=time)
for k, s in zip(names, shelves):
    shelf, x, y = ap.get_subset(s, d, lon, lat)
    #error, x, y = ap.get_subset(s, e, lon, lat)
    A = ap.get_area_cells(shelf[10], x, y)
    ts, _ = ap.area_weighted_mean(shelf, A)
    #ts2, _ = ap.area_weighted_mean(error, A)
    df[k] = ts
    #df2[k] = ts2
Exemplo n.º 2
0
lon = fin.root.lon[:]
lat = fin.root.lat[:]
d = fin.root.dh_mean_mixed_const_xcal[:]
#d = fin.root.dg_mean_xcal[:]
#e = fin.root.dh_error_xcal[:]
#d = fin.root.n_ad_xcal[:]
nz, ny, nx = d.shape
dt = ap.year2date(time)

if 1:  # load area info
    df_temp = pd.read_csv('ice_shelf_area4.csv')
    df_area = df_temp['sampled_km2']
    df_area.index = df_temp['ice_shelf']

if 1:
    time, d = ap.time_filt(time, d, from_time=1994, to_time=2013)
    #time, e = time_filt(time, e, from_time=1992, to_time=20013)

# area-average
#---------------------------------------------------------------------

df = pd.DataFrame(index=time)
df2 = pd.DataFrame(index=time)
for k, s in zip(names, shelves):
    shelf, x, y = ap.get_subset(s, d, lon, lat)
    #error, x, y = ap.get_subset(s, e, lon, lat)
    A = ap.get_area_cells(shelf[10], x, y)
    ts, _ = ap.area_weighted_mean(shelf, A)
    #ts2, _ = ap.area_weighted_mean(error, A)
    df[k] = ts
    #df2[k] = ts2
Exemplo n.º 3
0
print('done')

if 0: # (for testing only) subset
    print lon.shape, lat.shape, data.shape
    i, j = ap.where_isnan('Totten', lon, lat)
    data[:,i,j] = np.nan
    '''
    plt.imshow(data[10], origin='lower', interpolation='nearest', 
               extent=(lon.min(), lon.max(), lat.min(), lat.max()), 
               aspect='auto')
    plt.show()
    exit()
    '''

if 1: # (yes) filter time
    _, data = ap.time_filt(time, data, from_time=1994, to_time=2013)
    time, error = ap.time_filt(time, error, from_time=1994, to_time=2013)

dt = ap.year2date(time)

# remove bad grid cells (visual inspection)
if 1:
    ii, jj = ap.find_nearest2(xx, yy, lonlat)
    k = 0
    for i, j in zip(ii, jj):
        print k, lonlat[k]
        '''
        plt.plot(time, data[:,i,j])
        plt.show()
        '''
        data[:,i,j] = np.nan