How can I read variables (lat lon and chl-a)in nc files with groups?

조회 수: 9 (최근 30일)
Bei JIANG
Bei JIANG 2022년 7월 4일
댓글: Bei JIANG 2022년 7월 4일
Hi,
I download Aqua-MODIS nc file from Level-3 Binned/Aqua-MODIS/2019/064 (nasa.gov),the file is too large to upload.
I already used the command "chla_a=ncread("H:\chla\A2019352.L3b_DAY_CHL.nc",'/level-3_binned_data/chlor_a');" to read data, however, it is wrong-"Incorrect use of netcdf.getVar (line 137)33 is an unrecognized netCDF data type."
I want to know how can I read the chl-a data and it lat and lon?
Below is the information:
ncdisp("H:\chla\A2019352.L3b_DAY_CHL.nc")
Source:
H:\chla\A2019352.L3b_DAY_CHL.nc
Format:
netcdf4
Global Attributes:
product_name = 'A2019352.L3b_DAY_CHL.nc'
title = 'MODIS Level-3 Binned Data'
instrument = 'MODIS'
platform = 'Aqua'
temporal_range = 'day'
start_orbit_number = 93736
end_orbit_number = 93751
date_created = '2020-04-01T00:40:24.000Z'
processing_version = '2018.1'
history = 'l2bin par=A2019352.L3b_DAY_CHL.param'
time_coverage_start = '2019-12-18T00:20:01.000Z'
time_coverage_end = '2019-12-19T02:34:59.000Z'
northernmost_latitude = 90
southernmost_latitude = -90
easternmost_longitude = 180
westernmost_longitude = -180
geospatial_lat_max = 90
geospatial_lat_min = -90
geospatial_lon_max = 180
geospatial_lon_min = -180
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 = 1468593
percent_data_bins = 6.1805
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 = 'A2019352.L3b_DAY_CHL.nc/L3/A2019352.L3b_DAY_CHL.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 = 1468593 (UNLIMITED)
binDataDim = 1468593 (UNLIMITED)
binIndexDim = 4320 (UNLIMITED)
Variables:
BinList
Size: 1468593x1
Dimensions: binListDim
Datatype: UNSUPPORTED DATATYPE
chlor_a
Size: 1468593x1
Dimensions: binDataDim
Datatype: UNSUPPORTED DATATYPE
chl_ocx
Size: 1468593x1
Dimensions: binDataDim
Datatype: UNSUPPORTED DATATYPE
BinIndex
Size: 4320x1
Dimensions: binIndexDim
Datatype: UNSUPPORTED DATATYPE
/processing_control/
Attributes:
software_name = 'l2bin'
software_version = '6.2.0'
source = 'A2019352000000.L2_LAC_OC.nc,A2019352000500.L2_LAC_OC.nc,A2019352001000.L2_LAC_OC.nc,A2019352001500.L2_LAC_OC.nc,A2019352002000.L2_LAC_OC.nc,A2019352002500.L2_LAC_OC.nc,A2019352003000.L2_LAC_OC.nc,A2019352012000.L2_LAC_OC.nc,A2019352012500.L2_LAC_OC.nc,A2019352013000.L2_LAC_OC.nc,A2019352013500.L2_LAC_OC.nc,A2019352014000.L2_LAC_OC.nc,A2019352014500.L2_LAC_OC.nc,A2019352015000.L2_LAC_OC.nc,A2019352015500.L2_LAC_OC.nc,A2019352020000.L2_LAC_OC.nc,A2019352020500.L2_LAC_OC.nc,A2019352021000.L2_LAC_OC.nc,A2019352025500.L2_LAC_OC.nc,A2019352030000.L2_LAC_OC.nc,A2019352030500.L2_LAC_OC.nc,A2019352031000.L2_LAC_OC.nc,A2019352031500.L2_LAC_OC.nc,A2019352032000.L2_LAC_OC.nc,A2019352032500.L2_LAC_OC.nc,A2019352033000.L2_LAC_OC.nc,A2019352033500.L2_LAC_OC.nc,A2019352034000.L2_LAC_OC.nc,A2019352034500.L2_LAC_OC.nc,A2019352035000.L2_LAC_OC.nc,A2019352043500.L2_LAC_OC.nc,A2019352044000.L2_LAC_OC.nc,A2019352044500.L2_LAC_OC.nc,A2019352045000.L2_LAC_OC.nc,A2019352045500.L2_LAC_OC.nc,A2019352050000.L2_LAC_OC.nc,A2019352050500.L2_LAC_OC.nc,A2019352051000.L2_LAC_OC.nc,A2019352051500.L2_LAC_OC.nc,A2019352052000.L2_LAC_OC.nc,A2019352052500.L2_LAC_OC.nc,A2019352053000.L2_LAC_OC.nc,A2019352061500.L2_LAC_OC.nc,A2019352062000.L2_LAC_OC.nc,A2019352062500.L2_LAC_OC.nc,A2019352063000.L2_LAC_OC.nc,A2019352063500.L2_LAC_OC.nc,A2019352064000.L2_LAC_OC.nc,A2019352064500.L2_LAC_OC.nc,A2019352065000.L2_LAC_OC.nc,A2019352065500.L2_LAC_OC.nc,A2019352070000.L2_LAC_OC.nc,A2019352070500.L2_LAC_OC.nc,A2019352075500.L2_LAC_OC.nc,A2019352080000.L2_LAC_OC.nc,A2019352080500.L2_LAC_OC.nc,A2019352081000.L2_LAC_OC.nc,A2019352081500.L2_LAC_OC.nc,A2019352082000.L2_LAC_OC.nc,A2019352082500.L2_LAC_OC.nc,A2019352083000.L2_LAC_OC.nc,A2019352083500.L2_LAC_OC.nc,A2019352084000.L2_LAC_OC.nc,A2019352084500.L2_LAC_OC.nc,A2019352093000.L2_LAC_OC.nc,A2019352093500.L2_LAC_OC.nc,A2019352094000.L2_LAC_OC.nc,A2019352094500.L2_LAC_OC.nc,A2019352095000.L2_LAC_OC.nc,A2019352095500.L2_LAC_OC.nc,A2019352100000.L2_LAC_OC.nc,A2019352100500.L2_LAC_OC.nc,A2019352101000.L2_LAC_OC.nc,A2019352101500.L2_LAC_OC.nc,A2019352102000.L2_LAC_OC.nc,A2019352102500.L2_LAC_OC.nc,A2019352111000.L2_LAC_OC.nc,A2019352111500.L2_LAC_OC.nc,A2019352112000.L2_LAC_OC.nc,A2019352112500.L2_LAC_OC.nc,A2019352113000.L2_LAC_OC.nc,A2019352113500.L2_LAC_OC.nc,A2019352114000.L2_LAC_OC.nc,A2019352114500.L2_LAC_OC.nc,A2019352115000.L2_LAC_OC.nc,A2019352115500.L2_LAC_OC.nc,A2019352120000.L2_LAC_OC.nc,A2019352120500.L2_LAC_OC.nc,A2019352125000.L2_LAC_OC.nc,A2019352125500.L2_LAC_OC.nc,A2019352130000.L2_LAC_OC.nc,A2019352130500.L2_LAC_OC.nc,A2019352131000.L2_LAC_OC.nc,A2019352131500.L2_LAC_OC.nc,A2019352132000.L2_LAC_OC.nc,A2019352132500.L2_LAC_OC.nc,A2019352133000.L2_LAC_OC.nc,A2019352133500.L2_LAC_OC.nc,A2019352134000.L2_LAC_OC.nc,A2019352143000.L2_LAC_OC.nc,A2019352143500.L2_LAC_OC.nc,A2019352144000.L2_LAC_OC.nc,A2019352144500.L2_LAC_OC.nc,A2019352145000.L2_LAC_OC.nc,A2019352145500.L2_LAC_OC.nc,A2019352150000.L2_LAC_OC.nc,A2019352150500.L2_LAC_OC.nc,A2019352151000.L2_LAC_OC.nc,A2019352151500.L2_LAC_OC.nc,A2019352152000.L2_LAC_OC.nc,A2019352161000.L2_LAC_OC.nc,A2019352161500.L2_LAC_OC.nc,A2019352162000.L2_LAC_OC.nc,A2019352162500.L2_LAC_OC.nc,A2019352163000.L2_LAC_OC.nc,A2019352163500.L2_LAC_OC.nc,A2019352164000.L2_LAC_OC.nc,A2019352164500.L2_LAC_OC.nc,A2019352165000.L2_LAC_OC.nc,A2019352165500.L2_LAC_OC.nc,A2019352170000.L2_LAC_OC.nc,A2019352174500.L2_LAC_OC.nc,A2019352175000.L2_LAC_OC.nc,A2019352175500.L2_LAC_OC.nc,A2019352180000.L2_LAC_OC.nc,A2019352180500.L2_LAC_OC.nc,A2019352181000.L2_LAC_OC.nc,A2019352181500.L2_LAC_OC.nc,A2019352182000.L2_LAC_OC.nc,A2019352182500.L2_LAC_OC.nc,A2019352183000.L2_LAC_OC.nc,A2019352183500.L2_LAC_OC.nc,A2019352184000.L2_LAC_OC.nc,A2019352192500.L2_LAC_OC.nc,A2019352193000.L2_LAC_OC.nc,A2019352193500.L2_LAC_OC.nc,A2019352194000.L2_LAC_OC.nc,A2019352194500.L2_LAC_OC.nc,A2019352195000.L2_LAC_OC.nc,A2019352195500.L2_LAC_OC.nc,A2019352200000.L2_LAC_OC.nc,A2019352200500.L2_LAC_OC.nc,A2019352201000.L2_LAC_OC.nc,A2019352201500.L2_LAC_OC.nc,A2019352202000.L2_LAC_OC.nc,A2019352210500.L2_LAC_OC.nc,A2019352211000.L2_LAC_OC.nc,A2019352211500.L2_LAC_OC.nc,A2019352212000.L2_LAC_OC.nc,A2019352212500.L2_LAC_OC.nc,A2019352213000.L2_LAC_OC.nc,A2019352213500.L2_LAC_OC.nc,A2019352214000.L2_LAC_OC.nc,A2019352214500.L2_LAC_OC.nc,A2019352215000.L2_LAC_OC.nc,A2019352215500.L2_LAC_OC.nc,A2019352224500.L2_LAC_OC.nc,A2019352225000.L2_LAC_OC.nc,A2019352225500.L2_LAC_OC.nc,A2019352230000.L2_LAC_OC.nc,A2019352230500.L2_LAC_OC.nc,A2019352231000.L2_LAC_OC.nc,A2019352231500.L2_LAC_OC.nc,A2019352232000.L2_LAC_OC.nc,A2019352232500.L2_LAC_OC.nc,A2019352233000.L2_LAC_OC.nc,A2019352233500.L2_LAC_OC.nc,A2019353002000.L2_LAC_OC.nc,A2019353002500.L2_LAC_OC.nc,A2019353003000.L2_LAC_OC.nc,A2019353003500.L2_LAC_OC.nc,A2019353004000.L2_LAC_OC.nc,A2019353004500.L2_LAC_OC.nc,A2019353005000.L2_LAC_OC.nc,A2019353005500.L2_LAC_OC.nc,A2019353010000.L2_LAC_OC.nc,A2019353010500.L2_LAC_OC.nc,A2019353011000.L2_LAC_OC.nc,A2019353011500.L2_LAC_OC.nc,A2019353020000.L2_LAC_OC.nc,A2019353020500.L2_LAC_OC.nc,A2019353021000.L2_LAC_OC.nc,A2019353021500.L2_LAC_OC.nc,A2019353022000.L2_LAC_OC.nc,A2019353022500.L2_LAC_OC.nc,A2019353023000.L2_LAC_OC.nc,A2019353023500.L2_LAC_OC.nc,A2019353024000.L2_LAC_OC.nc,A2019353024500.L2_LAC_OC.nc,A2019353025000.L2_LAC_OC.nc,A2019353025500.L2_LAC_OC.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 = '/data7/sdpsoper/vdc/vpu20/workbuf/l2inlist.dat'
ofile = 'A2019352.L3b_DAY_CHL.nc'
fileuse = 'A2019352.L3b_DAY_CHL.contrib'
sday = '2019352'
eday = '2019352'
latnorth = '90.000000'
latsouth = '-90.000000'
loneast = '0.000000'
lonwest = '0.000000'
resolve = '4'
rowgroup = '270'
flaguse = 'ATMFAIL,LAND,HILT,HISATZEN,STRAYLIGHT,CLDICE,COCCOLITH,LOWLW,CHLWARN,CHLFAIL,NAVWARN,MAXAERITER,ATMWARN,HISOLZEN,NAVFAIL,FILTER,HIGLINT'
l3bprod = 'chlor_a,chl_ocx'
prodtype = 'O'
pversion = '2018.1'
suite = 'CHL'
night = '0'
verbose = '0'
minobs = '0'
deflate = '4'
qual_prod = ''
composite_prod = ''
composite_scheme = ''
qual_max = '2'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
chla_a=ncread("H:\chla\A2019352.L3b_DAY_CHL.nc",'/level-3_binned_data/chlor_a');
Incorrect use of netcdf.getVar (line 137)
33 is an unrecognized netCDF data type.
Error in internal.matlab.imagesci.nc/read (line 607)
data = netcdf.getVar(gid, varid);
Error ncread (line 66)
vardata = ncObj.read(varName, varargin{:});
Thank you very much! I need your help.

채택된 답변

MJFcoNaN
MJFcoNaN 2022년 7월 4일
편집: MJFcoNaN 2022년 7월 4일
Hello,
If possible, I will suggest you choose the "level 3 mapped data" which is much more convenient to deal with in matlab, because of its traditional lon-lat grid.
Or you need to use h5read instead of ncread:
chla_a=h5read("H:\chla\A2019352.L3b_DAY_CHL.nc","/level-3_binned_data/chlor_a");
  댓글 수: 1
Bei JIANG
Bei JIANG 2022년 7월 4일
Thank you very much! When I download the level 3 mapped data,I solve my problem.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by