1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361
|
@c ---------------------------------------------------
@node High-level functions
@section High-level functions
@cindex High-level functions
@c High-level functions nccreate
@c -----------------------------------------
@subsection nccreate
@cindex nccreate
@deftypefn {Function File} {} nccreate(@var{filename},@var{varname})
@deftypefnx {Function File} {} nccreate(@var{filename},@var{varname},"property",@var{value},...)
Create the variable @var{varname} in the file @var{filename}.
@subsubheading Properties
The following properties can be used:
@itemize
@item "Dimensions": a cell array with the dimension names followed by their
length or Inf if the dimension is unlimited. If the property is omitted, a
scalar variable is created.
@item "Datatype": a string with the Octave data type name
(see @code{ncinfo} for the correspondence between Octave and NetCDF data
types). The default data type is a "double".
@item "Format": This can be "netcdf4_classic" (default), "classic", "64bit"
or "netcdf4".
@item "FillValue": the value used for undefined elements of the NetCDF
variable.
@item "ChunkSize": the size of the data chunks. If omitted, the variable is
not chunked.
@item "DeflateLevel": The deflate level for compression. It can be the string
"disable" (default) for no compression or an integer between 0 (no
compression) and 9 (maximum compression).
@item "Shuffle": true for enabling the shuffle filter or false (default) for
disabling it.
@end itemize
@subsubheading Example
@example
nccreate("test.nc","temp","Dimensions",@{"lon",10,"lat",20@},"Format","classic");
ncdisp("test.nc");
@end example
@xseealso{ncwrite}
@end deftypefn
@c High-level functions ncdisp
@c -----------------------------------------
@subsection ncdisp
@cindex ncdisp
@deftypefn {Function File} {} ncdisp (@var{filename})
Display meta-data of the NetCDF file @var{filename}
@subsubheading Example
@example
ncdisp("test.nc");
@end example
@xseealso{ncinfo}
@end deftypefn
@c High-level functions ncinfo
@c -----------------------------------------
@subsection ncinfo
@cindex ncinfo
@deftypefn {Function File} {@var{info} =} ncinfo (@var{filename})
@deftypefnx {Function File} {@var{info} =} ncinfo (@var{filename}, @var{varname})
@deftypefnx {Function File} {@var{info} =} ncinfo (@var{filename}, @var{groupname})
Return information about an entire NetCDF file @var{filename} (i.e. the root
group "/"), about the variable called @var{varname} or the group called
@var{groupname}.
The structure @var{info} has always the following fields:
@itemize
@item @var{Filename}: the name of the NetCDF file
@item @var{Format}: one of the strings "CLASSIC", "64BIT", "NETCDF4"
or "NETCDF4_CLASSIC"
@end itemize
The structure @var{info} has additional fields depending on whether a
group of variable is queried.
@subsubheading Groups
Groups are returned as an array structure with the following fields:
@itemize
@item @var{Name}: the group name. The root group is named "/".
@item @var{Dimensions}: a array structure with the dimensions.
@item @var{Variables}: a array structure with the variables.
@item @var{Attributes}: a array structure with global attributes.
@item @var{Groups}: a array structure (one for each group) with the
same fields as this structure.
@end itemize
@subsubheading Dimensions
Dimensions are returned as an array structure with the following fields:
@itemize
@item @var{Name}: the name of the dimension
@item @var{Length}: the length of the dimension
@item @var{Unlimited}: true of the dimension has no fixed limited, false
@end itemize
@subsubheading Variables
Variables are returned as an array structure with the following fields:
@itemize
@item @var{Name}: the name of the dimension
@item @var{Dimensions}: array structure of all dimensions of this variable
with the same structure as above.
@item @var{Size}: array with the size of the variable
@item @var{Datatype}: string with the corresponding octave data-type
(see below)
@item @var{Attributes}: a array structure of attributes
@item @var{FillValue}: the NetCDF fill value of the variable. If the fill
value is not defined, then this attribute is an empty array ([]).
@item @var{DeflateLevel}: the NetCDF deflate level between 0 (no
compression) and 9 (maximum compression).
@item @var{Shuffle}: is true if the shuffle filter is activated to improve
compression, otherwise false.
@item @var{CheckSum}: is set to "fletcher32", if check-sums are used,
otherwise this field is not defined.
@end itemize
@subsubheading Attributes
Attributes are returned as an array structure with the following fields:
@itemize
@item @var{Name}: the name of the attribute
@item @var{Value}: the value of the attribute (with the corresponding type)
@item @var{Unlimited}: true of the dimension has no fixed limited, false
@end itemize
@subsubheading Data-types
The following the the correspondence between the Octave and NetCDF
data-types:
@multitable @columnfractions .5 .5
@headitem Octave type @tab NetCDF type
@item @code{int8} @tab @code{NC_BYTE}
@item @code{uint8} @tab @code{NC_UBYTE}
@item @code{int16} @tab @code{NC_SHORT}
@item @code{uint16} @tab @code{NC_USHORT}
@item @code{int32} @tab @code{NC_INT}
@item @code{uint32} @tab @code{NC_UINT}
@item @code{int64} @tab @code{NC_INT64}
@item @code{uint64} @tab @code{NC_UINT64}
@item @code{single} @tab @code{NC_FLOAT}
@item @code{double} @tab @code{NC_DOUBLE}
@item @code{char} @tab @code{NC_CHAR}
@end multitable
The output of @code{ncinfo} can be used to create a NetCDF file with the same
meta-data using @code{ncwriteschema}.
Note: If there are no attributes (or variable or groups), the corresponding
field is an empty matrix and not an empty struct array for compatibility
with matlab.
@xseealso{ncread,nccreate,ncwriteschema,ncdisp}
@end deftypefn
@c High-level functions ncread
@c -----------------------------------------
@subsection ncread
@cindex ncread
@deftypefn {Function File} {@var{x} =} ncread (@var{filename}, @var{varname})
@deftypefnx {Function File} {@var{x} =} ncread (@var{filename}, @var{varname},@var{start},@var{count},@var{stride})
Read the variable @var{varname} from the NetCDF file @var{filename}.
If @var{start},@var{count} and @var{stride} are present, a subset of the
variable is loaded. The parameter @var{start} contains the starting indices
(1-based), @var{count} is the number of elements and @var{stride} the
increment between two successive elements. These parameters are vectors whose
length is equal to the number of dimension of the variable. Elements of
@var{count} might be Inf which means that as many values as possible are
loaded.
If the variable has the _FillValue attribute, then the corresponding values
are replaced by NaN (except for characters). NetCDF attributes scale_factor
(default 1) and add_offset (default 0) are use the transform the variable
during the loading:
x = scale_factor * x_in_file + add_offset
The output data type matches the NetCDF datatype, except when the attributes
_FillValue, add_offset or scale_factor are defined in which case the output
is a array in double precision.
Note that values equal to the attribute missing_value are not replaced by
NaN (for compatibility).
@subsubheading Example
Read the data from variable 'mydata' in the file test.nc.
@example
data = ncread('test.nc','mydata');
@end example
@xseealso{ncwrite,ncinfo,ncdisp}
@end deftypefn
@c High-level functions ncreadatt
@c -----------------------------------------
@subsection ncreadatt
@cindex ncreadatt
@deftypefn {Function File} {@var{val} =} ncreadatt(@var{filename},@var{varname},@var{attname})
Return the attribute @var{attname} of the variable @var{varname} in the file
@var{filename}.
Global attributes can be accessed by using "/" or the group name as
@var{varname}. The type of attribute is mapped to the Octave data types.
(see @code{ncinfo}).
@subsubheading Example
Read global attribute 'creation_date'
@example
d = ncreadatt('test.nc','/','creation_date')
@end example
Read atribute 'myattr' assigned to variable mydata.
@example
d = ncreadattr('test.nc', 'mydata', 'myattr');
@end example
@xseealso{ncinfo,ncwriteatt}
@end deftypefn
@c High-level functions ncwrite
@c -----------------------------------------
@subsection ncwrite
@cindex ncwrite
@deftypefn {Function File} {} ncwrite (@var{filename}, @var{varname}, @var{x})
@deftypefnx {Function File} {} ncwrite (@var{filename}, @var{varname}, @var{x}, @var{start}, @var{stride})
Write array @var{x} to the the variable @var{varname} in the NetCDF file
@var{filename}.
The variable with the name @var{varname} and the appropriate dimension must
already exist in the NetCDF file.
If @var{start} and @var{stride} are present, a subset of the
variable is written. The parameter @var{start} contains the starting indices
(1-based) and @var{stride} the
increment between two successive elements. These parameters are vectors whose
length is equal to the number of dimension of the variable.
If the variable has the _FillValue attribute, then the values equal to NaN
are replaced by corresponding fill value NetCDF attributes scale_factor
(default 1) and add_oddset (default 0) are use the transform the variable
during writing:
x_in_file = (x - add_offset)/scale_factor
@subsubheading Example
Create a netcdf file with a variable of 'mydata' and then write
data to that variable.
@example
nccreate('myfile.nc','mydata');
ncwrite('myfile.nc','mydata', 101);
@end example
@xseealso{ncread,nccreate}
@end deftypefn
@c High-level functions ncwriteatt
@c -----------------------------------------
@subsection ncwriteatt
@cindex ncwriteatt
@deftypefn {Function File} {} ncwriteatt(@var{filename},@var{varname},@var{attname},@var{val})
Defines the attribute @var{attname} of the variable @var{varname} in the file
@var{filename} with the value @var{val}.
Global attributes can be defined by using "/" or the group name as
@var{varname}. The type of value is mapped to the NetCDF data types.
(see @code{ncinfo}).
@subsubheading Example
Create a netcdf4 format file with a variable mydata and assign an attribute "units" to it.
@example
nccreate("myfile.nc", "mydata", "Format", "netcdf4");
ncwriteatt("myfile.nc", "mydata", "Units", "K");
@end example
@xseealso{ncinfo}
@end deftypefn
@c High-level functions ncwriteschema
@c -----------------------------------------
@subsection ncwriteschema
@cindex ncwriteschema
@deftypefn {Function File} {} ncwriteschema (@var{filename}, @var{schema})
Create a NetCDF called @var{filename} with the dimensions, attributes,
variables and groups given by the structure @var{schema}.
The variable @var{schema} has the same structure as the results of
@code{ncinfo}. @code{ncinfo} and @code{ncwriteschema} can be used together to
create a NetCDF using another file as a template:
@subsubheading Example
@example
schema = ncinfo("template.nc");
# the new file should be named "new_file.nc"
ncwriteschema("new_file.nc",schema);
@end example
Unused field in @var{schema} such as @var{ChunkSize}, @var{Shuffle},
@var{DeflateLevel}, @var{FillValue}, @var{Checksum} can be left-out if the
corresponding feature is not used.
Dimensions are considered as limited if the field @var{Unlimited} is missing,
unless the dimension length is Inf.
@xseealso{ncinfo}
@end deftypefn
@c ---------------------------------------------------
@node Low-level functions (Deprecated)
@section Low-level functions (Deprecated)
@cindex Low-level functions (Deprecated)
@c Low-level functions (Deprecated) netcdf_abort
@c -----------------------------------------
@subsection netcdf_abort
@cindex netcdf_abort
@deftypefn {Loadable Function} {} netcdf_abort(@var{ncid})
Aborts all changes since the last time the dataset entered in define mode.
@end deftypefn
@xseealso{netcdf_reDef}
@c Low-level functions (Deprecated) netcdf_close
@c -----------------------------------------
@subsection netcdf_close
@cindex netcdf_close
@deftypefn {Loadable Function} {} netcdf_close(@var{ncid})
Close the NetCDF file with the id @var{ncid}.
@end deftypefn
@xseealso{netcdf_open}
@c Low-level functions (Deprecated) netcdf_copyAtt
@c -----------------------------------------
@subsection netcdf_copyAtt
@cindex netcdf_copyAtt
@deftypefn {Loadable Function} {} netcdf_copyAtt (@var{ncid},@var{varid},@var{name},@var{ncid_out},@var{varid_out})
Copies the attribute named @var{old_name} of the variable @var{varid} in the data set @var{ncid}
to the variable @var{varid_out} in the data set @var{ncid_out}.
To copy a global attribute use netcdf_getConstant("global") for @var{varid} or @var{varid_out}.
@xseealso{netcdf_getAtt,netcdf_getConstant}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_create
@c -----------------------------------------
@subsection netcdf_create
@cindex netcdf_create
@deftypefn {Loadable Function} {@var{ncid} =} netcdf_create(@var{filename},@var{mode})
Creates the file named @var{filename} in the mode @var{mode} which can have the
following values:
"clobber" (overwrite existing files),
"noclobber" (prevent to overwrite existing files)
"64bit_offset" (use the 64bit-offset format),
"netcdf4" (use the NetCDF4, i.e. HDF5 format) or
"share" (concurrent reading of the dataset).
@var{mode} can also be the numeric value return by netcdf_getConstant. In the later-case it can be combined with a bitwise-or.
@end deftypefn
@subsubheading Example
@example
mode = bitor(netcdf.getConstant("classic_model"), ...
netcdf.getConstant("netcdf4"));
ncid = netcdf.create("test.nc",mode);
@end example
@xseealso{netcdf_close}
@c Low-level functions (Deprecated) netcdf_defDim
@c -----------------------------------------
@subsection netcdf_defDim
@cindex netcdf_defDim
@deftypefn {Loadable Function} {@var{dimid} =} netcdf_defDim(@var{ncid},@var{name},@var{len})
Define the dimension with the name @var{name} and the length @var{len} in the dataset @var{ncid}. The id of the dimension is returned.
@end deftypefn
@xseealso{netcdf_defVar}
@c Low-level functions (Deprecated) netcdf_defGrp
@c -----------------------------------------
@subsection netcdf_defGrp
@cindex netcdf_defGrp
@deftypefn {Loadable Function} {@var{new_ncid} =} netcdf_defGrp(@var{ncid},@var{name})
Define a group in a NetCDF file.
@xseealso{netcdf_inqGrps}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_defVar
@c -----------------------------------------
@subsection netcdf_defVar
@cindex netcdf_defVar
@deftypefn {Loadable Function} {@var{varid} = } netcdf_defVar(@var{ncid},@var{name},@var{xtype},@var{dimids})
Defines a variable with the name @var{name} in the dataset @var{ncid}. @var{xtype} can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf_getConstant. The parameter @var{dimids} define the ids of the dimension. For scalar this parameter is the empty array ([]). The variable id is returned.
@end deftypefn
@xseealso{netcdf_open,netcdf_defDim}
@c Low-level functions (Deprecated) netcdf_defVarChunking
@c -----------------------------------------
@subsection netcdf_defVarChunking
@cindex netcdf_defVarChunking
@deftypefn {Loadable Function} {} netcdf_defVarChunking (@var{ncid},@var{varid},@var{storage},@var{chunkSizes})
Define the chunking settings of NetCDF variable @var{varid}.
If @var{storage} is the string "chunked", the variable is stored by chunk of the size @var{chunkSizes}.
If @var{storage} is the string "contiguous", the variable is stored in a contiguous way.
@end deftypefn
@xseealso{netcdf_inqVarChunking}
@c Low-level functions (Deprecated) netcdf_defVarDeflate
@c -----------------------------------------
@subsection netcdf_defVarDeflate
@cindex netcdf_defVarDeflate
@deftypefn {Loadable Function} {} netcdf_defVarDeflate (@var{ncid},@var{varid},@var{shuffle},@var{deflate},@var{deflate_level})
Define the compression settings NetCDF variable @var{varid}.
If @var{deflate} is true, then the variable is compressed. The compression level @var{deflate_level} is an integer between 0 (no compression) and 9 (maximum compression).
@end deftypefn
@xseealso{netcdf_inqVarDeflate}
@c Low-level functions (Deprecated) netcdf_defVarFill
@c -----------------------------------------
@subsection netcdf_defVarFill
@cindex netcdf_defVarFill
@deftypefn {Loadable Function} {} netcdf_defVarFill(@var{ncid},@var{varid},@var{no_fill},@var{fillvalue})
Define the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@xseealso{netcdf_inqVarFill}
@c Low-level functions (Deprecated) netcdf_defVarFletcher32
@c -----------------------------------------
@subsection netcdf_defVarFletcher32
@cindex netcdf_defVarFletcher32
@deftypefn {Loadable Function} {} netcdf_defVarFletcher32(@var{ncid},@var{varid},@var{checksum})
Defines the checksum settings of the variable with the id @var{varid} in the data set @var{ncid}. If @var{checksum} is the string "FLETCHER32", then fletcher32 checksums will be turned on for this variable. If @var{checksum} is "NOCHECKSUM", then checksums will be disabled.
@end deftypefn
@xseealso{netcdf_defVar,netcdf_inqVarFletcher32}
@c Low-level functions (Deprecated) netcdf_defVlen
@c -----------------------------------------
@subsection netcdf_defVlen
@cindex netcdf_defVlen
@deftypefn {Loadable Function} {@var{varid} = } netcdf_defVlen(@var{ncid},@var{typename},@var{basetype})
Defines a NC_VLEN variable length array type with the type name @var{typename} and a base datatype of @var{basetype} in the dataset @var{ncid}. @var{basetype} can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf_getConstant. The new data type id is returned.
@end deftypefn
@xseealso{netcdf_open,netcdf_defVar, netcdf_inqVlen}
@c Low-level functions (Deprecated) netcdf_delAtt
@c -----------------------------------------
@subsection netcdf_delAtt
@cindex netcdf_delAtt
@deftypefn {Loadable Function} {} netcdf_delAtt(@var{ncid},@var{varid},@var{name})
Deletes the attribute named @var{name} of the variable @var{varid} in the data set @var{ncid}.
To delete a global attribute use netcdf_getConstant("global") for @var{varid}.
@xseealso{netcdf_defAtt,netcdf_getConstant}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_endDef
@c -----------------------------------------
@subsection netcdf_endDef
@cindex netcdf_endDef
@deftypefn {Loadable Function} {} netcdf_endDef (@var{ncid})
Leaves define-mode of NetCDF file @var{ncid}.
@end deftypefn
@xseealso{netcdf_reDef}
@c Low-level functions (Deprecated) netcdf_getAtt
@c -----------------------------------------
@subsection netcdf_getAtt
@cindex netcdf_getAtt
@deftypefn {Loadable Function} {@var{data} =} netcdf_getAtt (@var{ncid},@var{varid},@var{name})
Get the value of a NetCDF attribute.
This function returns the value of the attribute called @var{name} of the variable
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be
netcdf_getConstant("global").
@xseealso{netcdf_putAtt}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_getChunkCache
@c -----------------------------------------
@subsection netcdf_getChunkCache
@cindex netcdf_getChunkCache
@deftypefn {Loadable Function} {[@var{size}, @var{nelems}, @var{preemption}] =} netcdf_getChunkCache()
Gets the default chunk cache settings in the HDF5 library.
@end deftypefn
@xseealso{netcdf_setChunkCache}
@c Low-level functions (Deprecated) netcdf_getConstant
@c -----------------------------------------
@subsection netcdf_getConstant
@cindex netcdf_getConstant
@deftypefn {Loadable Function} {@var{value} =} netcdf_getConstant(@var{name})
Returns the value of a NetCDF constant called @var{name}.
@xseealso{netcdf_getConstantNames}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_getConstantNames
@c -----------------------------------------
@subsection netcdf_getConstantNames
@cindex netcdf_getConstantNames
@deftypefn {Loadable Function} {@var{value} =} netcdf_getConstantNames()
Returns a list of all constant names.
@end deftypefn
@xseealso{netcdf_getConstant}
@c Low-level functions (Deprecated) netcdf_getVar
@c -----------------------------------------
@subsection netcdf_getVar
@cindex netcdf_getVar
@deftypefn {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid})
@deftypefnx {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid},@var{start})
@deftypefnx {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid},@var{start},@var{count})
@deftypefnx {Loadable Function} {@var{data} =} netcdf_getVar (@var{ncid},@var{varid},@var{start},@var{count},@var{stride})
Get the data from a NetCDF variable.
The data @var{data} is loaded from the variable @var{varid} of the NetCDF file @var{ncid}.
@var{start} is the start index of each dimension (0-based and defaults to a vector of zeros),
@var{count} is the number of elements of to be written along each dimension (default all elements)
and @var{stride} is the sampling interval.
@end deftypefn
@xseealso{netcdf_putVar}
@c Low-level functions (Deprecated) netcdf_inq
@c -----------------------------------------
@subsection netcdf_inq
@cindex netcdf_inq
@deftypefn {Loadable Function} {@var{vers} =} netcdf_inqLibVers()
Returns the version of the NetCDF library.
@end deftypefn
@xseealso{netcdf_open}
@c Low-level functions (Deprecated) netcdf_inqAtt
@c -----------------------------------------
@subsection netcdf_inqAtt
@cindex netcdf_inqAtt
@deftypefn {Loadable Function} {@var{name} =} netcdf_inqAttName (@var{ncid},@var{varid},@var{attnum})
Get the name of a NetCDF attribute.
This function returns the name of the attribute with the id @var{attnum} of the variable
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be
netcdf_getConstant("global").
@xseealso{netcdf_inqAttName}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqAttID
@c -----------------------------------------
@subsection netcdf_inqAttID
@cindex netcdf_inqAttID
@deftypefn {Loadable Function} {@var{attnum} =} netcdf_inqAttID(@var{ncid},@var{varid},@var{attname})
Return the attribute id @var{attnum} of the attribute named @var{attname} of the variable @var{varid} in the dataset @var{ncid}.
For global attributes @var{varid} can be
netcdf_getConstant("global").
@xseealso{netcdf_inqAttName}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqAttName
@c -----------------------------------------
@subsection netcdf_inqAttName
@cindex netcdf_inqAttName
@deftypefn {Loadable Function} {@var{name} =} netcdf_inqAttName (@var{ncid},@var{varid},@var{attnum})
Get the name of a NetCDF attribute.
This function returns the name of the attribute with the id @var{attnum} of the variable
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be
netcdf_getConstant("global").
@xseealso{netcdf_inqAttName}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqDim
@c -----------------------------------------
@subsection netcdf_inqDim
@cindex netcdf_inqDim
@deftypefn {Loadable Function} {[@var{name},@var{length}] =} netcdf_inqDim(@var{ncid},@var{dimid})
Returns the name and length of a NetCDF dimension.
@xseealso{netcdf_inqDimID}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqDimID
@c -----------------------------------------
@subsection netcdf_inqDimID
@cindex netcdf_inqDimID
@deftypefn {Loadable Function} {@var{dimid} =} netcdf_inqDimID(@var{ncid},@var{dimname})
Return the id of a NetCDF dimension.
@xseealso{netcdf_inqDim}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqDimIDs
@c -----------------------------------------
@subsection netcdf_inqDimIDs
@cindex netcdf_inqDimIDs
@deftypefn {Loadable Function} {@var{dimids} =} netcdf_inqDimID(@var{ncid})
@deftypefnx {Loadable Function} {@var{dimids} =} netcdf_inqDimID(@var{ncid},@var{include_parents})
Return the dimension ids defined in a NetCDF file.
If @var{include_parents} is 1, the dimension ids of the parent group are also returned.
Per default this is not the case (@var{include_parents} is 0).
@xseealso{netcdf_inqDim}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqFormat
@c -----------------------------------------
@subsection netcdf_inqFormat
@cindex netcdf_inqFormat
@deftypefn {Loadable Function} {@var{format} =} netcdf_inqFormat(@var{ncid})
Return the NetCDF format of the dataset @var{ncid}.
Format might be one of the following
"FORMAT_CLASSIC", "FORMAT_64BIT", "FORMAT_NETCDF4" or "FORMAT_NETCDF4_CLASSIC"
@end deftypefn
@xseealso{netcdf_inq}
@c Low-level functions (Deprecated) netcdf_inqGrpFullNcid
@c -----------------------------------------
@subsection netcdf_inqGrpFullNcid
@cindex netcdf_inqGrpFullNcid
@deftypefn {Loadable Function} {@var{grp_ncid} =} netcdf_inqGrpFullNcid(@var{ncid},@var{name})
Return the group id based on the full group name.
@xseealso{netcdf_inqGrpName}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqGrpName
@c -----------------------------------------
@subsection netcdf_inqGrpName
@cindex netcdf_inqGrpName
@deftypefn {Loadable Function} {@var{name} =} netcdf_inqGrpName(@var{ncid})
Return group name in a NetCDF file.
@xseealso{netcdf_inqGrps}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqGrpNameFull
@c -----------------------------------------
@subsection netcdf_inqGrpNameFull
@cindex netcdf_inqGrpNameFull
@deftypefn {Loadable Function} {@var{name} =} netcdf_inqGrpNameFull(@var{ncid})
Return full name of group in NetCDF file.
@xseealso{netcdf_inqGrpName}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqGrpParent
@c -----------------------------------------
@subsection netcdf_inqGrpParent
@cindex netcdf_inqGrpParent
@deftypefn {Loadable Function} {@var{parent_ncid} =} netcdf_inqGrpParent(@var{ncid})
Return id of the parent group
@xseealso{netcdf_inqGrpName}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqGrps
@c -----------------------------------------
@subsection netcdf_inqGrps
@cindex netcdf_inqGrps
@deftypefn {Loadable Function} {@var{ncids} =} netcdf_inqGrps(@var{ncid})
Return all groups ids in a NetCDF file.
@xseealso{netcdf_inqGrps}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqLibVers
@c -----------------------------------------
@subsection netcdf_inqLibVers
@cindex netcdf_inqLibVers
@deftypefn {Loadable Function} {@var{vers} =} netcdf_inqLibVers()
Returns the version of the NetCDF library.
@end deftypefn
@xseealso{netcdf_open}
@c Low-level functions (Deprecated) netcdf_inqNcid
@c -----------------------------------------
@subsection netcdf_inqNcid
@cindex netcdf_inqNcid
@deftypefn {Loadable Function} {@var{grp_ncid} =} netcdf_inqNcid(@var{ncid},@var{name})
Return group id based on its name
@xseealso{netcdf_inqGrpFullNcid}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqUnlimDims
@c -----------------------------------------
@subsection netcdf_inqUnlimDims
@cindex netcdf_inqUnlimDims
@deftypefn {Loadable Function} {@var{unlimdimids} =} netcdf_inqUnlimDims(@var{ncid})
Return the id of all unlimited dimensions of the NetCDF file @var{ncid}.
@end deftypefn
@xseealso{netcdf_inq}
@c Low-level functions (Deprecated) netcdf_inqUserType
@c -----------------------------------------
@subsection netcdf_inqUserType
@cindex netcdf_inqUserType
@deftypefn {Loadable Function} {[@var{typename}, @var{bytesize}, @var{basetypeid}, @var{numfields}, @var{classid}] = } netcdf_inqUserType(@var{ncid},@var{typeid})
Provide information on a user defined type @var{typeid} in the dataset @var{ncid}.
The function returns the typename, bytesize, base type id, number of fields and class identifier of the type.
@end deftypefn
@xseealso{netcdf_open, netcdf_defVlen, netcdf_inqVlen}
@c Low-level functions (Deprecated) netcdf_inqVar
@c -----------------------------------------
@subsection netcdf_inqVar
@cindex netcdf_inqVar
@deftypefn {Loadable Function} {[@var{no_fill},@var{fillvalue}] = } netcdf_inqVarFill(@var{ncid},@var{varid})
Determines the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@xseealso{netcdf_defVarFill}
@c Low-level functions (Deprecated) netcdf_inqVarChunking
@c -----------------------------------------
@subsection netcdf_inqVarChunking
@cindex netcdf_inqVarChunking
@deftypefn {Loadable Function} {[@var{storage},@var{chunkSizes}] = } netcdf_inqVarChunking (@var{ncid},@var{varid})
Determines the chunking settings of NetCDF variable @var{varid}.
If @var{storage} is the string "chunked", the variable is stored by chunk of the size @var{chunkSizes}.
If @var{storage} is the string "contiguous", the variable is stored in a contiguous way.
@end deftypefn
@xseealso{netcdf_defVarChunking}
@c Low-level functions (Deprecated) netcdf_inqVarDeflate
@c -----------------------------------------
@subsection netcdf_inqVarDeflate
@cindex netcdf_inqVarDeflate
@deftypefn {Loadable Function} {[@var{shuffle},@var{deflate},@var{deflate_level}] = } netcdf_inqVarDeflate (@var{ncid},@var{varid})
Determines the compression settings NetCDF variable @var{varid}.
If @var{deflate} is true, then the variable is compressed. The compression level @var{deflate_level} is an integer between 0 (no compression) and 9 (maximum compression).
@end deftypefn
@xseealso{netcdf_defVarDeflate}
@c Low-level functions (Deprecated) netcdf_inqVarFill
@c -----------------------------------------
@subsection netcdf_inqVarFill
@cindex netcdf_inqVarFill
@deftypefn {Loadable Function} {[@var{no_fill},@var{fillvalue}] = } netcdf_inqVarFill(@var{ncid},@var{varid})
Determines the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@xseealso{netcdf_defVarFill}
@c Low-level functions (Deprecated) netcdf_inqVarFletcher32
@c -----------------------------------------
@subsection netcdf_inqVarFletcher32
@cindex netcdf_inqVarFletcher32
@deftypefn {Loadable Function} {@var{checksum} =} netcdf_inqVarFletcher32(@var{ncid},@var{varid})
Determines the checksum settings of the variable with the id @var{varid} in the data set @var{ncid}. If fletcher32 checksums is turned on for this variable, then @var{checksum} is the string "FLETCHER32". Otherwise it is the string "NOCHECKSUM".
@end deftypefn
@xseealso{netcdf_defVar,netcdf_inqVarFletcher32}
@c Low-level functions (Deprecated) netcdf_inqVarID
@c -----------------------------------------
@subsection netcdf_inqVarID
@cindex netcdf_inqVarID
@deftypefn {Loadable Function} {@var{varid} = } netcdf_inqVarID (@var{ncid},@var{name})
Return the id of a variable based on its name.
@xseealso{netcdf_defVar,netcdf_inqVarIDs}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqVarIDs
@c -----------------------------------------
@subsection netcdf_inqVarIDs
@cindex netcdf_inqVarIDs
@deftypefn {Loadable Function} {@var{varids} = } netcdf_inqVarID (@var{ncid})
Return all variable ids.
This functions returns all variable ids in a NetCDF file or NetCDF group.
@xseealso{netcdf_inqVarID}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_inqVlen
@c -----------------------------------------
@subsection netcdf_inqVlen
@cindex netcdf_inqVlen
@deftypefn {Loadable Function} {[@var{typename}, @var{bytesize}, @var{basetypeid}] = } netcdf_inqVlen(@var{ncid},@var{typeid})
Provide information on a NC_VLEN variable length array type @var{typeid} in the dataset @var{ncid}.
The function returns the typename, bytesize, and base type id.
@end deftypefn
@xseealso{netcdf_open, netcdf_defVlen}
@c Low-level functions (Deprecated) netcdf_open
@c -----------------------------------------
@subsection netcdf_open
@cindex netcdf_open
@deftypefn {Loadable Function} {@var{ncid} =} netcdf_open(@var{filename},@var{mode})
Opens the file named @var{filename} in the mode @var{mode}.
@end deftypefn
@xseealso{netcdf_close}
@c Low-level functions (Deprecated) netcdf_putAtt
@c -----------------------------------------
@subsection netcdf_putAtt
@cindex netcdf_putAtt
@deftypefn {Loadable Function} {} netcdf_putAtt (@var{ncid},@var{varid},@var{name},@var{data})
Defines a NetCDF attribute.
This function defines the attribute called @var{name} of the variable
@var{varid} in the NetCDF file @var{ncid}. The value of the attribute will be @var{data}.
For global attributes @var{varid} can be
netcdf_getConstant("global").
@xseealso{netcdf_getAtt}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_putVar
@c -----------------------------------------
@subsection netcdf_putVar
@cindex netcdf_putVar
@deftypefn {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{data})
@deftypefnx {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{start},@var{data})
@deftypefnx {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{start},@var{count},@var{data})
@deftypefnx {Loadable Function} {} netcdf_putVar (@var{ncid},@var{varid},@var{start},@var{count},@var{stride},@var{data})
Put data in a NetCDF variable.
The data @var{data} is stored in the variable @var{varid} of the NetCDF file @var{ncid}.
@var{start} is the start index of each dimension (0-based and defaults to a vector of zeros),
@var{count} is the number of elements of to be written along each dimension (default all elements)
and @var{stride} is the sampling interval.
@end deftypefn
@xseealso{netcdf_endDef}
@c Low-level functions (Deprecated) netcdf_reDef
@c -----------------------------------------
@subsection netcdf_reDef
@cindex netcdf_reDef
@deftypefn {Loadable Function} {} netcdf_reDef (@var{ncid})
Enter define-mode of NetCDF file @var{ncid}.
@end deftypefn
@xseealso{netcdf_endDef}
@c Low-level functions (Deprecated) netcdf_renameAtt
@c -----------------------------------------
@subsection netcdf_renameAtt
@cindex netcdf_renameAtt
@deftypefn {Loadable Function} {} netcdf_renameAtt(@var{ncid},@var{varid},@var{old_name},@var{new_name})
Renames the attribute named @var{old_name} of the variable @var{varid} in the data set @var{ncid}. @var{new_name} is the new name of the attribute.
To rename a global attribute use netcdf_getConstant("global") for @var{varid}.
@xseealso{netcdf_copyAtt,netcdf_getConstant}
@end deftypefn
@c Low-level functions (Deprecated) netcdf_renameDim
@c -----------------------------------------
@subsection netcdf_renameDim
@cindex netcdf_renameDim
@deftypefn {Loadable Function} {} netcdf_renameDim(@var{ncid},@var{dimid},@var{name})
Renames the dimension with the id @var{dimid} in the data set @var{ncid}. @var{name} is the new name of the dimension.
@end deftypefn
@xseealso{netcdf_defDim}
@c Low-level functions (Deprecated) netcdf_renameVar
@c -----------------------------------------
@subsection netcdf_renameVar
@cindex netcdf_renameVar
@deftypefn {Loadable Function} {} netcdf_renameVar(@var{ncid},@var{varid},@var{name})
Renames the variable with the id @var{varid} in the data set @var{ncid}. @var{name} is the new name of the variable.
@end deftypefn
@xseealso{netcdf_defVar}
@c Low-level functions (Deprecated) netcdf_setChunkCache
@c -----------------------------------------
@subsection netcdf_setChunkCache
@cindex netcdf_setChunkCache
@deftypefn {Loadable Function} {} netcdf_setChunkCache(@var{size}, @var{nelems}, @var{preemption})
Sets the default chunk cache settings in the HDF5 library. The settings applies to all files which are subsequently opened or created.
@end deftypefn
@xseealso{netcdf_getChunkCache}
@c Low-level functions (Deprecated) netcdf_setDefaultFormat
@c -----------------------------------------
@subsection netcdf_setDefaultFormat
@cindex netcdf_setDefaultFormat
@deftypefn {Loadable Function} {@var{old_format} =} netcdf_setDefaultFormat(@var{format})
Sets the default format of the NetCDF library and returns the previous default format (as a numeric value). @var{format} can be
"format_classic", "format_64bit", "format_netcdf4" or "format_netcdf4_classic".
@end deftypefn
@xseealso{netcdf_open}
@c Low-level functions (Deprecated) netcdf_setFill
@c -----------------------------------------
@subsection netcdf_setFill
@cindex netcdf_setFill
@deftypefn {Loadable Function} {@var{old_mode} =} netcdf_setFill(@var{ncid},@var{fillmode})
Change the fill mode (@var{fillmode}) of the data set @var{ncid}. The previous value of the fill mode is returned. @var{fillmode} can be either "fill" or "nofill".
@end deftypefn
@xseealso{netcdf_open}
@c Low-level functions (Deprecated) netcdf_sync
@c -----------------------------------------
@subsection netcdf_sync
@cindex netcdf_sync
@deftypefn {Loadable Function} {} netcdf_sync(@var{ncid})
Writes all changes to the disk and leaves the file open.
@end deftypefn
@xseealso{netcdf_close}
@c ---------------------------------------------------
@node Low-level functions
@section Low-level functions
@cindex Low-level functions
@c Low-level functions netcdf.abort
@c -----------------------------------------
@subsection netcdf.abort
@cindex abort
@deftypefn {} {} netcdf.abort(@var{ncid})
Aborts all changes since the last time the dataset entered in define mode.
@end deftypefn
@c Low-level functions netcdf.close
@c -----------------------------------------
@subsection netcdf.close
@cindex close
@deftypefn {} {} netcdf.close(@var{ncid})
Close the NetCDF file with the id @var{ncid}.
@end deftypefn
@c Low-level functions netcdf.copyAtt
@c -----------------------------------------
@subsection netcdf.copyAtt
@cindex copyAtt
@deftypefn {} {} netcdf.copyAtt (@var{ncid},@var{varid},@var{name},@var{ncid_out},@var{varid_out})
Copies the attribute named @var{old_name} of the variable @var{varid} in the data set @var{ncid}
to the variable @var{varid_out} in the data set @var{ncid_out}.
To copy a global attribute use netcdf.getConstant("global") for @var{varid} or @var{varid_out}.
@xseealso{netcdf.getAtt,netcdf.getConstant}
@end deftypefn
@c Low-level functions netcdf.create
@c -----------------------------------------
@subsection netcdf.create
@cindex create
@deftypefn {} {@var{ncid} =} netcdf.create(@var{filename},@var{mode})
Creates the file named @var{filename} in the mode @var{mode} which can have the
following values:
"clobber" (overwrite existing files),
"noclobber" (prevent to overwrite existing files)
"64bit_offset" (use the 64bit-offset format),
"netcdf4" (use the NetCDF4, i.e. HDF5 format) or
"share" (concurrent reading of the dataset).
@var{mode} can also be the numeric value return by netcdf.getConstant. In the later-case it can be combined with a bitwise-or.
@end deftypefn
@subsubheading Example
@example
mode = bitor(netcdf.getConstant("classic_model"), ...
netcdf.getConstant("netcdf4"));
ncid = netcdf.create("test.nc",mode);
@end example
@c Low-level functions netcdf.defDim
@c -----------------------------------------
@subsection netcdf.defDim
@cindex defDim
@deftypefn {} {@var{dimid} =} netcdf.defDim(@var{ncid},@var{name},@var{len})
Define the dimension with the name @var{name} and the length @var{len} in the dataset @var{ncid}. The id of the dimension is returned.
@end deftypefn
@c Low-level functions netcdf.defGrp
@c -----------------------------------------
@subsection netcdf.defGrp
@cindex defGrp
@deftypefn {} {@var{new_ncid} =} netcdf.defGrp(@var{ncid},@var{name})
Define a group in a NetCDF file.
@xseealso{netcdf.inqGrps}
@end deftypefn
@c Low-level functions netcdf.defVar
@c -----------------------------------------
@subsection netcdf.defVar
@cindex defVar
@deftypefn {} {@var{varid} = } netcdf.defVar(@var{ncid},@var{name},@var{xtype},@var{dimids})
Defines a variable with the name @var{name} in the dataset @var{ncid}. @var{xtype} can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf.getConstant. The parameter @var{dimids} define the ids of the dimension. For scalar this parameter is the empty array ([]). The variable id is returned.
@end deftypefn
@c Low-level functions netcdf.defVarChunking
@c -----------------------------------------
@subsection netcdf.defVarChunking
@cindex defVarChunking
@deftypefn {} {} netcdf.defVarChunking (@var{ncid},@var{varid},@var{storage},@var{chunkSizes})
Define the chunking settings of NetCDF variable @var{varid}.
If @var{storage} is the string "chunked", the variable is stored by chunk of the size @var{chunkSizes}.
If @var{storage} is the string "contiguous", the variable is stored in a contiguous way.
@end deftypefn
@c Low-level functions netcdf.defVarDeflate
@c -----------------------------------------
@subsection netcdf.defVarDeflate
@cindex defVarDeflate
@deftypefn {} {} netcdf.defVarDeflate (@var{ncid},@var{varid},@var{shuffle},@var{deflate},@var{deflate_level})
Define the compression settings NetCDF variable @var{varid}.
If @var{deflate} is true, then the variable is compressed. The compression level @var{deflate_level} is an integer between 0 (no compression) and 9 (maximum compression).
@end deftypefn
@c Low-level functions netcdf.defVarFill
@c -----------------------------------------
@subsection netcdf.defVarFill
@cindex defVarFill
@deftypefn {} {} netcdf.defVarFill(@var{ncid},@var{varid},@var{no_fill},@var{fillvalue})
Define the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@c Low-level functions netcdf.defVarFletcher32
@c -----------------------------------------
@subsection netcdf.defVarFletcher32
@cindex defVarFletcher32
@deftypefn {} {} netcdf.defVarFletcher32(@var{ncid},@var{varid},@var{checksum})
Defines the checksum settings of the variable with the id @var{varid} in the data set @var{ncid}. If @var{checksum} is the string "FLETCHER32", then fletcher32 checksums will be turned on for this variable. If @var{checksum} is "NOCHECKSUM", then checksums will be disabled.
@end deftypefn
@c Low-level functions netcdf.defVlen
@c -----------------------------------------
@subsection netcdf.defVlen
@cindex defVlen
@deftypefn {} {@var{varid} = } netcdf.defVlen(@var{ncid},@var{typename},@var{basetype})
Defines a NC_VLEN variable length array type with the type name @var{typename} and a base datatype of @var{basetype} in the dataset @var{ncid}. @var{basetype} can be "byte", "ubyte", "short", "ushort", "int", "uint", "int64", "uint64", "float", "double", "char" or the corresponding number as returned by netcdf.getConstant. The new data type id is returned.
@end deftypefn
@c Low-level functions netcdf.delAtt
@c -----------------------------------------
@subsection netcdf.delAtt
@cindex delAtt
@deftypefn {} {} netcdf.delAtt(@var{ncid},@var{varid},@var{name})
Deletes the attribute named @var{name} of the variable @var{varid} in the data set @var{ncid}.
To delete a global attribute use netcdf.getConstant("global") for @var{varid}.
@xseealso{netcdf.defAtt,netcdf.getConstant}
@end deftypefn
@c Low-level functions netcdf.endDef
@c -----------------------------------------
@subsection netcdf.endDef
@cindex endDef
@deftypefn {} {} netcdf.endDef (@var{ncid})
Leaves define-mode of NetCDF file @var{ncid}.
@end deftypefn
@c Low-level functions netcdf.getAtt
@c -----------------------------------------
@subsection netcdf.getAtt
@cindex getAtt
@deftypefn {} {@var{data} =} netcdf.getAtt (@var{ncid},@var{varid},@var{name})
Get the value of a NetCDF attribute.
This function returns the value of the attribute called @var{name} of the variable
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be
netcdf.getConstant("global").
@xseealso{netcdf.putAtt}
@end deftypefn
@c Low-level functions netcdf.getChunkCache
@c -----------------------------------------
@subsection netcdf.getChunkCache
@cindex getChunkCache
@deftypefn {} {[@var{size}, @var{nelems}, @var{preemption}] =} netcdf.getChunkCache()
Gets the default chunk cache settings in the HDF5 library.
@end deftypefn
@c Low-level functions netcdf.getConstant
@c -----------------------------------------
@subsection netcdf.getConstant
@cindex getConstant
@deftypefn {} {@var{value} =} netcdf.getConstant(@var{name})
Returns the value of a NetCDF constant called @var{name}.
@xseealso{netcdf.getConstantNames}
@end deftypefn
@c Low-level functions netcdf.getConstantNames
@c -----------------------------------------
@subsection netcdf.getConstantNames
@cindex getConstantNames
@deftypefn {} {@var{value} =} netcdf.getConstantNames()
Returns a list of all constant names.
@end deftypefn
@c Low-level functions netcdf.getVar
@c -----------------------------------------
@subsection netcdf.getVar
@cindex getVar
@deftypefn {} {@var{data} =} netcdf.getVar (@var{ncid},@var{varid})
@deftypefnx {} {@var{data} =} netcdf.getVar (@var{ncid},@var{varid},@var{start})
@deftypefnx {} {@var{data} =} netcdf.getVar (@var{ncid},@var{varid},@var{start},@var{count})
@deftypefnx {} {@var{data} =} netcdf.getVar (@var{ncid},@var{varid},@var{start},@var{count},@var{stride})
Get the data from a NetCDF variable.
The data @var{data} is loaded from the variable @var{varid} of the NetCDF file @var{ncid}.
@var{start} is the start index of each dimension (0-based and defaults to a vector of zeros),
@var{count} is the number of elements of to be written along each dimension (default all elements)
and @var{stride} is the sampling interval.
@end deftypefn
@c Low-level functions netcdf.inq
@c -----------------------------------------
@subsection netcdf.inq
@cindex inq
@deftypefn {} {[@var{ndims},@var{nvars},@var{ngatts},@var{unlimdimid}] =} netcdf.inq(@var{ncid})
Return the number of dimension (@var{ndims}), the number of variables (@var{nvars}), the number of global attributes (@var{ngatts}) and the id of the unlimited dimension (@var{unlimdimid}).
If no unlimited dimension is declared -1 is returned. For NetCDF4 files, one should use
the function netcdf.inqUnlimDims as multiple unlimite dimension exists.
@end deftypefn
@c Low-level functions netcdf.inqAtt
@c -----------------------------------------
@subsection netcdf.inqAtt
@cindex inqAtt
@deftypefn {} {[@var{xtype},@var{len}] = } netcdf.inqAtt(@var{ncid},@var{varid},@var{name})
Get attribute type and length.
@xseealso{netcdf.inqAttName}
@end deftypefn
@c Low-level functions netcdf.inqAttID
@c -----------------------------------------
@subsection netcdf.inqAttID
@cindex inqAttID
@deftypefn {} {@var{attnum} =} netcdf.inqAttID(@var{ncid},@var{varid},@var{attname})
Return the attribute id @var{attnum} of the attribute named @var{attname} of the variable @var{varid} in the dataset @var{ncid}.
For global attributes @var{varid} can be
netcdf.getConstant("global").
@xseealso{netcdf.inqAttName}
@end deftypefn
@c Low-level functions netcdf.inqAttName
@c -----------------------------------------
@subsection netcdf.inqAttName
@cindex inqAttName
@deftypefn {} {@var{name} =} netcdf.inqAttName (@var{ncid},@var{varid},@var{attnum})
Get the name of a NetCDF attribute.
This function returns the name of the attribute with the id @var{attnum} of the variable
@var{varid} in the NetCDF file @var{ncid}. For global attributes @var{varid} can be
netcdf.getConstant("global").
@xseealso{netcdf.inqAttName}
@end deftypefn
@c Low-level functions netcdf.inqDim
@c -----------------------------------------
@subsection netcdf.inqDim
@cindex inqDim
@deftypefn {} {[@var{name},@var{length}] =} netcdf.inqDim(@var{ncid},@var{dimid})
Returns the name and length of a NetCDF dimension.
@xseealso{netcdf.inqDimID}
@end deftypefn
@c Low-level functions netcdf.inqDimID
@c -----------------------------------------
@subsection netcdf.inqDimID
@cindex inqDimID
@deftypefn {} {@var{dimid} =} netcdf.inqDimID(@var{ncid},@var{dimname})
Return the id of a NetCDF dimension.
@xseealso{netcdf.inqDim}
@end deftypefn
@c Low-level functions netcdf.inqDimIDs
@c -----------------------------------------
@subsection netcdf.inqDimIDs
@cindex inqDimIDs
@deftypefn {} {@var{dimids} =} netcdf.inqDimID(@var{ncid})
@deftypefnx {} {@var{dimids} =} netcdf.inqDimID(@var{ncid},@var{include_parents})
Return the dimension ids defined in a NetCDF file.
If @var{include_parents} is 1, the dimension ids of the parent group are also returned.
Per default this is not the case (@var{include_parents} is 0).
@xseealso{netcdf.inqDim}
@end deftypefn
@c Low-level functions netcdf.inqFormat
@c -----------------------------------------
@subsection netcdf.inqFormat
@cindex inqFormat
@deftypefn {} {@var{format} =} netcdf.inqFormat(@var{ncid})
Return the NetCDF format of the dataset @var{ncid}.
Format might be one of the following
"FORMAT_CLASSIC", "FORMAT_64BIT", "FORMAT_NETCDF4" or "FORMAT_NETCDF4_CLASSIC"
@end deftypefn
@c Low-level functions netcdf.inqGrpFullNcid
@c -----------------------------------------
@subsection netcdf.inqGrpFullNcid
@cindex inqGrpFullNcid
@deftypefn {} {@var{grp_ncid} =} netcdf.inqGrpFullNcid(@var{ncid},@var{name})
Return the group id based on the full group name.
@xseealso{netcdf.inqGrpName}
@end deftypefn
@c Low-level functions netcdf.inqGrpName
@c -----------------------------------------
@subsection netcdf.inqGrpName
@cindex inqGrpName
@deftypefn {} {@var{name} =} netcdf.inqGrpName(@var{ncid})
Return group name in a NetCDF file.
@xseealso{netcdf.inqGrps}
@end deftypefn
@c Low-level functions netcdf.inqGrpNameFull
@c -----------------------------------------
@subsection netcdf.inqGrpNameFull
@cindex inqGrpNameFull
@deftypefn {} {@var{name} =} netcdf.inqGrpNameFull(@var{ncid})
Return full name of group in NetCDF file.
@xseealso{netcdf.inqGrpName}
@end deftypefn
@c Low-level functions netcdf.inqGrpParent
@c -----------------------------------------
@subsection netcdf.inqGrpParent
@cindex inqGrpParent
@deftypefn {} {@var{parent_ncid} =} netcdf.inqGrpParent(@var{ncid})
Return id of the parent group
@xseealso{netcdf.inqGrpName}
@end deftypefn
@c Low-level functions netcdf.inqGrps
@c -----------------------------------------
@subsection netcdf.inqGrps
@cindex inqGrps
@deftypefn {} {@var{ncids} =} netcdf.inqGrps(@var{ncid})
Return all groups ids in a NetCDF file.
@xseealso{netcdf.inqGrps}
@end deftypefn
@c Low-level functions netcdf.inqLibVers
@c -----------------------------------------
@subsection netcdf.inqLibVers
@cindex inqLibVers
@deftypefn {} {@var{vers} =} netcdf.inqLibVers()
Returns the version of the NetCDF library.
@end deftypefn
@c Low-level functions netcdf.inqNcid
@c -----------------------------------------
@subsection netcdf.inqNcid
@cindex inqNcid
@deftypefn {} {@var{grp_ncid} =} netcdf.inqNcid(@var{ncid},@var{name})
Return group id based on its name
@xseealso{netcdf.inqGrpFullNcid}
@end deftypefn
@c Low-level functions netcdf.inqUnlimDims
@c -----------------------------------------
@subsection netcdf.inqUnlimDims
@cindex inqUnlimDims
@deftypefn {} {@var{unlimdimids} =} netcdf.inqUnlimDims(@var{ncid})
Return the id of all unlimited dimensions of the NetCDF file @var{ncid}.
@end deftypefn
@c Low-level functions netcdf.inqUserType
@c -----------------------------------------
@subsection netcdf.inqUserType
@cindex inqUserType
@deftypefn {} {[@var{typename}, @var{bytesize}, @var{basetypeid}, @var{numfields}, @var{classid}] = } netcdf.inqUserType(@var{ncid},@var{typeid})
Provide information on a user defined type @var{typeid} in the dataset @var{ncid}.
The function returns the typename, bytesize, base type id, number of fields and class identifier of the type.
@end deftypefn
@c Low-level functions netcdf.inqVar
@c -----------------------------------------
@subsection netcdf.inqVar
@cindex inqVar
@deftypefn {} {[@var{name},@var{nctype},@var{dimids},@var{nattr}] = } netcdf.inqVar (@var{ncid},@var{varid})
Inquires information about a NetCDF variable.
This functions returns the @var{name}, the NetCDF type @var{nctype}, an array of dimension ids
@var{dimids} and the number of attributes @var{nattr} of the NetCDF variable. @var{nctype} in an
integer corresponding NetCDF constants.
@xseealso{netcdf.inqVarID,netcdf.getConstant}
@end deftypefn
@c Low-level functions netcdf.inqVarChunking
@c -----------------------------------------
@subsection netcdf.inqVarChunking
@cindex inqVarChunking
@deftypefn {} {[@var{storage},@var{chunkSizes}] = } netcdf.inqVarChunking (@var{ncid},@var{varid})
Determines the chunking settings of NetCDF variable @var{varid}.
If @var{storage} is the string "chunked", the variable is stored by chunk of the size @var{chunkSizes}.
If @var{storage} is the string "contiguous", the variable is stored in a contiguous way.
@end deftypefn
@c Low-level functions netcdf.inqVarDeflate
@c -----------------------------------------
@subsection netcdf.inqVarDeflate
@cindex inqVarDeflate
@deftypefn {} {[@var{shuffle},@var{deflate},@var{deflate_level}] = } netcdf.inqVarDeflate (@var{ncid},@var{varid})
Determines the compression settings NetCDF variable @var{varid}.
If @var{deflate} is true, then the variable is compressed. The compression level @var{deflate_level} is an integer between 0 (no compression) and 9 (maximum compression).
@end deftypefn
@c Low-level functions netcdf.inqVarFill
@c -----------------------------------------
@subsection netcdf.inqVarFill
@cindex inqVarFill
@deftypefn {} {[@var{no_fill},@var{fillvalue}] = } netcdf.inqVarFill(@var{ncid},@var{varid})
Determines the fill-value settings of the NetCDF variable @var{varid}.
If @var{no_fill} is false, then the values between no-contiguous writes are filled with the value @var{fill_value}. This is disabled by setting @var{no_fill} to true.
@end deftypefn
@c Low-level functions netcdf.inqVarFletcher32
@c -----------------------------------------
@subsection netcdf.inqVarFletcher32
@cindex inqVarFletcher32
@deftypefn {} {@var{checksum} =} netcdf.inqVarFletcher32(@var{ncid},@var{varid})
Determines the checksum settings of the variable with the id @var{varid} in the data set @var{ncid}. If fletcher32 checksums is turned on for this variable, then @var{checksum} is the string "FLETCHER32". Otherwise it is the string "NOCHECKSUM".
@end deftypefn
@c Low-level functions netcdf.inqVarID
@c -----------------------------------------
@subsection netcdf.inqVarID
@cindex inqVarID
@deftypefn {} {@var{varid} = } netcdf.inqVarID (@var{ncid},@var{name})
Return the id of a variable based on its name.
@xseealso{netcdf.defVar,netcdf.inqVarIDs}
@end deftypefn
@c Low-level functions netcdf.inqVarIDs
@c -----------------------------------------
@subsection netcdf.inqVarIDs
@cindex inqVarIDs
@deftypefn {} {@var{varids} = } netcdf.inqVarID (@var{ncid})
Return all variable ids.
This functions returns all variable ids in a NetCDF file or NetCDF group.
@xseealso{netcdf.inqVarID}
@end deftypefn
@c Low-level functions netcdf.inqVlen
@c -----------------------------------------
@subsection netcdf.inqVlen
@cindex inqVlen
@deftypefn {} {[@var{typename}, @var{bytesize}, @var{basetypeid}] = } netcdf.inqVlen(@var{ncid},@var{typeid})
Provide information on a NC_VLEN variable length array type @var{typeid} in the dataset @var{ncid}.
The function returns the typename, bytesize, and base type id.
@end deftypefn
@c Low-level functions netcdf.open
@c -----------------------------------------
@subsection netcdf.open
@cindex open
@deftypefn {} {@var{ncid} =} netcdf.open(@var{filename},@var{mode})
Opens the file named @var{filename} in the mode @var{mode}.
@end deftypefn
@c Low-level functions netcdf.putAtt
@c -----------------------------------------
@subsection netcdf.putAtt
@cindex putAtt
@deftypefn {} {} netcdf.putAtt (@var{ncid},@var{varid},@var{name},@var{data})
Defines a NetCDF attribute.
This function defines the attribute called @var{name} of the variable
@var{varid} in the NetCDF file @var{ncid}. The value of the attribute will be @var{data}.
For global attributes @var{varid} can be
netcdf.getConstant("global").
@xseealso{netcdf.getAtt}
@end deftypefn
@c Low-level functions netcdf.putVar
@c -----------------------------------------
@subsection netcdf.putVar
@cindex putVar
@deftypefn {} {} netcdf.putVar (@var{ncid},@var{varid},@var{data})
@deftypefnx {} {} netcdf.putVar (@var{ncid},@var{varid},@var{start},@var{data})
@deftypefnx {} {} netcdf.putVar (@var{ncid},@var{varid},@var{start},@var{count},@var{data})
@deftypefnx {} {} netcdf.putVar (@var{ncid},@var{varid},@var{start},@var{count},@var{stride},@var{data})
Put data in a NetCDF variable.
The data @var{data} is stored in the variable @var{varid} of the NetCDF file @var{ncid}.
@var{start} is the start index of each dimension (0-based and defaults to a vector of zeros),
@var{count} is the number of elements of to be written along each dimension (default all elements)
and @var{stride} is the sampling interval.
@end deftypefn
@c Low-level functions netcdf.reDef
@c -----------------------------------------
@subsection netcdf.reDef
@cindex reDef
@deftypefn {} {} netcdf.reDef (@var{ncid})
Enter define-mode of NetCDF file @var{ncid}.
@end deftypefn
@c Low-level functions netcdf.renameAtt
@c -----------------------------------------
@subsection netcdf.renameAtt
@cindex renameAtt
@deftypefn {} {} netcdf.renameAtt(@var{ncid},@var{varid},@var{old_name},@var{new_name})
Renames the attribute named @var{old_name} of the variable @var{varid} in the data set @var{ncid}. @var{new_name} is the new name of the attribute.
To rename a global attribute use netcdf.getConstant("global") for @var{varid}.
@xseealso{netcdf.copyAtt,netcdf.getConstant}
@end deftypefn
@c Low-level functions netcdf.renameDim
@c -----------------------------------------
@subsection netcdf.renameDim
@cindex renameDim
@deftypefn {} {} netcdf.renameDim(@var{ncid},@var{dimid},@var{name})
Renames the dimension with the id @var{dimid} in the data set @var{ncid}. @var{name} is the new name of the dimension.
@end deftypefn
@c Low-level functions netcdf.renameVar
@c -----------------------------------------
@subsection netcdf.renameVar
@cindex renameVar
@deftypefn {} {} netcdf.renameVar(@var{ncid},@var{varid},@var{name})
Renames the variable with the id @var{varid} in the data set @var{ncid}. @var{name} is the new name of the variable.
@end deftypefn
@c Low-level functions netcdf.setChunkCache
@c -----------------------------------------
@subsection netcdf.setChunkCache
@cindex setChunkCache
@deftypefn {} {} netcdf.setChunkCache(@var{size}, @var{nelems}, @var{preemption})
Sets the default chunk cache settings in the HDF5 library. The settings applies to all files which are subsequently opened or created.
@end deftypefn
@c Low-level functions netcdf.setDefaultFormat
@c -----------------------------------------
@subsection netcdf.setDefaultFormat
@cindex setDefaultFormat
@deftypefn {} {@var{old_format} =} netcdf.setDefaultFormat(@var{format})
Sets the default format of the NetCDF library and returns the previous default format (as a numeric value). @var{format} can be
"format_classic", "format_64bit", "format_netcdf4" or "format_netcdf4_classic".
@end deftypefn
@c Low-level functions netcdf.setFill
@c -----------------------------------------
@subsection netcdf.setFill
@cindex setFill
@deftypefn {} {@var{old_mode} =} netcdf.setFill(@var{ncid},@var{fillmode})
Change the fill mode (@var{fillmode}) of the data set @var{ncid}. The previous value of the fill mode is returned. @var{fillmode} can be either "fill" or "nofill".
@end deftypefn
@c Low-level functions netcdf.sync
@c -----------------------------------------
@subsection netcdf.sync
@cindex sync
@deftypefn {} {} netcdf.sync(@var{ncid})
Writes all changes to the disk and leaves the file open.
@end deftypefn
@c ---------------------------------------------------
@node Import functions (Deprecated)
@section Import functions (Deprecated)
@cindex Import functions (Deprecated)
@c Import functions (Deprecated) import_netcdf
@c -----------------------------------------
@subsection import_netcdf
@cindex import_netcdf
@deftypefn {} {} import_fits
Dummy function provided to provide compatibility with older versions of GNU Octave netcdf
Function is deprecated.
@end deftypefn
@c ---------------------------------------------------
@node Test function
@section Test function
@cindex Test function
@c Test function test_netcdf
@c -----------------------------------------
@subsection test_netcdf
@cindex test_netcdf
@deftypefn {} {} test_netcdf
Function to do a basic test of the netcdf interface
@end deftypefn
|