找回密码
 注册
查看: 829|回复: 0

R语言 RNCEP包 NCEP.interp()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-27 19:38:42 | 显示全部楼层 |阅读模式
NCEP.interp(RNCEP)
NCEP.interp()所属R语言包:RNCEP

                                         Interpolates Weather Data to a point in space and time
                                         气象数据插值到一个点在空间和时间

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This function queries a weather variable via the Internet from the NCEP/NCAR Reanalysis or NCEP/DOE Reanalysis II datasets and subsequently calculates values at desired locations in space and time by interpolation.
此功能通过互联网从NCEP / NCAR再分析NCEP / DOE再分析II数据集查询天气变量,随后在需要的位置在空间和时间通过插值计算。


用法----------Usage----------


    interpolate.space = TRUE, interpolate.time = TRUE,
    keep.unpacking.info = FALSE, return.units = TRUE,
    interp = 'linear', p = 1, status.bar=TRUE)

## NCEP.interp is a wrapper function that calls one of the
## following functions based on the value of level.
## Users should avoid using these functions directly.

NCEP.interp.gaussian(variable, lat, lon, dt, reanalysis2 = FALSE,
    interpolate.space = TRUE, interpolate.time = TRUE,
    keep.unpacking.info = FALSE, return.units = TRUE,
    interp = 'linear', p = 1, status.bar=TRUE)
NCEP.interp.pressure(variable, lat, lon, dt, pressure,
    reanalysis2 = FALSE, interpolate.space = TRUE,
    interpolate.time = TRUE, keep.unpacking.info = FALSE,
    return.units = TRUE, interp = 'linear', p = 1, status.bar=TRUE)
NCEP.interp.surface(variable, lat, lon, dt, reanalysis2 = FALSE,
    interpolate.space = TRUE, interpolate.time = TRUE,
    keep.unpacking.info = FALSE, return.units = TRUE,
    interp = 'linear', p = 1, status.bar=TRUE)



参数----------Arguments----------

参数:variable
Character. The name of the weather variable to be obtained.  See "Variable Naming Conventions" below for possible variable names.  
字符。以下方式获得的天气变量的名称。请参阅“变量命名约定”,以下为可能的变量名。


参数:level
A numeric pressure level or one of either "gaussian" or "surface". See "Details".  
一个数字压力水平的“高斯”或“面”。请参阅“详细信息”。


参数:lat
Numeric.  The latitude to which the weather variable should be interpolated.  
数字。纬度的天气变量应插。


参数:lon
Numeric.  The longitude to which the weather variable should be interpolated.  
数字。天气变量的经度应插。


参数:dt
Character.  The datetime (specified in UTC) to which the weather variable should be interpolated.  Must use the format "%Y-%m-%d %H:%M:%S".  
字符。日期时间(UTC)天气变量应插。一定的格式"%Y-%m-%d %H:%M:%S"。


参数:reanalysis2
Logical. Should the data be obtained from the Reanalysis II dataset or from Reanalysis I(default)?  
逻辑。获得的数据再分析数据集或再分析I(默认)?


参数:interpolate.space
Logical.  Should interpolation be done in space?  
逻辑。应该插在空间吗?


参数:interpolate.time
Logical.  Should interpolation be done in time?  
逻辑。如果插的时间?


参数:keep.unpacking.info
Logical.  Should the information needed to unpack the data be used for all queries in the function call?  
逻辑。应该解压缩数据,可用于函数调用中的所有查询所需要的信息呢?


参数:return.units
Logical. Should the units of the variable being obtained be printed after the query finishes?  
逻辑。应变量的单位获得被打印后的查询完成?


参数:interp
Method of interpolation.  One of 'linear' (default) or 'IDW'.  See "Details".   
插值方法。其中的“线性”(默认)或“IDW”。请参阅“详细信息”。


参数:p
A positive real number. The power parameter controlling interpolation. Only matters when interp is 'IDW'. See "Details".   
一个正实数。功率参数控制插补。只有重要的interp是“IDW”。请参阅“详细信息”。


参数:pressure
Numeric.  A pressure level in millibars that is assigned automatically from the value of level when needed.      
数字。一个压力水平毫巴,是自动分配的价值level在需要的时候。


