- 积分
- 147
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-9
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
map.py如下(打开nc文件):
#import vcs, cdms, cdutil, time, os, sys
#import cdms2 as cdms
import cdms2 as cdms,cdutil, numpy.oldnumeric.ma as MA, vcs,cdtime
import string, time, MV2 as MV, sys, os
from numpy.oldnumeric import*
import numpy as Numeric
from cdutil import*
import cdutil.continent_fill as continent_fill
import cdutil.worldmap as worldmap
from genutil import statistics
cdms.setAutoBounds('on')
filepath=os.path.join('tavg.01801.01.01.nc')
#filepath=os.path.join('test_GLODAP.nc')
cdmsfile=cdms.open(filepath)
data1=cdmsfile('A_sat',squeeze=1)
#data1=cdmsfile('pco2', time=1999, squeeze=1)
#data=data2-data1
#for i in range(100):
# for j in range(100):
# if(data2[i,j]==None or data1[i,j]==None):
# data[i,j]=0.0
#print data
v=vcs.init()
v.show('isofill')
#v.setcolormap('ASD')
v.setcolormap('rainbow')
#v.setcolormap('grn_to_magenta')
#v.setcolormap('bl_to_darkred')
cf_asd = v.getisofill('ASD')
cf_asd.list()
cf_asd.datawc_x1=1.8
cf_asd.datawc_x2 = 358.2
#cf_asd.datawc_x1=1.8
#cf_asd.datawc_x2 = 258.2
#cf_asd.datawc_y1 = -80
#cf_asd.datawc_y2 = 70
cf_asd.datawc_y1 = -89.1
cf_asd.datawc_y2 = 89.1
#cf_asd.level_1=-48
#cf_asd.level_2=-24
#cf_asd.color_1=6
#cf_asd.color_2=31
df_asd = v.createisoline( 'new' )
#df_asd.datawc_x1 =1.8
#df_asd.datawc_x2 = 358.2
#df_asd.datawc_y1 = 1000.
#df_asd.datawc_y2 = 0.
#v.setcolormap('ASD')
#df_asd = v.getboxfill('ASD')
#df_asd.level_1=-24
#df_asd.level_2=-9
#df_asd.color_1=31
#df_asd.color_2=112
#SST_2400_2500-1800
#cf_asd.levels=(-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12)
#cf_asd.fillareacolors= (120, 142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234)
#anthr_diccol_2500
#cf_asd.levels=(-1e+20,0,50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000,1050,1100,1150,1200,1e+20)
#cf_asd.fillareacolors= (247,6,15,24,33,42,51,60,69,78,87,96,105,114,123,132,141,150,159,168,177,186,195,204,213,222)
#df_asd.levels = (0,200,400,600,800,1000,1200)
#df_asd.linecolors=([241,241,241,241,241]) # change the line color
#df_asd.label='y'
co=continent_fill.Gcf()
co.name='default'
co.g_name='Gcf'
co.line='y'
co.line_width=1
co.line_color=241
co.fill='y'
co.fill_color=241
co.datawc_x1 = 1.8
co.datawc_x2 = 358.2
#co.datawc_x1 = 1.8
#co.datawc_x2 = 258.2
#co.datawc_y1 = -80
#co.datawc_y2 = 70
co.datawc_y1 = -89.1
co.datawc_y2 = 89.1
co.projection='linear'
v.clear()
v.plot(data1,cf_asd)
#v.plot(data1,df_asd)
co.plot(v)
v.postscript('A_sat.ps')
#v.clear()
#v.isofill(data3)
#v.postscript('sur_OmegaC_1809.ps')
#v.clear()
#v.isofill(data4)
#v.postscript('sur_co3_1809.ps')
|
|