...
You can find SOBEK output in the <projectname>.dsproj_data folder. Here you will find several files with the *.nc extension. These are NetCDF files. They correspond to the output selected in DeltaShell. Note: if this folder contains files with the extension *.nc.changes you have not saved your project after running the model. Save the project in DeltaShell before continuing.
Info NetCDF (Network Common Data Form) is an open standard for storing scientific data. Delft3D Flexible Mesh (and SOBEK) use the CF-1.0 convention.
- For this tutorial we will use the observation point output for water level. If you do not have a SOBEK model readily available, download the following output file: Water level (op).nc
Open MATLAB and define a variable pointing to the *.nc file:
Code Block linenumbers true ncfile = './Water level (op).nc'
To display the contents of the file, use the following build in function. This will print a list of all variables and sizes to the command window.
Code Block linenumbers true ncdisp(ncfile)
In the next steps, we will extract the times, values and observation point names from the NetCDF file
The variable for the timestamps is called 'time', but note that it is in 'milliseconds since 1970-01-01'! Check this using ncdisp. To change this to MATLAB compatible time, use the following code
Code Block linenumbers true % Read data from nc file time = ncread(ncfile) % convert to MATLAB dates time = time./(1000*3600*24) + datenum('01-01-1970', 'dd-mm-yyyy')
ad
To extract time,
Info |
---|
Related articles
Content by Label | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|