参数:status.bar
Logical.  Should a status bar be shown indicating the percentage of completion?  
逻辑。如果状态栏显示完成的百分比?


Details

详细信息----------Details----------

NCEP.interp is a wrapper function that applies one of NCEP.interp.gaussian,<br> NCEP.interp.pressure, or NCEP.interp.surface depending on the value of level.
NCEP.interp是一个包装函数适用NCEP.interp.gaussian,参考NCEP.interp.pressure,或NCEP.interp.surface的价值level根据。

level must specify one of either "gaussian" or "surface" or give a numerical pressure level in millibars.  Numeric pressure levels must be one of 1000, 925, 850, 700, 600, 500, 400, 300, 250, 200, 150, 100, 70, 50, 30, 20, 10. See "Variable Naming Conventions" below to determine if your variable of interest is stored relative to the surface, a pressure level, or a T62 Gaussian grid. Note that variables on a T62 Gaussian grid are evenly spaced in longitude but unevenly spaced in latitude while variables from either the surface or a particular pressure level are evenly spaced in both latitude and longitude (2.5 deg. x 2.5 deg.).
level必须指定的“高斯”或“面”的数字压力毫巴。数字压力等级必须为1000,925,850,700,600,500,400,300,250,200,150,100,70,50,30,20,10。请参阅“变量命名约定”,以确定是否与您感兴趣的变量存储的相对的表面,压力水平,或T62高斯电网的。注意T62高斯网格上的变量被均匀地间隔开的经度,但不均匀间隔的纬度而从任一表面或一个特定的压力水平的变量在经度和纬度间隔均匀(2.5度×2.5°)。

All arguments except keep.unpacking.info, return.units, and status.bar can be vectors.  The remaining arguments are recycled to the length of the longest arguement.
所有参数,除了keep.unpacking.info,return.units和status.bar的可以是向量。余下的参数被再循环的长度最长arguement。

lat and lon should be given in decimal degrees.  Latitudes south of the equator should be negative.  Longitudes west of the Prime Meridian can be specified using either positive (i.e. 350) or negative (i.e. -10) notation.
lat和lon应以十进制度。纬度在赤道以南应该是否定的。可以指定经度的本初子午线以西,无论是正面的(如350)或负(即-10)的符号。

All interpolation is performed assuming a spherical (rather than a planar) grid.
所有的插值进行假设球形网格(而不是一个平面)。

When interp is 'IDW', 2-D spatial interpolation is done using inverse distance weighting followed by a 1-D linear interpolation in time. When interp is 'linear', the function performs a trilinear interpolation in latitude, longitude, and time. If interpolate.space or<br> interpolate.time is FALSE, the function performs "nearest neighbor" interpolation and returns data from the grid point closest in space or time, respectively. The numerical value of p controls the degree of smoothing in the interpolation only when interp is 'IDW'.  Greater values of p assign greater influence to values closest to the interpolated point. For 0 < p < 1 peaks over the interpolated point remain smooth.  As p increases beyond 1, the peaks become sharper.
当interp是IDW,后跟一个1-D在时间上的线性内插的反距离加权是通过使用2-D空间插值。当interp是“线性”,在经度,纬度,时间和功能进行三线性插值。如果interpolate.space或参考interpolate.time是FALSE,函数执行的最近邻插值和返回数据的网格点,分别在空间或时间上最接近。的数值p控制只有当interp是IDW在插补的平滑程度。大值p分配最靠近插值点的值更大的影响力。对于0 <p <1峰在插点保持平稳。 p增加超过1,峰变得更清晰。

Variables in these datasets on a T62 Gaussian grid describe conditions over an interval of time rather than at a particular point in time. (see "Variable Naming Conventions" below) As such, it is not appropriate to perform temporal interpolation on these varaibles. Therefore, NCEP.interp automatically sets interpolate.time to FALSE when querying one of these variables,  and returns the data corresponding to the interval within which the specified datetime falls.   Spatial interpolation is still performed as long as interpolate.space is TRUE.
在这些数据集的变量在T62高斯电网的描述条件的时间间隔,而不是在一个特定的时间点。 (见下面的变量命名约定“),因此,它是不适合执行这些varaibles的时间内插。因此,NCEP.interp自动设置interpolate.timeFALSE查询时,这些变量中的一个,并返回相应的时间内,在指定的日期时间的数据。空间插值仍然是只要interpolate.space是TRUE。

