필터 지우기
필터 지우기

How to extract a particular longitude and latitude data for a given time frame from .nc format

조회 수: 4 (최근 30일)
Hello People,
Being a beginner I am finding difficulities in solving the following issue. I have 3 separate buoy locations (21.29 87.65; 17.63 83.27; 11.87 79.84). Now, I need to find out waveheight data for those locations by identifying those locations from the file in .nc format (era5 reanalysis data) for a certain time period with 1hr interval for a time series plot . If exact location as of buoy is not available, then an interpolation from the nearest coordinate is required. I was just able to do this much
file= 'E:\DATA\SigWaveHeight.nc'
ncdisp(file);
long= ncread(file,'longitude');
lat= ncread(file,'latitude');
time= ncread(file,'time');
hst= ncread(file,'swh');
Please suggest a generalised code how to extract those data.
Variables given are latitude(37X1 single), longitude(31X1 single), time(17544X1 int32), swh (significant wave height) (31X37X17544 double)
  댓글 수: 4
Benjamin Thompson
Benjamin Thompson 2022년 2월 1일
If your question is not yet answered please post an NC file. I do not use Google Drive.
Subhashree Sahu
Subhashree Sahu 2022년 2월 1일
편집: Subhashree Sahu 2022년 2월 1일
Sir, the file size is too big. It is of 120 mb. Even after compressing and archiving it is 61 mb. Here i am not able to upload a file more than 5mb. Don't know how else i can post the data here

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

답변 (1개)

TESFALEM ALDADA
TESFALEM ALDADA 2022년 2월 1일
If this solve give it try.
For a specified long, lat and time you can extract individual data as:
long = 21.29;
lat = 87.65;
time = startDate:EndDate;
hst1 = hst(long,lat,time); % long,lat arrangement must agree as in your ncdisp info
  댓글 수: 1
Subhashree Sahu
Subhashree Sahu 2022년 2월 1일
It is giving error in hst1 = hst(long,lat,time) saying index in position 1 is invalid. Array indices must be positive integers or logical values

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

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by