如何在grads中对格点数据四点求平均

作者&投稿:吕固 (若有异议请与网页底部的电邮联系)
grads中如何实现5点滑动平均~

:一、算术平均滤波法算术平均滤波法是指对一点数据连续采n个值,然后取其平均值。这种方法能够滤除一般的随机干扰信号,使信号变的平滑,但当n值较大时,灵敏度会降低,故n值要视具体情况进行选龋一般情况下取3~5平均即可。

cygwin1.dll,wgrib,wgrib2,grib2ctl,g2ctl首先先下载这些之后可以破解grib1,grib2文件,之后 使用命令grib2ctl.exe *.grib2>*.ctl即可创建描述文件,之后要创建idx文件!将ctl文件复制到grads文件下,之后使用命令gribmap.exe *.ctl>b.txt即可创建idx文件

reset是一个命令啊,怎么能说函数。oacres是站点插值函数。我说的是可以改变格点资料分辨率的re()函数。它的具体解释在grads安装完的OpenGrADS\Contents\Resources\Documentation\opengrads\doc\udxt文件夹里
NAME

re.gex - A 2D regridding function for GrADS

SYNOPSIS

Short-hand

re(expr,dlon), while dlon=dlat

re(expr,dlon,dlat,['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]

re(expr,dlon,gYY,['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]

Linear Y-mapping

re(expr,nx,'linear',lon,dlon,ny,'linear',lat,dlat, ['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]

Gaussian Y-mapping

re(expr,nx,'linear',lon,dlon,ny,'gaus',gstart,njog, ['ig',nyig],['ba'|'bl'|'bs'|'vt',vtmax,vtmin|'ma',min]

DESCRIPTION

The regrid function re solves a common problem of transforming horizontal 2-D gridded fields from/to different resolutions/grid types for quantitative intercomparison. For example, a model monthly mean precipitation field on a T126 gaussian grid can be compared to an observed climatology on a 2.5x2.5 grid using re. The function re offers many transform options ranging from simple bilinear interpolation to box averaging with voting. Additional methods can be added to re as needed.

re transforms two-dimensional (2-D) lat/lon GrADS grids from one grid type/resolution to another. The input is any 2-D lat/lon grid defined by the current GrADS lat/lon dimension environment. re handles input grids which are cyclically continuous in longitude and excludes undefined input grid values from participation in the transform. If a valid transform cannot be made (i.e., insufficient defined data points), the output grid is set to undefined. re supports two output grid types: 1) lat/lon with fixed increments; and 2) gaussian. Four transforms are available: 1) box averaging for regridding fine to coarse grids; 2) box averaging with ``voting'' for noncontinuous/index data such, as soil type; 3) bilinear interpolation; and 4) 4-point bessel interpolation.

REQUIRED PARAMETERS

expr:
Any valid GrADS grid expression (e.g., z or ave(z.3(t+0,t=120,1yr)), real number, 'undef' or '-u'.

nx:
The number of points in longitude (integer)

lon:
Beginning longitude (center of the lower left hand corner grid or the grid (1,1)) of the output domain (float)

dlon:
Delta longitude (dlon) or number of gaussian longitudes on the GLOBE (float)

ny:
The number of points in latitude (integer)

lat:
Beginning latitude (center of the lower left hand corner grid or the grid (1,1)) of the output domain (float)

dlat:
Delta latitude (dlat) or the number of gaussian latitudes on the GLOBE (float)

gstart:
The first gaussian grid number. If the data span all latitudes, start would be 1, indicating the southernmost gaussian grid latitude (integer)

njog:
The number of GLOBAL gaussian latitudes on the output grid. (integer)

'linear':
Linear mapping (string)

'gaus':
Gaussian latitide mapping (string)

Note:
All strings are CASE INSENSITIVE.

OPTIONAL PARAMETERS

Input Gaussian Grid:

'ig', nyig:
Input grid is gaussian with nyig being the number of gaussian latitudes (e.g., ig92 for the NMC T62 grid). nyig must be >= 8 and a multiple of four. This parameter is used to invoke a more precise calculation of the boundary between gaussian grid boxes.

Interpolation Method:

'ba'
Box averaging (the default, while regrids to coarse resoultion)

'bl':
Bi-linear interpolation (the default, when regridding to a finer resolution)

'bs':
3rd order Bessel interpolation

'vt', vtmax, vtmin:
Vote interpolation or box averaging with voting. The parameters (vtmax,vtmin) (range: [0-1]) set the fraction of an output grid box that must be covered by defined input grid data for a ``winner'' to be chosen in the election. The default is vtmax=vtmin=1/2.

The parameter vtmin must be the same as vtmax except for three or more candidates. The fraction for two candidates is midway between vtmax and vtmin.

When there is only one candidate, vtmax is the minimum fraction of an output grid point hat must be covered by defined input grid data for a ``winner'' to be chosen in the election.

Specifying vtmax = vtmin = 1 would require that 100% of the output grid box must be covered by a single, unique value from the input grid whereas vtmax = vtmin = 0 would allow a winner to be chosen if ANY candidates where running. The default value of 0.5 means that a simple majority is required to have a winner.

'ma', fraction:
This option applies ONLY to box averaging without voting when the input grid has undefined points. The parameter fraction (range: [0-1]) specifies the minimum area which must be covered with DEFINED data boxes to be considered a valid interpolation. The old regrid v1.0 assumed fraction was 0 or that if ANY input grid boxes contained defined data which intersected the output grid produced a box average. This was clearly too liberal and fraction is now set by default to 50% or that half the output grid box must be covered with defined data to produced a defined output grid point.

EXAMPLES

)
Regrid a global T62 gaussian grid (192x94) to a 2.5 deg lat/lon by box averaging,

open /reanl1/pilot20/fluxgrb8508.ctl
set x 1 192
set y 1 94
define p25=re(p,144,linear,0,2.5,72,linear,-88.75,2.5,ba)
or set lon 0 360 set lat -90 90 define p25=re(p,2.5,2.5,ba)

or more simply,

define p25=re(p,2.5)
Note: The lat/lon dimension environment is set using grid coordinates (x,y) to make the input and output grids global. To minimize future graphics/analysis calculations with the regridded field, we use the GrADS define function to store the grid in memory where it can be referenced as any other GrADS grid.

)
Regrid a 4x5 SiB vegetation type to a R15 (48x40) gaussian grid using box averaging with ``voting.'' Require that at least 60% of the output grid box must be covered with a single candidate value from the input grid for an election to occur. Otherwise the output grid box is set to undefined. Relax the one-candidate election requirement to 20% when there are three or more candidates,

