필터 지우기
필터 지우기

unable to find variable in ncread

조회 수: 6 (최근 30일)
akk
akk 2020년 12월 29일
답변: Walter Roberson 2020년 12월 31일
Hi,
Im having trouble finding variables in my nc file. First I use:
ncdisp('A20150802015171.L3b_SNSP_CHL.x.nc')
I get the display:
Source:
C:\Users\WaterLab\Downloads\requested_files\A20150802015171.L3b_SNSP_CHL.x.nc
Format:
netcdf4
Global Attributes:
product_name = 'A20150802015171.L3b_SNSP_CHL.x.nc'
title = 'MODIS Level-3 Binned Data'
instrument = 'MODIS'
platform = 'Aqua'
temporal_range = '3-month'
start_orbit_number = 68499
end_orbit_number = 69840
date_created = '2020363234255000'
processing_version = 'unspecified'
history = '/sdps/sdpsoper/Science/OCSSW/V2020.2/bin/l3bin ifile=A20150802015171.L3b_SNSP_CHL.nc ofile=A20150802015171.L3b_SNSP_CHL.x.nc latnorth=28.2000 latsouth=27.2000 lonwest=-176.2000 loneast=-175.6000'
time_coverage_start = '2015-03-21T00:05:00.000Z'
time_coverage_end = '2015-06-21T02:24:59.000Z'
northernmost_latitude = 28.1875
southernmost_latitude = 27.2292
easternmost_longitude = -175.5535
westernmost_longitude = -176.1989
geospatial_lat_max = 28.1875
geospatial_lat_min = 27.2292
geospatial_lon_max = -175.5535
geospatial_lon_min = -176.1989
geospatial_lat_units = 'degrees_north'
geospatial_lon_units = 'degrees_east'
geospatial_lon_resolution = 0.041667
geospatial_lat_resolution = 0.041667
spatialResolution = '4.6 km'
data_bins = 318
percent_data_bins = 0.0013383
units = 'chlor_a:mg m^-3,chl_ocx:mg m^-3'
binning_scheme = 'Integerized Sinusoidal Grid'
project = 'Ocean Biology Processing Group (NASA/GSFC/OBPG)'
institution = 'NASA Goddard Space Flight Center, Ocean Ecology Laboratory, Ocean Biology Processing Group'
standard_name_vocabulary = 'CF Standard Name Table v36'
Conventions = 'CF-1.6 ACDD-1.3'
naming_authority = 'gov.nasa.gsfc.sci.oceandata'
id = 'A20150802015171.L3b_SNSP_CHL.x.nc/L3/A20150802015171.L3b_SNSP_CHL.x.nc'
license = 'https://science.nasa.gov/earth-science/earth-science-data/data-information-policy/'
creator_name = 'NASA/GSFC/OBPG'
publisher_name = 'NASA/GSFC/OBPG'
creator_email = 'data@oceancolor.gsfc.nasa.gov'
publisher_email = 'data@oceancolor.gsfc.nasa.gov'
creator_url = 'https://oceandata.sci.gsfc.nasa.gov'
publisher_url = 'https://oceandata.sci.gsfc.nasa.gov'
processing_level = 'L3 Binned'
cdm_data_type = 'point'
identifier_product_doi_authority = 'https://dx.doi.org'
identifier_product_doi = '10.5067/AQUA/MODIS/L3B/CHL/2018'
keywords_vocabulary = 'NASA Global Change Master Directory (GCMD) Science Keywords'
keywords = 'Earth Science > Oceans > Ocean Chemistry > Pigments > Chlorophyll; Earth Science > Oceans > Ocean Chemistry > Chlorophyllr'
Groups:
/level-3_binned_data/
Dimensions:
binListDim = 318 (UNLIMITED)
binDataDim = 318 (UNLIMITED)
binIndexDim = 4320 (UNLIMITED)
Variables:
BinList
Size: 318x1
Dimensions: binListDim
Datatype: UNSUPPORTED DATATYPE
chlor_a
Size: 318x1
Dimensions: binDataDim
Datatype: UNSUPPORTED DATATYPE
chl_ocx
Size: 318x1
Dimensions: binDataDim
Datatype: UNSUPPORTED DATATYPE
BinIndex
Size: 4320x1
Dimensions: binIndexDim
Datatype: UNSUPPORTED DATATYPE
/processing_control/
Attributes:
software_name = 'L3BIN'
software_version = '5.13'
source = 'A20150802015171.L3b_SNSP_CHL.nc'
l2_flag_names = 'ATMFAIL,LAND,HILT,HISATZEN,STRAYLIGHT,CLDICE,COCCOLITH,LOWLW,CHLWARN,CHLFAIL,NAVWARN,MAXAERITER,ATMWARN,HISOLZEN,NAVFAIL,FILTER,HIGLINT'
Groups:
/processing_control/input_parameters/
Attributes:
infile = 'A20150802015171.L3b_SNSP_CHL.nc'
ofile = 'A20150802015171.L3b_SNSP_CHL.x.nc'
pfile = 'A20150802015171.L3b_SNSP_CHL.x.nc'
oformat = 'netCDF4'
syear = '9999'
eyear = '9999'
sday = '1970001'
eday = '2038018'
sorbit = '-1'
eorbit = '-1'
out_parm = ':DEFAULT:'
processing_version = 'unspecified'
reduce_fac = '1'
merged = ''
loneast = '-175.600006'
lonwest = '-176.199997'
latnorth = '28.200001'
latsouth = '27.200001'
verbose = '0'
unit_wgt = '0'
median = '0'
deflate = '5'
composite_prod = ''
composite_scheme = ''
I would like to open the variable chlor_a, so I type:
chla=ncread('A20150802015171.L3b_SNSP_CHL.x.nc','chlor_a')
I receive the error:
Error using internal.matlab.imagesci.nc/getGroupAndVarid (line 2096)
Could not find variable or group 'chlor_a' in file.
Error in internal.matlab.imagesci.nc/read (line 593)
[gid, varid] = getGroupAndVarid(this, location);
Error in ncread (line 66)
vardata = ncObj.read(varName, varargin{:});
I am also suprised there is not a lat and lon variable in here. Any suggestions? Thank you!
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 12월 29일
chla = ncread('A20150802015171.L3b_SNSP_CHL.x.nc', '/level-3_binned_data/chlor_a')
The groups are like directories
akk
akk 2020년 12월 29일
Excellent! Thank you!

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 12월 31일
chla = ncread('A20150802015171.L3b_SNSP_CHL.x.nc', '/level-3_binned_data/chlor_a')
The groups are like directories

카테고리

Help CenterFile Exchange에서 Oceanography and Hydrology에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by