Unpacking information is unique to each variable and dataset.  Therefore,<br> keep.unpacking.info can be made TRUE as long as only one variable from one dataset (i.e. Reanalysis I or II) is queried in a single function call, even for multiple times and locations.  keep.unpacking.info will be made FALSE, if necessary, with a warning.
打开包装信息是唯一的每个变量和数据集。因此,可以参考keep.unpacking.info TRUE只要从一个数据集只有一个变量(即再分析I或II)在一个单一的函数调用,即使多的时间和地点查询。 “”keep.unpacking.info将FALSE,如果必要的话,一个警告。

The function will run faster when keep.unpacking.info is TRUE.
该函数将运行得更快,当keep.unpacking.info是TRUE。

The robust alternative to NCEP.interp is applied automatically.  These robust functions are applied when interpolation requires data from two different years or from both sides of the Prime Meridian.
强大的替代NCEP.interp自动应用。这些强大的功能应用,插补时,需要从两个不同年份的数据,或从双方的本初子午线。

Some variables are not in both the Reanalysis I and II datasets.  If a variable is chosen that is not in the specified dataset, the other dataset will be used... with a warning.
一些变量是不是再分析I和II的数据集。如果选择一个变量,是不是在指定的数据集,数据集将用于...一个警告。

The function also returns, as an attribute, standard deviation calculated on all data used in the interpolation.   This provides an indication of the precision of an interpolated result described in the same units as the interpolated variable. Smaller values indicate that there is less variability among the points used in interpolation. Standard deviation is only calcuated on the points used in the interpolation.  Therefore, if interpolate.time and interpolate.space are both TRUE,  standard deviation is calculated on eight points.<br> If interpolate.time is FALSE and interpolate.space is TRUE, standard deviation is calculated on four points. If interpolate.time is TRUE and interpolate.space is FALSE, standard deviation is calculated on only two points.  If interpolate.time and interpolate.space are both FALSE, standard deviation is not calculated and NA is returned. This measure of precision is the same irrespective of interp.
该函数还返回,作为内插中使用的所有数据上的属性,计算出的标准偏差。这提供了一个指示作为插值变量中描述的相同的单元的内插结果的精度。较小的值表示,有较少的用于内插的点的变异性。标准偏差仅calcuated内插中使用的点。所以,如果interpolate.time和interpolate.space都TRUE,标准差的计算方法上的八个点。<BR>如果interpolate.time是FALSE和interpolate.space TRUE,标准差的计算方法谈四点看法。 interpolate.time如果是TRUE和interpolate.space是FALSE,标准偏差的计算上只有两个点。如果interpolate.time和interpolate.space都FALSE,标准偏差不计算NA返回。这项措施的精确度是相同的,不论interp。

Note that the status bar may be hidden behind an active R window.
需要注意的是,背后可能隐藏着活性R窗口的状态栏。

variable must be specified using one of the names found in the section "Variable Naming Conventions" below...
“variable必须指定使用一个发现”一节中的变量命名约定“下面的名字...


值----------Value----------

A vector of interpolated results with the associated standard deviation of the points used to perform the interpolation as an attribute.
插值结果的一种向量,用于执行作为一个属性内插的点,与相关联的标准偏差。

Optionally, the units of the variable being queried are printed when the function completes.
任选地,所述的变量的单位被查询的功能完成时,被打印。


变量命名约定----------Variable Naming Conventions----------

VARIABLES IN REFERENCE TO A PARTICULAR PRESSURE LEVEL
参考特定的压力水平的变量

Air Temperature
气温

Geopotential Height
位势高度场

Relative Humidity
相对湿度

Specific Humidity
比湿

Omega [Vertical Velocity]
欧米茄垂直速度]

U-Wind Component [East/West]
U-风组件[东/西]

