- 积分
- 1901
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-1-6
- 最后登录
- 1970-1-1
![[Jane_雪碧] 粉丝数:124 微博数:3997 新浪微博达人勋](source/plugin/sina_login/img/light.png)
|
发表于 2016-3-22 09:48:16
|
显示全部楼层
本帖最后由 xuebiz 于 2016-3-22 11:14 编辑
#第二部分
ncl 6> arr1 = ispan(1,10,1)
ncl 7> print(arr1(4))
Variable: arr1 (subsection)
Type: integer
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 5
ncl 8> print(hgt(0,4,1,10))
Variable: hgt (subsection)
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 24
lon : 25
lat : 87.5
level : 600
time : 1832064
missing_value : -32767
valid_range : ( -1500, 35799 )
missing_value_original : 32766
_FillValue : -32767
_FillValue_original : -32767
long_name : Monthly Geopotential Heights on Pressure Levels
unpacked_valid_range : ( -1500, 35800 )
actual_range : ( -209, 32301 )
units : m
precision : 0
least_significant_digit : 0
GRIB_id : 7
GRIB_name : HGT
var_desc : Geopotential height
dataset : NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Monthly Averages
level_desc : Pressure Levels
statistic : Individual Obs
parent_stat : Other
standard_name : geopotential_height
cell_methods : time: mean (montly from 6-hourly values)
(0) 3751
ncl 9> print(arr1(2:4))
Variable: arr1 (subsection)
Type: integer
Total Size: 12 bytes
3 values
Number of Dimensions: 1
Dimensions and sizes: [3]
Coordinates:
(0) 3
(1) 4
(2) 5
ncl 10> print(arr1(1::2))
Variable: arr1 (subsection)
Type: integer
Total Size: 20 bytes
5 values
Number of Dimensions: 1
Dimensions and sizes: [5]
Coordinates:
(0) 2
(1) 4
(2) 6
(3) 8
(4) 10
ncl 11> print(hgt(:15:2,0,15,29))
Variable: hgt (subsection)
Type: float
Total Size: 32 bytes
8 values
Number of Dimensions: 1
Dimensions and sizes: [time | 8]
Coordinates:
time: [1832064..1842240]
Number Of Attributes: 23
lon : 72.5
lat : 52.5
level : 1000
missing_value : -32767
valid_range : ( -1500, 35799 )
missing_value_original : 32766
_FillValue : -32767
_FillValue_original : -32767
long_name : Monthly Geopotential Heights on Pressure Levels
unpacked_valid_range : ( -1500, 35800 )
actual_range : ( -209, 32301 )
units : m
precision : 0
least_significant_digit : 0
GRIB_id : 7
GRIB_name : HGT
var_desc : Geopotential height
dataset : NCEP/DOE AMIP-II Reanalysis (Reanalysis-2) Monthly Averages
level_desc : Pressure Levels
statistic : Individual Obs
parent_stat : Other
standard_name : geopotential_height
cell_methods : time: mean (montly from 6-hourly values)
(0) 220
(1) 189
(2) 120
(3) 46
(4) 151
(5) 228
(6) 253
(7) 177
-----------太激动,中间手误敲错2次,强迫症患者们,行号不连续请无视啊。。。
ncl 14> hgt_500 = hgt(0, {500}, :, :)
ncl 15> hgt_500_0 = hgt(time| 0, {level| 500:700}, {lon| 90:120}, lat| :)
ncl 16> idx = (/1,3,4,5,7,8/)
ncl 17> print(arr1(idx))
Variable: arr1 (subsection)
Type: integer
Total Size: 24 bytes
6 values
Number of Dimensions: 1
Dimensions and sizes: [6]
Coordinates:
(0) 2
(1) 4
(2) 5
(3) 6
(4) 8
(5) 9
ncl 18> a = (/1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5/)
ncl 19> a@_FillValue = 5
ncl 20> valid = ind(ismissing(a))
ncl 21> a(valid) = 0
ncl 22> a(ind(a.ne.0)) = -a(ind(a.ne.0)) * 2 + 1
ncl 23> print(a)
Variable: a
Type: integer
Total Size: 60 bytes
15 values
Number of Dimensions: 1
Dimensions and sizes: [15]
Coordinates:
Number Of Attributes: 1
_FillValue : 5
(0) -1
(1) -3
(2) -5
(3) -7
(4) 0
(5) 0
(6) -7
(7) -5
(8) -3
(9) -1
(10) -1
(11) -3
(12) -5
(13) -7
(14) 0
|
|