open /export/sgi18/fiorino/data/sib/sib.param.annual.ctl
set lon 0 360
set lat -90 90
define i21=re(index,48,linear,0,7.5,40,gaus,1,40,vt,0.60,0.20)
set gxout grfill
d index
d i21
Note : During candidate selection, undefined input grid points do not contribute to the fraction of the output grid box covered with input grid boxes. The best way to display index type data in GrADS is to use the ``grid fill'' display option (set gxout grfill). GrADS will draw the grid box and color it according to the grid value.

)
Regrid 1x1 Aviation run 500 mb z to 2.5x2.5 grid for the region (-140, 20) to (-40, 70) using bessel interpolation,

open /export/sgi39/wd22sl/grads/avn/avn.93092800.fcst.ctl
set lev 500
set lat -180 180
set lon -90 90
d re(z,40,linear,-138.75,2.5,20,linear,21.25,2.5,bs)
or

set lat 20 70
set lon -140 -40
d re(z,40,linear,-138.75,2.5,20,linear,21.25,2.5,bs)
or

d re(z,2.5,2.5,bs)
Note: The above three regrid commands produce exactly the same results. Box averaging would be more appropriate when regridding to a coarser grid.

)
Regrid 1x1 Aviation run 500 mb z to 2.5x2.5 grid using box averaging and setting the grid to start at a specific lat/lon,

open /export/sgi39/wd22sl/grads/avn/avn.93092800.fcst.ctl
set lev 500
set lat -20 70
set lon -140 -40
d re(z,40,linear,-138.75,2.5,20,linear,21.25,2.5,ba)
set lat 30 50
set lon -50 50
d re(z,40,linear,-138.75,2.5,20,linear,21.25,2.5,ba)
Note: The above two regrids produce DIFFERENT results since the input domain does not cover the entire output domain. Missing values will be filled for the uncovered regions.

dset d:\20u.nc
title
undef -9999
dtype netcdf
xdef 140 linear
110.125 0.25
ydef 100 linear 5.125 0.25
zdef 1 linear 0 1
tdef 1 linear
00Z20JUL2006 1mn
vars 1
ua 0 t,y,x u wind component m/s ascending
pass
endvars
这是数据的ctl文件,想针对经纬度4个点求一个平均值。将经纬度放在整数的格点上。不知用循环求平均可不可以。
之前在论坛上搜到了针对经纬度做循环的帖子,说是先循环时间t,然后z,但这个t和z都只有一层,具体到x和y方向上就不知怎么做了。还请教各位前辈,多谢。
用以下类似这种的循环,将循环转到x,y方向上,再用aave求个平均值可以实现吗?
t=1
while(t<=1911)
'set
t 't
'set z 1'
'd sst'
t=t+1
endwhile

拿尺子量量,然后除以四就是了