V-Wind Component [North/South]
V-风组件[北/南]

VARIABLES IN REFERENCE TO THE SURFACE
变量的表面

Air Temperature
气温

Surface Lifted Index
表面抬升指数

Best (4-layer) Lifted Index
(4层)抬升指数

Omega [Vertical Velocity]
欧米茄垂直速度]

Potential Temperature
位温

Precipitable Water
降水量的

Pressure
压力

Relative Humidity
相对湿度

Sea Level Pressure
海平面气压

Mean Sea Level Pressure
平均海平面气压

U-Wind Component [East/West]
U-风组件[东/西]

V-Wind Component [North/South]
V-风组件[北/南]

VARIABLES IN REFERENCE TO A T62 GAUSSIAN GRID
参考一个T62高斯电网中的变量

&mdash;&ndash; These variables are forecasts valid 6 hours after the reference time &mdash;&ndash;
- 这些变量的预测是有效的参考时间6小时后 -

&mdash;&ndash; These variables are 6 hour hindcasts from the reference time &mdash;&ndash;
- 从基准时间,这些变量是6小时的后报 -

&mdash;&ndash; These variables are 6 hour averages starting at the reference time &mdash;&ndash;
- 这些变量在统计时点开始的6小时平均 -

&mdash;&ndash; These variables are 6 hour averages starting at the reference time &mdash;&ndash;
- 这些变量在统计时点开始的6小时平均 -


(作者)----------Author(s)----------


Michael U. Kemp <a href="mailto:M.U.Kemp@UvA.nl">M.U.Kemp@UvA.nl</a>



参考文献----------References----------


(2011). RNCEP: global weather and climate data at your fingertips. Methods in Ecology and Evolution, DOI:10.1111/j.2041-210X.2011.00138.x.

Amer. Meteor. Soc., 77, 437-470

Amer. Meteor. Soc., 83, 1631-1643
including text such as, &ldquo;NCEP Reanalysis data provided by the NOAA/OAR/ESRL PSD, Boulder, Colorado, USA, from their Web site at

实例----------Examples----------


## Not run: [#不运行:]
library(RNCEP)
###############################################################[################################################## ############]
###############################################################[################################################## ############]
## The function can be applied to interpolate a single variable [#该函数可以被施加到内插单个变量]
## to a single point in space and time ##[###在空间和时间到一个单点]
## Interpolate temperature from the 850 mb pressure level ##[850 MB的压力水平###插补温度]
wx.interp <- NCEP.interp(variable='air', level=850, lat=55.1,
    lon=11.3, dt='2006-10-12 17:23:12',
    interp='linear')

## Interpolate precipitable water (for the entire atmosphere, but[#插降水量(整个的气氛,但]
## described in reference to the surface)[#中描述的表面的引用)]
wx.interp <- NCEP.interp(variable='pr_wtr.eatm', level='surface',
    lat=55.1, lon=11.3, dt='2006-10-12 17:23:12',
    interp='linear')

## Interpolate specific humidity (at the surface, but in [#插值特定湿度(在表面上,但在]
## reference to a T62 Gaussian grid) using the IDW interpolation[#参考一个T62高斯电网)使用IDW插值]
wx.interp <- NCEP.interp(variable='shum.2m', level='gaussian',
    lat=55.1, lon=11.3, dt='2006-10-12 17:23:12',
    interp='IDW', p=1)

###################################################################[################################################## ################]
###################################################################        [################################################## ################]
## The function can also be applied to interpolate several variables,[#功能也可以被施加到内插几个变量,]
## locations, datetimes, and/or methods of interpolation in a single[#位置,日期时间,和/或内插的方法,在一个单一的]
## function call ##[###函数调用]
## Interpolate temperature from the 850 and 700 mb pressure levels ## [从850和700 MB的压力水平###插值温度]
## for the same time and location ##[在相同的时间和位置,###]
wx.interp <- NCEP.interp(variable='air', level=c(850,700), lat=55.1,
    lon=11.3, dt='2006-10-12 17:23:12',
    interp='linear')

