Hi everyone,
I'm a beginner in matlab and I'm facing a probably simple problem that I'm not able to solve.
I have a set of netcdf files with climate data and I need to extract values of variables for specific lon lat location.
Each files has the following information:
ncdisp(filename)
Format:
classic
Global Attributes:
Conventions = 'CF-1.6'
production = 'CNRM-RCSM4 coupled model'
nco_openmp_thread_number = 1
NCO = '"4.5.5"'
institution = 'CNRM(Centre National de Recherches Meteorologiques),Meteo-France,Toulouse'
contact = 'florence.sevault@meteo.fr'
experiment_id = 'RCSM4-3.03'
frequency = 'mon'
creation_date = '2018-11-05 11:00:27'
Dimensions:
time = 120 (UNLIMITED)
y = 160
x = 394
Variables:
time
Size: 120x1
Dimensions: time
Datatype: double
Attributes:
units = 'months since 2006-01-01 00:00:00'
calendar = 'standard'
longitude
Size: 394x160
Dimensions: x,y
Datatype: single
Attributes:
standard_name = 'longitude'
units = 'degrees_east'
latitude
Size: 394x160
Dimensions: x,y
Datatype: single
Attributes:
standard_name = 'latitude'
units = 'degrees_north'
zos
Size: 394x160x120
Dimensions: x,y,time
Datatype: single
Attributes:
units = 'm'
_FillValue = 1.000000020040877e+20
cell_methods = 'time_counter: mean'
coordinates = 'longitude latitude'
standard_name = 'sea_surface_height_above_geoid'
valid_min = -1.000000020040877e+20
valid_max = 1.000000020040877e+20
missing_value = 1.000000020040877e+20
cell_method = 'time:mean'
offline_operation = 'zos=zos+0.11'
For the "zos" variable (394x160x120) I need to extract all 120 time value for given location (i.e. lon=12.48 lat= 44.64). I've tried different approaches, based on solved problems, but none of them work.
For example, with getvalue:
lat=ncread(filename,'latitude');
lon=ncread(filename,'longitude');
zos=ncread(filename,'zos');
data=getValue(12.48, 44.64, lon, lat, zos);
I have the following error:
Check for missing argument or incorrect argument data type in call to function 'getValue'.
Any suggestion?
Thanks in advance!