Hi,
I have NetCDF file (file name is precip.mon.mean.nc at this link ftp://ftp.cdc.noaa.gov/Datasets/cmap/std/precip.mon.mean.nc) with four variables as column as;Lat; Lon;Precip;Time. I want to extract monthly grid time series data available from 1979 to 2019 to my station point. My code is as below:
file = ('precip.mon.mean.nc'); %openfile
time = ncread(file,'time');prep = ncread(file,'precip'); lon = ncread(file,'lon');lat = ncread(file,'lat');latlim = [19.787500 18.029167]; %N to S
lonlim = [101.904167 103.391667]; %W to E
from_date = '01-01-1979'; to_date = '01-11-2019';time_datenum = datenum('01-01-1979','dd-mm-yyyy');date_match = time_datenum >= datenum(from_date) && time_datenum <= datenum(to_date);selected_prep = prep(:,:,date_match);
Yet, I couldn't get data in select_prep which is the new one I want to store data. Could you guys help me on this.
Thanks
Phat
Best Answer