元谋县17561915896: grads的格点资料怎么配置? -
璩明丹参: Grads(Grid Analysis and Display System)是一套应用广泛、使用方便的科学数据绘图软件包,是当今国内外气象科研领域通用的标准图形环境之一.Grads并不是直接使用“数据文件”,而是通过“描述文件”间接使用“数据文件”,在将数据集转化成相应Grads格式的数据集时,通常的做法是先用Fortran语言或C语言编写专门的转化程序将数据集按照Grads的格式写成数据描述文件和二进制的数据集.dat文件,然后再启动Grads系统进行绘图和分析.其缺点在于进行数据转化和分析时要来回进行环境切换,而且,还要求操作人员必须熟悉Fortran语言或C语言编程

元谋县17561915896: grads vint函数求助 -
璩明丹参: 转】 GrADS 的函数分两类, 一类是对格点/站点数据执行运算的,这一类我们姑且称之为分析函数; 另一类是脚本编程(gs)时使用的, 这后一类我们姑且称之为脚本函数. 第一类分析函数又分为格点分析和站点分析两个子类: 1) 格点分析 ...

元谋县17561915896: 能不能用简单的方法说明什么是四分位点(就是Q1,Q2,Q3)?在一组数据中怎么求Q1,Q2,Q3?书上说什么Q1,Q2,Q3分别位于25%,50%,我看不懂啊?还有... -
璩明丹参:[答案] 比方说有一组数(11个) 按照从小到大的顺序排列: 1,3,4,6,7,9,12,15,16,18,20 Q1的位置 = (11+1)/4=3,也就是在这组数中排列在第三个位置上的数,即Q1=4 Q2的位置 = 2*(11+1)/4=6,.6个位置上的数 即Q2=9 Q3的位置 = 3*(11+1)/4=8,.9个位置...

元谋县17561915896: 在11乘11的方格纸内取A,B,C,D四个格点,使AB=BC=2CD=4.在如图方格内取A,B,C,D四个格点,使AB=BC=2CD=4.P是线段BC上的动点,连结AP,DP.(1) ... -
璩明丹参:[答案] 图形结合很重要,我还没做第二问时,感觉第一问用勾股定理就可以解决,但是看第二问时发现题目有问题,p应该是在BC所在的直线上,而不是线段,否则a≠21/2.若是在线段上,就会有最小值.最小值K=2√6 此时BDC在同一条线上,且D与P重合....

元谋县17561915896: 请问,已知X,Y.Z三个列向量(就是拟合曲面的原始数据),如何用gradient求这个曲面的极值呢?
璩明丹参: <p>您实际上提了两个问题.我只回答第二个,也是您强调的:已知整齐格点采样的三维曲面,求曲面的极值.其中整齐格点是指在x和y方向都是均匀采样的.具体说来,问题的输入就是一个二维矩阵V,(具体的自变量取值先暂时搁置.)</p> <p>如果是要最值,只需要用max(V)或min(V) </p><p>如果要找梯度为0的点,用gradient:(Fx, Fy) = gradient(V);其中Fx是x方向偏导数,Fy是y方向偏导数,G = hypot(Fx, Fy) 就可以得到梯度场的模.[pm, pn] = find(G&lt;1e-3) 可以找到G小于某个阈值(1e-3)的点的位置. </p>

元谋县17561915896: 曲线中对应点如何计算?这样一题:x=sint,y=cos2t 求曲线在t=π/4处对应的点的切线方程.答案上只说一句t=π/4的对应点是(1/2根号2,0),但我不知道这是怎... -
璩明丹参:[答案] t=π/4时, x=sint=sinπ/4=√2/2, y=cos2t=cos(2*π/4)=cos(π/2)=0, 所以,对应点(x,y)=(√2/2,0).

元谋县17561915896: GrADS都可以在什么操作系统下运行? -
璩明丹参: XP/WIN7都能 GrADS(Grid Analysis and Display System)是当今气象界广泛使用的一种数据处理和显示软件系统.该软件系统通过其集成环境,可以对气象数据进行读取、加工、图形显示和打印输出.它在进行数据处理时,所有数据在GrADS中...

元谋县17561915896: 怎样用MATLAB去除格点中的异常数据? -
璩明丹参: 争议首先要根据一定标准检出这些格点,然后删除=[]或者NAN再看看别人怎么说的.

元谋县17561915896: 如图,在Rt△AOB中,∠ABO=90°,OB=4,AB=8,且反比例函数y=kx在第一象限内的图象分别交OA、AB于点C和点D,连结OD,若S△BOD=4,(1)求反比例函... -
璩明丹参:[答案] (1)∵S△BOD= 1 2k, ∴ 1 2k=4,解得k=8, ∴反比例函数解析式为y= 8 x; (2)设直线OA的解析式为y=ax,把A(4,8)代入得4a=8,解得a=2, 所以直线OA的解析式为y=2x, 解方程组 y=2xy=8x得 x=2y=4或 x=−2y=−4, 所以C点坐标为(2,4).

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网