- 积分
- 55965
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 MeteoInfo 于 2018-12-18 22:18 编辑
示例读取和绘制NSIDC的IMS冰雪数据(ASCII格式,24km分辨率):
- #Data source: https://nsidc.org/data/g02156#ascii
- print 'Read data...'
- fn = 'D:/Temp/ascii/ims1997035_24km_v1.1.asc'
- f = open(fn)
- data = zeros(1024 * 1024, dtype='int')
- li = 0
- ii = 0
- for line in f.read().splitlines():
- if li < 30: #Head lines
- print line
- else: #Data
- for d in line:
- data[ii] = int(d)
- ii += 1
- li += 1
- f.close()
- data = data.reshape([1024,1024])
- #Set x, y
- dx = 23684.997
- x = arange1(-12126597.0+dx/2, 1024, dx)
- y = arange1(-12126840.0+dx/2, 1024, dx)
- #Plot
- print 'Plot...'
- proj = projinfo(proj='stere', lat_0=90, lon_0=-80, lat_ts=60)
- axesm(projinfo=proj, frameon=False, griddx=30, griddy=30, gridline=True)
- geoshow('country', edgecolor='k')
- cols = makecolors(5)
- cols[0] = 'w'
- layer = imshowm(x, y, data, colors=cols, proj=proj)
- colorbar(layer, ticklabels=['None','Sea','Land','Snow','Sea ice'])
|
|