使用 R netcdf4 数据提取
Using R netcdf4 data extraction
我在从 netcdf4 文件 sund_WAS-44_ICHEC-EC-EARTH_rcp26_r12i1p1_SMHI-RCA4_v2_day_20510101-20551231.nc
.
中提取区域 latitude 25 to 32, longitude 81 to 98
的数据时遇到问题
纬度和经度值在一个193*130的矩阵中。我出于我的目的使用 R。我想 运行 一个循环,以便它会为每个 lat,lon
.
给出 sund(1826)
的所有值
File sund_WAS-44_ICHEC-EC-EARTH_rcp26_r12i1p1_SMHI-RCA4_v2_day_20510101-20551231.nc (NC_FORMAT_NETCDF4_CLASSIC):"
5 variables (excluding dimension variables):"
double lat[rlon,rlat] "
standard_name: latitude"
long_name: latitude"
units: degrees_north"
double lon[rlon,rlat] "
standard_name: longitude"
long_name: longitude"
units: degrees_east"
char rotated_pole[] "
grid_mapping_name: rotated_latitude_longitude"
grid_north_pole_latitude: 79.95"
grid_north_pole_longitude: -123.34"
float sund[rlon,rlat,time] "
grid_mapping: rotated_pole"
_FillValue: 1.00000002004088e+20"
missing_value: 1.00000002004088e+20"
standard_name: duration_of_sunshine"
long_name: Duration of Sunshine"
units: s"
coordinates: lon lat"
cell_methods: time: sum"
double time_bnds[bnds,time] "
4 dimensions:"
rlat Size:130"
standard_name: grid_latitude"
long_name: latitude in rotated pole grid"
units: degrees"
axis: Y"
rlon Size:193"
standard_name: grid_longitude"
long_name: longitude in rotated pole grid"
units: degrees"
axis: X"
time Size:1826 *** is unlimited ***"
standard_name: time"
units: days since 1949-12-01 00:00:00"
calendar: standard"
long_name: time"
bounds: time_bnds"
axis: T"
bnds Size:2"
22 global attributes:"
Conventions: CF-1.4"
contact: rossby.cordex@smhi.se"
creation_date: 2013-12-08-T04:22:00Z"
experiment: RCP2.6"
experiment_id: rcp26"
driving_experiment: ICHEC-EC-EARTH, rcp26, r12i1p1"
driving_model_id: ICHEC-EC-EARTH"
driving_model_ensemble_member: r12i1p1"
driving_experiment_name: rcp26"
frequency: day"
institution: Swedish Meteorological and Hydrological Institute, Rossby Centre"
institute_id: SMHI"
model_id: SMHI-RCA4"
rcm_version_id: v2"
project_id: CORDEX"
CORDEX_domain: WAS-44"
product: output"
references: http://www.smhi.se/en/Research/Research-departments/climate-research-rossby-centre"
tracking_id: 26296ff2-4f1b-429c-9081-4f9eed7b08d0"
rossby_comment: 201258: CORDEX West Asia 0.44 deg | RCA4 v2 | ICHEC-EC-EARTH | r12i1p1 | rcp26 | L40"
rossby_run_id: 201258"
rossby_grib_path: /nobackup/rossby16/rossby/joint_exp/cordex/201258/raw/"
跨 lat/lon 波段提取的最简单方法是使用来自 NCO 的 ncks
:http://nco.sourceforge.net/nco.html
ncks -d latitude,25,32 -d longitude,81,95 your_netcdf.nc -O new_netcdf.nc
我在从 netcdf4 文件 sund_WAS-44_ICHEC-EC-EARTH_rcp26_r12i1p1_SMHI-RCA4_v2_day_20510101-20551231.nc
.
latitude 25 to 32, longitude 81 to 98
的数据时遇到问题
纬度和经度值在一个193*130的矩阵中。我出于我的目的使用 R。我想 运行 一个循环,以便它会为每个 lat,lon
.
sund(1826)
的所有值
File sund_WAS-44_ICHEC-EC-EARTH_rcp26_r12i1p1_SMHI-RCA4_v2_day_20510101-20551231.nc (NC_FORMAT_NETCDF4_CLASSIC):"
5 variables (excluding dimension variables):"
double lat[rlon,rlat] "
standard_name: latitude"
long_name: latitude"
units: degrees_north"
double lon[rlon,rlat] "
standard_name: longitude"
long_name: longitude"
units: degrees_east"
char rotated_pole[] "
grid_mapping_name: rotated_latitude_longitude"
grid_north_pole_latitude: 79.95"
grid_north_pole_longitude: -123.34"
float sund[rlon,rlat,time] "
grid_mapping: rotated_pole"
_FillValue: 1.00000002004088e+20"
missing_value: 1.00000002004088e+20"
standard_name: duration_of_sunshine"
long_name: Duration of Sunshine"
units: s"
coordinates: lon lat"
cell_methods: time: sum"
double time_bnds[bnds,time] "
4 dimensions:"
rlat Size:130"
standard_name: grid_latitude"
long_name: latitude in rotated pole grid"
units: degrees"
axis: Y"
rlon Size:193"
standard_name: grid_longitude"
long_name: longitude in rotated pole grid"
units: degrees"
axis: X"
time Size:1826 *** is unlimited ***"
standard_name: time"
units: days since 1949-12-01 00:00:00"
calendar: standard"
long_name: time"
bounds: time_bnds"
axis: T"
bnds Size:2"
22 global attributes:"
Conventions: CF-1.4"
contact: rossby.cordex@smhi.se"
creation_date: 2013-12-08-T04:22:00Z"
experiment: RCP2.6"
experiment_id: rcp26"
driving_experiment: ICHEC-EC-EARTH, rcp26, r12i1p1"
driving_model_id: ICHEC-EC-EARTH"
driving_model_ensemble_member: r12i1p1"
driving_experiment_name: rcp26"
frequency: day"
institution: Swedish Meteorological and Hydrological Institute, Rossby Centre"
institute_id: SMHI"
model_id: SMHI-RCA4"
rcm_version_id: v2"
project_id: CORDEX"
CORDEX_domain: WAS-44"
product: output"
references: http://www.smhi.se/en/Research/Research-departments/climate-research-rossby-centre"
tracking_id: 26296ff2-4f1b-429c-9081-4f9eed7b08d0"
rossby_comment: 201258: CORDEX West Asia 0.44 deg | RCA4 v2 | ICHEC-EC-EARTH | r12i1p1 | rcp26 | L40"
rossby_run_id: 201258"
rossby_grib_path: /nobackup/rossby16/rossby/joint_exp/cordex/201258/raw/"
跨 lat/lon 波段提取的最简单方法是使用来自 NCO 的 ncks
:http://nco.sourceforge.net/nco.html
ncks -d latitude,25,32 -d longitude,81,95 your_netcdf.nc -O new_netcdf.nc