- 积分
- 190
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 油炸灬泡面 于 2011-7-27 10:26 编辑
pro png
sourcepath='d:\file\'
Result = FILE_SEARCH(count=n_file, $
STRSPLIT(sourcepath, $
PATH_SEP(/SEARCH_PATH), $
/EXTRACT) +'\*.txt')
dataStructure = READ_ASCII(file)
dataArray = TRANSPOSE(dataStructure.field1)
x = dataArray[*, 0]
y = dataArray[*, 1]
data = dataArray[*, 2]
scaled = BYTSCL(data, TOP = !D.TABLE_SIZE - 4) + 1B
DEVICE, DECOMPOSED = 0
LOADCT, 38
GRID_INPUT, x, y, data, xSorted, ySorted, dataSorted
gridSize = [60, 60]
slope = (MAX(xSorted) - MIN(xSorted))/(gridSize[0] - 1)
intercept = MIN(xSorted)
xGrid = (slope*FINDGEN(gridSize[0])) + intercept
slope = (MAX(ySorted) - MIN(ySorted))/(gridSize[1] - 1)
intercept = MIN(ySorted)
yGrid = (slope*FINDGEN(gridSize[1])) + intercept
grid = GRIDDATA(xSorted, ySorted, dataSorted, $
DIMENSION = gridSize, METHOD = 'RadialBasisFunction')
WINDOW, 2
scaled = BYTSCL(grid, TOP = !D.TABLE_SIZE - 4) + 1B
CONTOUR, scaled, xGrid, YGrid, /XSTYLE, /YSTYLE, /FILL, $
LEVELS = BYTSCL(INDGEN(18), TOP = !D.TABLE_SIZE - 4) + 1B, $
C_COLORS = BYTSCL(INDGEN(18), TOP = !D.TABLE_SIZE - 4) + 1B, $
TITLE = 'the result', $
XTITLE = 'x', YTITLE = 'y'
end
代码中输入的txt文件是包含经纬度坐标和高程信息,内容显示
28.3297 116.3239 1.11
28.4022 116.3814 9.00
28.4508 116.7547 11.00
28.4783 116.4364 1.00
28.4925 116.2047 0.00
28.5261 116.0397 2.00
28.5219 116.6494 7.00
28.5397 116.4797 4.00
|
|