Skip to content

Commit eb030c6

Browse files
committed
update readme.md: add an new example
1 parent 368106f commit eb030c6

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Readme.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,45 @@ Max_Count_per_group = 5;
542542
FUN_nc_OpenDAP_with_limit( filename0, filename1, dim_limit_var, dim_limit_val, var_download, var_divided, divided_dim_str, Max_Count_per_group )
543543
```
544544

545+
##### Example 2: A new template
546+
547+
```matlab
548+
% HYCOM dataset at an OpenDAP server
549+
opendapURL = 'http://tds.hycom.org/thredds/dodsC/GLBu0.08/expt_19.1/2012';
550+
551+
% output filename
552+
filename_out = 'HYCOM_test1.nc';
553+
554+
% calculate time limits
555+
timelimit = [datenum(2012,1,1) datenum(2012,1,3)];
556+
time_varname = 'time'; %Tell the code which variable contains time
557+
558+
% set limits
559+
lonlimit = [-76 -70 ];
560+
latlimit = [32 39];
561+
depthlimit = [0 100];
562+
563+
dim_limit_var = {'lon', 'lat', 'depth', 'time' };
564+
dim_limit_val = {lonlimit, latlimit, depthlimit, timelimit};
565+
566+
% variable to be downloaded
567+
var_download = {'water_temp','lon','lat','depth','time'}; % empty indicates downloading all variables
568+
569+
% Variables that should be downloaded block by block
570+
var_divided = var_download;
571+
572+
573+
% which dim you'd like to download block by block (e.g., 'time', or 'depth')
574+
divided_dim_str = 'depth';
575+
576+
% max size of each "piece"
577+
N_divided_rec_per_group = 2;
578+
579+
FUN_nc_OpenDAP_with_limit( opendapURL, filename_out, dim_limit_var, dim_limit_val, var_download, var_divided, divided_dim_str, N_divided_rec_per_group, 'time_var_name', time_varname);
580+
```
581+
582+
583+
545584
### 3.2 Merge multiple netCDF files in time (`FUN_nc_merge`)
546585

547586
`FUN_nc_merge( input_dir, filelist, output_fn, merge_dim_name, compatibility_mode )`

0 commit comments

Comments
 (0)