## Interpolate temperature and relative humidity from the 1000 mb [从1000 MB#插值温度和相对湿度]
## pressure level ##[压力水平##]
wx.interp <- NCEP.interp(variable=c('air','rhum'), level=1000,
    lat=55.1, lon=11.3, dt='2006-10-12 17:23:12', interp='linear')

## Interpolate temperature and relative humidity [#插值温度和相对湿度]
## from the 1000 and 700 mb pressure levels, respectively[#1000和700 MB的压力水平,分别]
## for the same datetime ##[相同的DateTime###]
wx.interp <- NCEP.interp(variable=c('air','rhum'),
    level=c(1000,700), lat=55.1, lon=11.3,
    dt='2006-10-12 17:23:12', interp='linear')

## Interpolate temperature and relative humidity [#插值温度和相对湿度]
## from the 1000 and 700 mb pressure levels, respectively[#1000和700 MB的压力水平,分别]
## for different datetimes ##[不同的日期时间###]
wx.interp <- NCEP.interp(variable=c('air','rhum'), level=c(1000,700), lat=55.1,
    lon=11.3, dt=c('2006-10-12 17:23:12', '2006-10-12 18:05:31'),
    interp='linear')
       
## Interpolate geopotential height using 'linear', 'IDW', and [#插位势高度使用“线性”,“IDW”,并]
## 'nearest neighbor' interpolation ##[###“最近的邻居”插]
wx.interp <- NCEP.interp(variable='hgt', level=700, lat=55.1,
    lon=11.3, dt='2006-10-12 17:23:12',
    interp=c('linear','IDW','IDW'),
    interpolate.space=c(TRUE,TRUE,FALSE))

###############################################################[################################################## ############]
###############################################################[################################################## ############]
## Alternatively the function can be applied to interpolate a[#另外,功能可以应用于插入一]
## weather variable to multiple datetime and point locations[#渡过变量的多个日期时间和点的位置。]
## in a single function call ##  [#在一个函数中调用##]

## In this example, we use datetime and locational data obtained [#在这个例子中,我们使用的日期时间和地点获得的数据]
## from a GPS device attached to a lesser black-backed gull.[#从GPS设备连接到一个较小的黑背鸥。]
## We interpolate wind information to to each point in the dataset[#插wind资讯中的每个点的数据集]
data(gull)

## Take a subset of the data based on the datetime of [#以一个数据子集的基础上的日期时间]
## the measurement ##[###的测量]
ss <- subset(gull, format(gull$datetime, "%Y-%m-%d %H:%M:%S") >=
    "2008-09-19 16:00:00" &amp; format(gull$datetime,
    "%Y-%m-%d %H:%M:%S") <= "2008-09-19 19:30:00")


## Now collect wind information for each point in the subset ##[#现在收集风中的每个点的信息的子集##]
uwind <- NCEP.interp(variable='uwnd', level=925,
    lat=ss$latitude, lon=ss$longitude, dt=ss$datetime,
    reanalysis2=TRUE, keep.unpacking.info=TRUE)
vwind <- NCEP.interp(variable='vwnd', level=925,
    lat=ss$latitude, lon=ss$longitude, dt=ss$datetime,
    reanalysis2=TRUE, keep.unpacking.info=TRUE)       

       
## Now calculate the tailwind component from the U and V[#现在计算的顺风分量U和V]
## wind components assuming that the bird's preferred [#风分量假设鸟的首选]
## direction is 225 degrees[#方向为225度]
tailwind <- (sqrt(uwind^2 + vwind^2)*cos(((atan2(uwind,vwind)*
    (180/pi))-225)*(pi/180)))

## Now visualize the subset of the GPS track using color[#可视化GPS跟踪使用颜色的子集]
## to indicate the tailwind speed ##[###表示顺风速度]
NCEP.vis.points(wx=tailwind, lats=ss$latitude, lons=ss$longitude,
    cols=rev(heat.colors(64)),
    title.args=list(main='Lesser black-backed gull'),
    image.plot.args=list(legend.args=list(text='Tailwind m/s',
    adj=0, padj=-2, cex=1.15)),
    map.args=list(xlim=c(-7,4), ylim=c(40,50)))

## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-24 18:31 , Processed in 0.022149 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表