How to extract satellite measured chlorophyll-a (chl-a) in MATLAB

10 ビュー (過去 30 日間)
Karthik M
Karthik M 2021 年 7 月 28 日
コメント済み: Karthik M 2021 年 8 月 3 日
Hi Folks,
I was using thie following script to extract chlor_a variable with lat[0S 30N] and lon[30W 100E] further need to capture the data values of chla for particular region esp for North Indian Ocean lat, long range
ncdisp = ('A20150012015008.L3m_8D_CHL_chlor_a_4km.nc');
lat = ncread('A20150012015008.L3m_8D_CHL_chlor_a_4km.nc','lat');
lon = ncread('A20150012015008.L3m_8D_CHL_chlor_a_4km.nc','lon');
chlor_a = ncread('A20150012015008.L3m_8D_CHL_chlor_a_4km.nc','chlor_a');
% Load longitude array:
lon = double(ncread('A20150012015008.L3m_8D_CHL_chlor_a_4km.nc','lon'));
ind1 = find(lon>=30 & lon<=100);
% Do the same for lat:
lat = double(ncread('A20150012015008.L3m_8D_CHL_chlor_a_4km.nc','lat'));
ind2 = find(lat>=0 & lat<=30);
% Clip lat and lon to their specified range:
lat = lat(ind2);
lon = lon(ind1);
% Make a grid:
[Lat,Lon] = meshgrid(lat,lon);
Looking forward to your valuable suggestions
regards

採用された回答

KSSV
KSSV 2021 年 7 月 28 日
Let lon,lat be your grid coordinates of the nc file.
[X,Y] = meshgrid(lon,lat) ;
xi = linspace(30,100) ;
yi = linspace(0,30) ;
[Xi,Yi] = meshgrid(xi,yi) ;
iwant = interp2(X,Y,chlor_a',Xi,Yi) ;
If the data is 3D run a loop.
  12 件のコメント
Karthik M
Karthik M 2021 年 8 月 2 日
I tried using this script still error persist
nccreate('myfile.nc','myvar')
>> A = 99;
>> ncwrite('myfile.nc','myvar',A)
>> S = ncinfo('myfile.nc');
>> file_fmt = S.Format
file_fmt =
'netcdf4_classic'
>> S.Format = 'netcdf4';
>> ncwriteschema('newfile.nc',S)
kindly help
Karthik M
Karthik M 2021 年 8 月 3 日
I tried using this script still error persist
nccreate('myfile.nc','myvar')
>> A = 99;
>> ncwrite('myfile.nc','myvar',A)
>> S = ncinfo('myfile.nc');
>> file_fmt = S.Format
file_fmt =
'netcdf4_classic'
>> S.Format = 'netcdf4';
>> ncwriteschema('newfile.nc',S)
kindly help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIEC Certification Kit (for ISO 26262 and IEC 61508) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by