- 积分
- 55950
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 MeteoInfo 于 2018-9-12 09:25 编辑
Himawari卫星数据提供两种格式:netCDF和HSD数据(Himawari standard data),数据下载需要先在此网站注册:http://www.eorc.jaxa.jp/ptree/index.html,然后用提供的FTP下载数据。HSD数据是二进制数据,数据格式的详细描述见此文档:http://www.data.jma.go.jp/mscweb ... rs_guide_en_v12.pdf。这里示例读取HSD数据并绘图:
- import struct
- def read_h8(fn):
- #Read data header
- f = open(fn, 'rb')
- hlen = 0
- #1 Basic information block
- f.read(282)
- hlen += 282
- #2 Data information block
- f.read(5)
- ncol, = struct.unpack('<h', f.read(2))
- nrow, = struct.unpack('<h', f.read(2))
- f.read(41)
- hlen += 50
- #3 Projection information block
- #f.read(127)
- f.read(19)
- sx, = struct.unpack('<f', f.read(4))
- sy, = struct.unpack('<f', f.read(4))
- f.read(127 - 27)
- hlen += 127
- #4 Navigation information block
- f.read(139)
- hlen += 139
- #5 Calibration information block
- f.read(147)
- hlen += 147
- #6 Inter-calibration information block
- f.read(259)
- hlen += 259
- #7 Segment information block
- #f.read(47)
- f.read(3)
- tns, = struct.unpack('b', f.read(1))
- ssn, = struct.unpack('b', f.read(1))
- fln, = struct.unpack('<h', f.read(2))
- f.read(40)
- hlen += 47
- #8 Navigation correction information block
- f.read(1)
- blen, = struct.unpack('<h', f.read(2))
- f.read(blen - 3)
- hlen += blen
- #9 Observation time information block
- f.read(1)
- blen, = struct.unpack('<h', f.read(2))
- f.read(blen - 3)
- hlen += blen
- #10 Error information block
- f.read(1)
- blen, = struct.unpack('<h', f.read(2))
- f.read(blen - 3)
- hlen += blen
- #11 Spare block
- f.read(259)
- hlen += 259
-
- f.close()
- #Read data
- data = binread(fn, [nrow, ncol], 'short', skip=hlen)
- data = data.astype('float')
- data[data<0] = nan
- return data, ncol, nrow, fln
- #Read data files
- segments = range(1, 11)
- for segment in segments:
- fn = 'E:/Temp/himawari8/HS_H08_20170921_0410_B16_FLDK_R20_S%02i10.DAT' % segment
- print fn
- data1,ncol,nrow1,fln1 = read_h8(fn)
- if segment == segments[0]:
- data = data1
- fln = fln1
- nrow = nrow1
- else:
- data = concatenate([data, data1], axis=0)
- nrow += nrow1
- data = data[::-1,:]
- #Plot
- sx = -5500000
- sy = 5500000 - segments[-1] * 550 * 2000
- x = arange1(sx, ncol, 2000)
- y = arange1(sy, nrow, 2000)
- ax = axesm(proj='geos', lon_0=140.7, h=35785863, gridlabel=True, gridline=True, frameon=False)
- geoshow('country', edgecolor='b')
- cmap = 'MPL_gist_gray'
- levs = arange(800, 2001, 50)
- layer = imshowm(x, y, data, levs, cmap=cmap, proj=ax.proj)
- colorbar(layer, shrink=0.8)
|
|