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 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
|
<?xml version="1.0" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ref_man.rd</title>
</head>
<body>
<h1><a name="label:0" id="label:0">RubyNetCDF Reference Manual</a></h1><!-- RDLabel: "RubyNetCDF Reference Manual" -->
<ul>
<li><a href="#label:9">Method Index</a></li>
</ul>
<p>---------------------------------------------</p>
<h2><a name="label:1" id="label:1">Overview</a></h2><!-- RDLabel: "Overview" -->
<p>RubyNetCDF is the Ruby interface of the NetCDF library. Ruby is a free
object-oriented scripting language and is freely available from
<a href="http://www.ruby-lang.org/">the Ruby homepage</a>.
To handle numeric data, RubyNetCDF uses
<a href="http://www.ruby-lang.org/en/raa-list.rhtml?name=NArray">NArray</a>, which is the standard numeric multi-dimensional array class
for Ruby. Thus, you have to have installed it before installing this library.
An NArray object holds numeric data in a consecutive memory area
pointed by a C pointer. Thus, it is computationally efficient.
NArray is similar to NumPy for Python, but results of some benchmark
tests suggests that NArray is more efficient than NumPy.
Optionally, RubyNetCDF offers methods to handle data missing
automatically. To use it, you will also
need <a href="http://ruby.gfd-dennou.org/products/narray_miss/">NArrayMiss</a>.
See <a href="#label:6">Usage</a> for details.</p>
<h3><a name="label:2" id="label:2">Structure</a></h3><!-- RDLabel: "Structure" -->
<p>RubyNetCDF consists of the four classes in the following.</p>
<ul>
<li><p><a href="#label:10">class NetCDF</a> -- the file class</p>
<p>An NetCDF object represents a NetCDF file</p></li>
<li><p><a href="#label:43">class NetCDFDim</a> -- the dimension class</p>
<p>Although in its C version a NetCDF dimension is represented by a
combination of a file ID and a dimension ID, it is represented by
only one NetCDFDim object in RubyNetCDF.</p></li>
<li><p><a href="#label:51">class NetCDFVar</a> -- the variable class</p>
<p>Although in its C version a NetCDF variable is represented by a
combination of a file ID and a variable ID, it is represented by
only one NetCDFVar object in RubyNetCDF.</p></li>
<li><p><a href="#label:90">class NetCDFAtt</a> -- the attribute class</p>
<p>Although in its C version a NetCDF attribute is represented by a
combination of file ID, variable ID, and its name, it is represented
by only one NetCDFAtt object in RubyNetCDF.</p></li>
</ul>
<h3><a name="label:3" id="label:3">Data type</a></h3><!-- RDLabel: "Data type" -->
<p>All the NetCDF variable types char, byte, short, int, float, and
double are supported in this Ruby interface. These types are called,
however, differently in it to adhere to the convention of Ruby, or,
more specifically, of NArray. These types are named to as "char",
"byte", "sint", "int", "sfloat", and "float", respectively. Therefore,
the vartype (=ntype) method of the NetCDFVar class returns one of these
strings. The def_var method of the NetCDF class also accepts one of
them to define a variable. It should be noted especially that "float"
in this library means the double in the NetCDF terminology. This is
due to the convention of Ruby -- the predefined Float class
corresponds to the double in C, not the float.</p>
<p>The "get" method of NetCDFVar class reads a variable in a NArray of
the same type as in the file, except for the "char" type which is read
into a "byte". This is because NArray does not have a "char" type.
However, it not is not supposed to be a problem, since a byte NArray
can easily handle string data.</p>
<h3><a name="label:4" id="label:4">Error handling</a></h3><!-- RDLabel: "Error handling" -->
<p>Errors are basically handled by raising exceptions. However, light
errors in value-returning methods are handled by returning nil (e.g.,
if a non-existent attribute name is specified in attribute reading).
Those methods that return nil on error are explicitly written as such
in the following.</p>
<h3><a name="label:5" id="label:5">Security features</a></h3><!-- RDLabel: "Security features" -->
<p>Security handling is done just as in the pre-defined File class.</p>
<h3><a name="label:6" id="label:6">Usage</a></h3><!-- RDLabel: "Usage" -->
<p>To use the RubyNetCDF library, load the library first by placing the
following line in your Ruby program to load the library:</p>
<pre>require 'numru/netcdf'</pre>
<p>If you want to use automatic data-missing-handling methods
(of NetCDFVar class), use the following:</p>
<pre>require 'numru/netcdf_miss'</pre>
<p>This will call <code>require 'numru/netcdf'</code> inside at the beginning, so
you do not have to call the both. The missing-data handling is done
with <a href="http://ruby.gfd-dennou.org/products/narray_miss/">NArrayMiss</a>,
so you have have installed it. This is, however, not needed if you only
call <code>require 'numru/netcdf'</code>.</p>
<p>Here, 'numru', which stands for "Numerical Ruby", is the name of
the subdirectory in the user's load path where the RubyNetCDF library
is placed. Then, it can be used as in the following:</p>
<pre>file = NumRu::NetCDF.create('tmp.nc')
x = file.def_dim('x',10)
y = file.def_dim('y',10)
v = file.def_var('v','float',[x,y])
file.close</pre>
<p>Here, NumRu is the module that has the library in it. The
reason why NetCDF library is wrapped in such a module is to avoid
conflicts in the name space. Without this kind of treatment,
problems happen if the user wants to use a library that happens to
have a class or module with the same name as even one of the classes
in this library.</p>
<p>If such a problem is not expected to happen, the prefix "NumRu::" can
be eliminated by "including" the NumRu module as in the following, so
that to place "NumRu::" is not needed anymore in the current scope:</p>
<pre>include NumRu
file = NetCDF.create('tmp.nc')
...</pre>
<p>For more examples, see demo and test programs included in the
distribution package.</p>
<p>---------------------------------------------</p>
<h2><a name="label:7" id="label:7">How to read this manual</a></h2><!-- RDLabel: "How to read this manual" -->
<dl>
<dt><h4><a name="label:8" id="label:8"><code>method_name(<var>argument1</var>, <var>argument2</var>, ...) -- <var>arguments</var> <var>that</var> <var>can</var> <var>be</var> <var>omitted</var> <var>are</var> <var>expressed</var> <var>as</var> <var>Argument_name</var>=<var>Default_value</var></code></a></h4></dt><!-- RDLabel: "method_name" -->
<dd>
<p>Explanation of its function</p>
<p>Arguments</p>
<ul>
<li>name of argument1 (its class or possible values): explanation</li>
<li>name of argument2 (its class or possible values): explanation</li>
<li>...</li>
</ul>
<p>Return value</p>
<ul>
<li>Explanation of the return value</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>Name(s) in NetCDF ver 3. The function equivalent to the current
method, if not in parenthesis. If no direct correspondence,
dependent functions are listed in parentheses.</li>
</ul></dd>
</dl>
<p>---------------------------------------------</p>
<h2><a name="label:9" id="label:9">Method Index</a></h2><!-- RDLabel: "Method Index" -->
<ul>
<li><p><a href="#label:10">class NetCDF</a></p>
<p>Class Methods</p>
<ul>
<li><a href="#label:12">NetCDF.open</a> Opens a file (class method). If mode="w" and non-existent, a new</li>
<li><a href="#label:13">NetCDF.new</a> Aliased to NetCDF.open</li>
<li><a href="#label:14">NetCDF.create</a> Creates a NetCDF file (class method)</li>
<li><a href="#label:15">NetCDF.create_tmp</a> Creates a temporary NetCDF file (class method)</li>
</ul>
<p>Instance Methods</p>
<ul>
<li><a href="#label:17">close</a> Closes the file.</li>
<li><a href="#label:18">ndims</a> Returns the number of dimensions in the file</li>
<li><a href="#label:19">nvars</a> Returns the number of variables in the file</li>
<li><a href="#label:20">natts</a> Returns the number of global attributes in the file</li>
<li><a href="#label:21">unlimited</a> Returns the unlimited dimension in the file</li>
<li><a href="#label:22">path</a> Returns the path of the file (contents of the filename specified when opened/created)</li>
<li><a href="#label:23">redef</a> Switches to the define mode. Does nothing if already in it (nil returned).</li>
<li><a href="#label:24">enddef</a> Switches to the data mode. Does nothing if already in it (nil returned).</li>
<li><a href="#label:25">define_mode?</a> Inquire whether the file is in the define mode.</li>
<li><a href="#label:26">sync</a> Synchronizes the disk copy of a netCDF dataset with in-memory buffer</li>
<li><a href="#label:27">def_dim</a> Define a dimension</li>
<li><a href="#label:28">put_att</a> Sets a global attribute</li>
<li><a href="#label:29">def_var</a> Defines a variable</li>
<li><a href="#label:30">def_var_with_dim</a> Same as def_var but defines dimensions first if needed</li>
<li><a href="#label:31">var</a> Opens an existing variable in the file</li>
<li><a href="#label:32">vars</a> Opens existing variables in the file</li>
<li><a href="#label:33">dim</a> Opens an existing dimension in the file</li>
<li><a href="#label:34">dims</a> Opens existing dimensions in the file</li>
<li><a href="#label:35">att</a> Opens an existing global attribute in the file</li>
<li><a href="#label:36">fill=</a> Sets a fill mode. (Default behavior of NetCDF is FILL.)</li>
<li><a href="#label:37">each_dim</a> Iterator regarding the dimensions in the file.</li>
<li><a href="#label:38">each_var</a> Iterator regarding the variables in the file.</li>
<li><a href="#label:39">each_att</a> Iterator regarding the global attributes of the file.</li>
<li><a href="#label:40">dim_names</a> Returns the names of all dimensions in the file</li>
<li><a href="#label:41">var_names</a> Returns the names of all variables in the file</li>
<li><a href="#label:42">att_names</a> Returns the names of all the global attributes of the file</li>
</ul></li>
<li><p><a href="#label:43">class NetCDFDim</a></p>
<p>Class Methods</p>
<p>Instance Methods</p>
<ul>
<li><a href="#label:46">length</a> Returns the length of the dimension</li>
<li><a href="#label:47">length_ul0</a> Same as length but returns 0 for the unlimited dimension</li>
<li><a href="#label:48">name=</a> Rename the dimension</li>
<li><a href="#label:49">name</a> Returns the name of the dimension</li>
<li><a href="#label:50">unlimited?</a> Inquires whether the dimension is unlimited or not</li>
</ul></li>
<li><p><a href="#label:51">class NetCDFVar</a></p>
<p>Class Methods</p>
<ul>
<li><a href="#label:53">NetCDFVar.new</a> Combines NetCDF.open and NetCDF#Var to open a variable with one line (no need to use this).</li>
<li><a href="#label:54">NetCDFVar.unpack_type=</a> Fix the NArray type to be used
in <a href="#label:81">unpack</a></li>
<li><a href="#label:55">NetCDFVar.unpack_type</a> Returns the NArray type set by <a href="#label:54">NetCDFVar.unpack_type=</a>.</li>
</ul>
<p>Instance Methods</p>
<ul>
<li><a href="#label:33">dim</a> Inquires the dim_num-th dimension of the variable (dim_num=0,1,2,..)</li>
<li><a href="#label:34">dims</a> Returns an array of all the dimensions of the variable</li>
<li><a href="#label:59">shape_ul0</a> Returns the shape of the variable, but the length of the unlimited dimension is set to zero.</li>
<li><a href="#label:60">shape_current</a> Returns the current shape of the variable.</li>
<li><a href="#label:39">each_att</a> Iterator regarding the global attributes of the variables.</li>
<li><a href="#label:40">dim_names</a> Returns the names of all the dimensions of the variable</li>
<li><a href="#label:42">att_names</a> Returns the names of all the attributes of the variable</li>
<li><a href="#label:49">name</a> Returns the name of the variable</li>
<li><a href="#label:48">name=</a> Rename the variable</li>
<li><a href="#label:18">ndims</a> Number of dimensions of the variable (which is rank of the variable).</li>
<li><a href="#label:67">rank</a> aliased to ndims</li>
<li><a href="#label:68">ntype</a> Aliased to vartype</li>
<li><a href="#label:69">vartype</a> Inquires the data value type of the variable</li>
<li><a href="#label:70">typecode</a> Inquires the data type of the variable (returns a typecode of NArray)</li>
<li><a href="#label:20">natts</a> Returns the number of the attributes of the variable</li>
<li><a href="#label:72">file</a> Inquires the file that the variable is in</li>
<li><a href="#label:35">att</a> Returns the attribute specified by its name</li>
<li><a href="#label:28">put_att</a> Sets an attribute</li>
<li><a href="#label:75">put</a> Aliased to <a href="#label:76">simple_put</a></li>
<li><a href="#label:76">simple_put</a> Set the values of the variable</li>
<li><a href="#label:77">pack</a> Pack a NArray (etc) using the attributes scale_factor and/or add_offset of self.</li>
<li><a href="#label:78">scaled_put</a> Same as <a href="#label:76">simple_put</a> but interprets the attributes scale_factor and/or add_offset using <a href="#label:77">pack</a>.</li>
<li><a href="#label:79">get</a> Aliased to <a href="#label:80">simple_get</a></li>
<li><a href="#label:80">simple_get</a> Returns values of the variable</li>
<li><a href="#label:81">unpack</a> Unpack a NArray (etc) using the attributes scale_factor and/or add_offset of self.</li>
<li><a href="#label:82">scaled_get</a> Same as <a href="#label:80">simple_get</a> but interprets the attributes scale_factor and/or add_offset using <a href="#label:81">unpack</a>.</li>
<li><a href="#label:83">[]</a> Same as NetCDFVar#get but a subset is specified as in the method [] of NArray. </li>
<li><a href="#label:84">[]=</a> Same as NetCDFVar#put but a subset is specified as in the method []= of NArray. </li>
</ul>
<p>Instance Methods added by requiring "numru/netcdf_miss"</p>
<ul>
<li><a href="#label:86">get_with_miss</a> Same as <a href="#label:79">get</a> but interprets data missing.</li>
<li><a href="#label:87">get_with_miss_and_scaling</a> Same as <a href="#label:86">get_with_miss</a> but handles data scaling too.</li>
<li><a href="#label:88">put_with_miss</a> Same as <a href="#label:75">put</a> but interprets data missing.</li>
<li><a href="#label:89">put_with_miss_and_scaling</a> Same as <a href="#label:88">put_with_miss</a> but handles data scaling too.</li>
</ul></li>
<li><p><a href="#label:90">class NetCDFAtt</a></p>
<p>Class Methods</p>
<p>Instance Methods</p>
<ul>
<li><a href="#label:49">name</a> Returns the name of the attribute</li>
<li><a href="#label:48">name=</a> Rename the attribute</li>
<li><a href="#label:95">copy</a> Copies an attribute to a variable or a file. If file, becomes an global attribute</li>
<li><a href="#label:96">delete</a> Delete an attribute</li>
<li><a href="#label:75">put</a> Sets the value of the attribute</li>
<li><a href="#label:79">get</a> Returns the values of the attribute</li>
<li><a href="#label:99">atttype</a> Inquires the type of attribute values</li>
<li><a href="#label:70">typecode</a> Inquires the type of attribute values (returns a NArray typecode)</li>
</ul></li>
</ul>
<p>---------------------------------------------</p>
<h1><a name="label:10" id="label:10">class NetCDF</a></h1><!-- RDLabel: "class NetCDF" -->
<h3><a name="label:11" id="label:11">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
<dl>
<dt><h4><a name="label:12" id="label:12"><code>NetCDF.open(<var>filename</var>, <var>mode</var>="<var>r</var>", <var>share</var>=<var>false</var>)</code></a></h4></dt><!-- RDLabel: "NetCDF.open" -->
<dd>
<p>Opens a file (class method). If mode="w" and the file does not
exist, a new file is created.</p>
<p>Arguments</p>
<ul>
<li>filename (String): file name (path)</li>
<li>mode (String) : IO mode "r" (read only); "w","w+" (write --
current contents are overwritten (eliminated!)); "r+","a","a+"
(append -- writable while current contents are preserved).
All the options permit reading, unlike the predefined File class.
Note that to "append" will require extra time and disk
space due to the limitations of the original NetCDF library,
which is used in this library.</li>
<li>share (true or false) : Whether to use the "shared" mode or not
(set true if a file being written may be read from other
processes. See nc_open in Ch.5 of users' guide of the C version)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDF object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF </p>
<ul>
<li>nc_open, nc_create</li>
</ul></dd>
<dt><h4><a name="label:13" id="label:13"><code>NetCDF.new</code></a></h4></dt><!-- RDLabel: "NetCDF.new" -->
<dd>
<p>Aliased to NetCDF.open</p></dd>
<dt><h4><a name="label:14" id="label:14"><code>NetCDF.create(<var>filename</var>, <var>noclobber</var>=<var>false</var>, <var>share</var>=<var>false</var>)</code></a></h4></dt><!-- RDLabel: "NetCDF.create" -->
<dd>
<p>Creates a NetCDF file (class method)</p>
<p>Arguments</p>
<ul>
<li>filename (String) : file name (path)</li>
<li>noclobber (true or false) : overwrite or not if the file exists</li>
<li>share (true or false) : Whether to use the shared mode or not
(set true if a file being written may be read from other
processes. See nc_open in Ch.5 of users' guide of the C version)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDF object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_create</li>
</ul></dd>
<dt><h4><a name="label:15" id="label:15"><code>NetCDF.create_tmp(<var>tmpdir</var>=<var>ENV</var>['<var>TMPDIR</var>']||<var>ENV</var>['<var>TMP</var>']||<var>ENV</var>['<var>TEMP</var>']||'.', <var>share</var>=<var>false</var>)</code></a></h4></dt><!-- RDLabel: "NetCDF.create_tmp" -->
<dd>
<p>Creates a temporary NetCDF file (class method).
Its name is automatically generated, and it is deleted when closed.</p>
<p>Arguments</p>
<ul>
<li>tmpdir (String) : directory to place the temporary file.
By default, "." or a directory specified by an environmental
variable (TMPDIR or TMP or TEMP) is used. In a secure mode,
theses environmental variable is NOT used, and the default
value is '.'.</li>
<li>share (true or false) : Whether to use the shared mode or not</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDF object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_create</li>
</ul></dd>
</dl>
<h3><a name="label:16" id="label:16">Instance Methods</a></h3><!-- RDLabel: "Instance Methods" -->
<dl>
<dt><h4><a name="label:17" id="label:17"><code>close</code></a></h4></dt><!-- RDLabel: "close" -->
<dd>
<p>Closes the file.</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_close</li>
</ul></dd>
<dt><h4><a name="label:18" id="label:18"><code>ndims</code></a></h4></dt><!-- RDLabel: "ndims" -->
<dd>
<p>Returns the number of dimensions in the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_ndims</li>
</ul></dd>
<dt><h4><a name="label:19" id="label:19"><code>nvars</code></a></h4></dt><!-- RDLabel: "nvars" -->
<dd>
<p>Returns the number of variables in the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_nvars</li>
</ul></dd>
<dt><h4><a name="label:20" id="label:20"><code>natts</code></a></h4></dt><!-- RDLabel: "natts" -->
<dd>
<p>Returns the number of global attributes in the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_natts</li>
</ul></dd>
<dt><h4><a name="label:21" id="label:21"><code>unlimited</code></a></h4></dt><!-- RDLabel: "unlimited" -->
<dd>
<p>Returns the unlimited dimension in the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFDim if it exists; nil if not</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_unlimdim</li>
</ul></dd>
<dt><h4><a name="label:22" id="label:22"><code>path</code></a></h4></dt><!-- RDLabel: "path" -->
<dd>
<p>Returns the path of the file (contents of the filename specified when opened/created)</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(none)</li>
</ul></dd>
<dt><h4><a name="label:23" id="label:23"><code>redef</code></a></h4></dt><!-- RDLabel: "redef" -->
<dd>
<p>Switches to the define mode. Does nothing if already in it (nil returned).</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>true if successfully switched to the define mode;</li>
</ul></dd>
</dl>
<pre>nil if the file is already in the define mode.
Exception is raised if unsuccessful for other reasons.</pre>
<pre>Corresponding (dependent) function(s) in the C library of NetCDF
* nc_redef</pre>
<dl>
<dt><h4><a name="label:24" id="label:24"><code>enddef</code></a></h4></dt><!-- RDLabel: "enddef" -->
<dd>
<p>Switches to the data mode. Does nothing if already in it (nil returned).</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>true if successfully switched to the data mode;</li>
</ul></dd>
</dl>
<pre>nil if the file is already in the data mode.
Exception is raised if unsuccessful for other reasons.</pre>
<pre>Corresponding (dependent) function(s) in the C library of NetCDF
* nc_enddef</pre>
<dl>
<dt><h4><a name="label:25" id="label:25"><code>define_mode?</code></a></h4></dt><!-- RDLabel: "define_mode?" -->
<dd>
<p>Inquire whether the file is in the define mode.</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>true if the data is in the define mode;</li>
</ul></dd>
</dl>
<pre>false if the file is in the data mode;
nil otherwise (possibly the file is read-only).</pre>
<pre>Corresponding (dependent) function(s) in the C library of NetCDF
* combination of nc_redef and nc_enddef</pre>
<dl>
<dt><h4><a name="label:26" id="label:26"><code>sync</code></a></h4></dt><!-- RDLabel: "sync" -->
<dd>
<p>Synchronizes the disk copy of a netCDF dataset with in-memory buffer</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_sync</li>
</ul></dd>
<dt><h4><a name="label:27" id="label:27"><code>def_dim(<var>dimension_name</var>, <var>length</var>)</code></a></h4></dt><!-- RDLabel: "def_dim" -->
<dd>
<p>Define a dimension</p>
<p>Arguments</p>
<ul>
<li>dimension_name (String) : Name of the dimension to be defined</li>
<li>length (Integer) : length of the dimension. 0 for unlimited.</li>
</ul>
<p>Return value</p>
<ul>
<li>defined dimension (NetCDFDim object)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_def_dim</li>
</ul></dd>
<dt><h4><a name="label:28" id="label:28"><code>put_att(<var>attribute_name</var>, <var>value</var>, <var>atttype</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "put_att" -->
<dd>
<p>Sets a global attribute</p>
<p>Arguments</p>
<ul>
<li>attribute_name (String) : name of the global attribute</li>
<li>value (Numeric, String, Array of Numeric, or NArray) : value of the attribute</li>
<li>atttype (nil or String) : data type of the attribute value.
nil lets it automatically determined from the value.
"char" (or "string"), "byte", "sint", "int", "sfloat", or "float"
specifies the type explicitly (1,1,2,4,4,8 bytes, respectively)</li>
</ul>
<p>Return value</p>
<ul>
<li>created attribute (NetCDFAtt object)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_put_att_<type></li>
</ul></dd>
<dt><h4><a name="label:29" id="label:29"><code>def_var(<var>name</var>, <var>vartype</var>, <var>dimensions</var>)</code></a></h4></dt><!-- RDLabel: "def_var" -->
<dd>
<p>Defines a variable</p>
<p>Arguments</p>
<ul>
<li>name (String) : Name of the variable to define</li>
<li>vartype (String or Fixnum) : data type of the variable ("char", "byte", "sint",
"sint", "int", "sfloat", or "float"), or a NArray typecodes(Fixnum)</li>
<li>dimensions (Array) : Dimensions of the variable. An Array of
NetCDFDim, in the order from the fastest varying dimension to
the slowest varying one; its length becomes the rank of the
variable.</li>
</ul>
<p>Return value</p>
<ul>
<li>defined variable (NetCDFVar object)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_def_var</li>
</ul></dd>
<dt><h4><a name="label:30" id="label:30"><code>def_var_with_dim(<var>name</var>, <var>vartype</var>, <var>shape_ul0</var>, <var>dimnames</var>)</code></a></h4></dt><!-- RDLabel: "def_var_with_dim" -->
<dd>
<p>Same as def_var but defines dimensions first if needed.
Raise exception if it conflicts with the lengths of existing dimensions.</p>
<p>Arguments</p>
<ul>
<li>name (String) : Name of the variable to define</li>
<li>vartype (String) : data type of the variable ("char", "byte", "sint",
"sint", "int", "sfloat", or "float")</li>
<li>shape_ul0 (Array of Integer) : Shape of the variable, i.e.,
lengths of dimensions. The unlimited dimension is specified by zero.
The length of shape_ul0 determines the rank of the variable.</li>
<li>dimnames (Array of String) : Names of the dimensions. Its length
(=>rank) must be equal to that of shape_ul0</li>
</ul>
<p>Return value</p>
<ul>
<li>defined variable (NetCDFVar object)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(nc_def_var)</li>
</ul></dd>
<dt><h4><a name="label:31" id="label:31"><code>var(<var>var_name</var>)</code></a></h4></dt><!-- RDLabel: "var" -->
<dd>
<p>Opens an existing variable in the file</p>
<p>Arguments</p>
<ul>
<li>var_name (String) : Name of the variable to open</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFVar object; nil if the variable does not exist</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_varid</li>
</ul></dd>
<dt><h4><a name="label:32" id="label:32"><code>vars(<var>names</var>)</code></a></h4></dt><!-- RDLabel: "vars" -->
<dd>
<p>Opens existing variables in the file</p>
<p>Arguments</p>
<ul>
<li>names (nil or Array of String): Names of the variables to open;
all variables are returned if nil (default).</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of NetCDFVar objects; exception is raised if names has a
non-existent name</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_varid</li>
</ul></dd>
<dt><h4><a name="label:33" id="label:33"><code>dim(<var>dimension_name</var>)</code></a></h4></dt><!-- RDLabel: "dim" -->
<dd>
<p>Opens an existing dimension in the file</p>
<p>Arguments</p>
<ul>
<li>dimension_name (String) : Name of the dimension to open</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFDim object; nil if the dimension does not exist</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_dimid</li>
</ul></dd>
<dt><h4><a name="label:34" id="label:34"><code>dims(<var>names</var>)</code></a></h4></dt><!-- RDLabel: "dims" -->
<dd>
<p>Opens existing dimensions in the file</p>
<p>Arguments</p>
<ul>
<li>names (nil or Array of String): Names of the dimensions to open;
all dimensions are returned if nil (default).</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of NetCDFDim objects; exception is raised if names has a
non-existent name</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_dimid</li>
</ul></dd>
<dt><h4><a name="label:35" id="label:35"><code>att(<var>attribute_name</var>)</code></a></h4></dt><!-- RDLabel: "att" -->
<dd>
<p>Opens an existing global attribute in the file</p>
<p>Arguments</p>
<ul>
<li>attribute_name (String) : Name of the global attribute to open</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFAtt object if the attribute exists; nil if not</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(nc_inq_attid used for inquiry)</li>
</ul></dd>
<dt><h4><a name="label:36" id="label:36"><code>fill=(<var>filemode</var>)</code></a></h4></dt><!-- RDLabel: "fill=" -->
<dd>
<p>Sets a fill mode. (Default behavior of NetCDF is FILL.)</p>
<p>Arguments</p>
<ul>
<li>fillmode (true or false)</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_set_fill</li>
</ul></dd>
<dt><h4><a name="label:37" id="label:37"><code>each_dim{ ... }</code></a></h4></dt><!-- RDLabel: "each_dim" -->
<dd>
<p>Iterator regarding the dimensions in the file.
Ex.: {|i| print i.name,"\n"} prints names of all dimensions</p>
<p>Arguments</p>
<ul>
<li>{ ... } : Block for the iterator. A "do end" block is the alternative.</li>
</ul>
<p>Return value</p>
<ul>
<li>self</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_ndims)</li>
</ul></dd>
<dt><h4><a name="label:38" id="label:38"><code>each_var{ ... }</code></a></h4></dt><!-- RDLabel: "each_var" -->
<dd>
<p>Iterator regarding the variables in the file.
Ex.: {|i| print i.name,"\n"} prints names of all variables</p>
<p>Arguments</p>
<ul>
<li>{ ... } : Block for the iterator. A "do end" block is the alternative.</li>
</ul>
<p>Return value</p>
<ul>
<li>self</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_nvars)</li>
</ul></dd>
<dt><h4><a name="label:39" id="label:39"><code>each_att{ ... }</code></a></h4></dt><!-- RDLabel: "each_att" -->
<dd>
<p>Iterator regarding the global attributes of the file.
Ex.: {|i| print i.name,"\n"} prints names of all of them.</p>
<p>Arguments</p>
<ul>
<li>{ ... } : Block for the iterator. A "do end" block is the alternative.</li>
</ul>
<p>Return value</p>
<ul>
<li>self</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_natts, nc_inq_attname)</li>
</ul></dd>
<dt><h4><a name="label:40" id="label:40"><code>dim_names</code></a></h4></dt><!-- RDLabel: "dim_names" -->
<dd>
<p>Returns the names of all dimensions in the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of NetCDFDim</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(nc_inq_ndims, nc_inq_dimname)</li>
</ul></dd>
<dt><h4><a name="label:41" id="label:41"><code>var_names</code></a></h4></dt><!-- RDLabel: "var_names" -->
<dd>
<p>Returns the names of all variables in the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_nvars, nc_inq_varname)</li>
</ul></dd>
<dt><h4><a name="label:42" id="label:42"><code>att_names</code></a></h4></dt><!-- RDLabel: "att_names" -->
<dd>
<p>Returns the names of all the global attributes of the file</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of NetCDFAtt</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_natts, nc_inq_attname)</li>
</ul></dd>
</dl>
<p>---------------------------------------------</p>
<h1><a name="label:43" id="label:43">class NetCDFDim</a></h1><!-- RDLabel: "class NetCDFDim" -->
<h3><a name="label:44" id="label:44">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
<h3><a name="label:45" id="label:45">Instance Methods</a></h3><!-- RDLabel: "Instance Methods" -->
<dl>
<dt><h4><a name="label:46" id="label:46"><code>length</code></a></h4></dt><!-- RDLabel: "length" -->
<dd>
<p>Returns the length of the dimension</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_dimlen</li>
</ul></dd>
<dt><h4><a name="label:47" id="label:47"><code>length_ul0</code></a></h4></dt><!-- RDLabel: "length_ul0" -->
<dd>
<p>Same as length but returns 0 for the unlimited dimension</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_dimlen</li>
</ul></dd>
<dt><h4><a name="label:48" id="label:48"><code>name=(<var>dimension_newname</var>)</code></a></h4></dt><!-- RDLabel: "name=" -->
<dd>
<p>Rename the dimension</p>
<p>Arguments</p>
<ul>
<li>dimension_newname (String) : new name</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_rename_dim</li>
</ul></dd>
<dt><h4><a name="label:49" id="label:49"><code>name</code></a></h4></dt><!-- RDLabel: "name" -->
<dd>
<p>Returns the name of the dimension</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_dimname</li>
</ul></dd>
<dt><h4><a name="label:50" id="label:50"><code>unlimited?</code></a></h4></dt><!-- RDLabel: "unlimited?" -->
<dd>
<p>Inquires whether the dimension is unlimited or not</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>true or false</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_unlimdim)</li>
</ul></dd>
</dl>
<p>---------------------------------------------</p>
<h1><a name="label:51" id="label:51">class NetCDFVar</a></h1><!-- RDLabel: "class NetCDFVar" -->
<h3><a name="label:52" id="label:52">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
<dl>
<dt><h4><a name="label:53" id="label:53"><code>NetCDFVar.new(<var>file</var>,<var>varname</var>,<var>mode</var>="<var>r</var>",<var>share</var>=<var>false</var>)</code></a></h4></dt><!-- RDLabel: "NetCDFVar.new" -->
<dd>
<p>open a NetCDF variable. This can also be done with NetCDF#var
(instance method of NetCDF class), which is recommended over
this method.</p>
<p>Arguments</p>
<ul>
<li>file (NetCDF or String) : a NetCDF file object (NetCDF)
or the path of a NetCDF file (String).</li>
<li>varname (String) : name of the variable in the file</li>
<li>mode (String) : IO mode -- used if file is a String (see NetCDF.open)</li>
<li>share (true or false) : Whether to use the "shared" mode or
not -- used if file is a String (see NetCDF.open)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFVar object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF </p>
<ul>
<li>(dependent on nc_open, nc_create, nc_inq_varid etc.)</li>
</ul></dd>
<dt><h4><a name="label:54" id="label:54"><code>NetCDFVar.unpack_type=(<var>na_type</var>)</code></a></h4></dt><!-- RDLabel: "NetCDFVar.unpack_type=" -->
<dd>
<p>Fix the NArray type to be used in <a href="#label:81">unpack</a>.</p>
<p>Arguments</p>
<ul>
<li>na_type (Integer) : NArray::BYTE, NArray::SINT, NArray::INT,
NArray::SFLOAT, or NArray::FLOAT</li>
</ul>
<p>Return value</p>
<ul>
<li>na_type (the argument)</li>
</ul></dd>
<dt><h4><a name="label:55" id="label:55"><code>NetCDFVar.unpack_type</code></a></h4></dt><!-- RDLabel: "NetCDFVar.unpack_type" -->
<dd>
<p>Returns the NArray type set by <a href="#label:54">NetCDFVar.unpack_type=</a>.</p>
<p>Return value</p>
<ul>
<li>nil, NArray::BYTE, NArray::SINT, NArray::INT,
NArray::SFLOAT, or NArray::FLOAT</li>
</ul></dd>
</dl>
<h3><a name="label:56" id="label:56">Instance Methods</a></h3><!-- RDLabel: "Instance Methods" -->
<dl>
<dt><h4><a name="label:57" id="label:57"><code>dim(<var>dim_num</var>)</code></a></h4></dt><!-- RDLabel: "dim" -->
<dd>
<p>Inquires the dim_num-th dimension of the variable (dim_num=0,1,2,..)</p>
<p>Arguments</p>
<ul>
<li>dim_num (Fixnum) : 0,1,... 0 is the fastest varying dimension.</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFDim object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_vardimid)</li>
</ul></dd>
<dt><h4><a name="label:58" id="label:58"><code>dims</code></a></h4></dt><!-- RDLabel: "dims" -->
<dd>
<p>Returns an array of all the dimensions of the variable</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of NetCDFDim objects.</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_vardimid</li>
</ul></dd>
<dt><h4><a name="label:59" id="label:59"><code>shape_ul0</code></a></h4></dt><!-- RDLabel: "shape_ul0" -->
<dd>
<p>Returns the shape of the variable, but the length of the unlimited dimension is set to zero.
Good to define another variable.</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array. [length of 0th dim, length of 1st dim,.. ]</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_vardimid, nc_inq_unlimdim etc)</li>
</ul></dd>
<dt><h4><a name="label:60" id="label:60"><code>shape_current</code></a></h4></dt><!-- RDLabel: "shape_current" -->
<dd>
<p>Returns the current shape of the variable.</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array. [length of 0th dim, length of 1st dim,.. ]</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_vardimid etc)</li>
</ul></dd>
<dt><h4><a name="label:61" id="label:61"><code>each_att{ ... }</code></a></h4></dt><!-- RDLabel: "each_att" -->
<dd>
<p>Iterator regarding the global attributes of the variables.
Ex.: {|i| print i.name,"\n"} prints names of all of them.</p>
<p>Arguments</p>
<ul>
<li>{ ... } : Block for the iterator. A "do end" block is the alternative.</li>
</ul>
<p>Return value</p>
<ul>
<li>self</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_natts, nc_inq_attname)</li>
</ul></dd>
<dt><h4><a name="label:62" id="label:62"><code>dim_names</code></a></h4></dt><!-- RDLabel: "dim_names" -->
<dd>
<p>Returns the names of all the dimensions of the variable</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_varndims, nc_inq_vardimid, nc_inq_dimname)</li>
</ul></dd>
<dt><h4><a name="label:63" id="label:63"><code>att_names</code></a></h4></dt><!-- RDLabel: "att_names" -->
<dd>
<p>Returns the names of all the attributes of the variable</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Array of String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(dependent on nc_inq_natts, nc_inq_attname)</li>
</ul></dd>
<dt><h4><a name="label:64" id="label:64"><code>name</code></a></h4></dt><!-- RDLabel: "name" -->
<dd>
<p>Returns the name of the variable</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_varname</li>
</ul></dd>
<dt><h4><a name="label:65" id="label:65"><code>name=(<var>variable_newname</var>)</code></a></h4></dt><!-- RDLabel: "name=" -->
<dd>
<p>Rename the variable</p>
<p>Arguments</p>
<ul>
<li>variable_newname (String) : new name</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_rename_var</li>
</ul></dd>
<dt><h4><a name="label:66" id="label:66"><code>ndims</code></a></h4></dt><!-- RDLabel: "ndims" -->
<dd>
<p>Number of dimensions of the variable (which is rank of the variable).</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_varndims</li>
</ul></dd>
<dt><h4><a name="label:67" id="label:67"><code>rank</code></a></h4></dt><!-- RDLabel: "rank" -->
<dd>
<p>Aliased to ndims</p></dd>
<dt><h4><a name="label:68" id="label:68"><code>ntype</code></a></h4></dt><!-- RDLabel: "ntype" -->
<dd>
<p>Aliased to vartype</p></dd>
<dt><h4><a name="label:69" id="label:69"><code>vartype</code></a></h4></dt><!-- RDLabel: "vartype" -->
<dd>
<p>Inquires the data value type of the variable</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>String ("char","byte","sint","int","sfloat", or "float")</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_vartype</li>
</ul></dd>
<dt><h4><a name="label:70" id="label:70"><code>typecode</code></a></h4></dt><!-- RDLabel: "typecode" -->
<dd>
<p>Inquires the data type of the variable (returns a typecode of NArray)</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>a Fixnum (NArray:BYTE, NArray:SINT, NArray:LINT, NArray:SFLOAT, NArray:SFLOAT, NArray:DFLOAT)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_vartype</li>
</ul></dd>
<dt><h4><a name="label:71" id="label:71"><code>natts</code></a></h4></dt><!-- RDLabel: "natts" -->
<dd>
<p>Returns the number of the attributes of the variable</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>Integer</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_varnatts</li>
</ul></dd>
<dt><h4><a name="label:72" id="label:72"><code>file</code></a></h4></dt><!-- RDLabel: "file" -->
<dd>
<p>Inquires the file that the variable is in</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDF object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(none)</li>
</ul></dd>
<dt><h4><a name="label:73" id="label:73"><code>att(<var>attribute_name</var>)</code></a></h4></dt><!-- RDLabel: "att" -->
<dd>
<p>Returns the attribute specified by its name</p>
<p>Arguments</p>
<ul>
<li>attribute_name (String) : Name of the attribute</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFAtt object if the attribute exists; nil if not</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(nc_inq_attid is used for inquiry)</li>
</ul></dd>
<dt><h4><a name="label:74" id="label:74"><code>put_att(<var>attribute_name</var>, <var>value</var>, <var>atttype</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "put_att" -->
<dd>
<p>Sets an attribute</p>
<p>Arguments</p>
<ul>
<li>attribute_name (String) : name of the attribute</li>
<li>value (Numeric, String, Array of Numeric, or NArray) : value of the attribute</li>
<li>atttype (nil or String) : data type of the attribute value.
nil lets it automatically determined from the value.
"char" (="string"), "byte", "sint", "int", "sfloat", or "float"
specifies the type explicitly (1,1,2,4,4,8 bytes, respectively)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NetCDFAtt object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_put_att_<type></li>
</ul></dd>
<dt><h4><a name="label:75" id="label:75"><code>put(<var>value</var>, <var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "put" -->
<dd>
<p>Aliased to <a href="#label:76">simple_put</a></p></dd>
<dt><h4><a name="label:76" id="label:76"><code>simple_put(<var>value</var>, <var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "simple_put" -->
<dd>
<p>Set the values of the variable</p>
<p>Arguments</p>
<ul>
<li>value : value to set (Numeric, Array of Numeric (1D only), or
NArray (possibly multi-D)). If it is a Numeric or length==1, the value
is set uniformly.</li>
<li><p>option (Hash) : Optional argument to limit the portion of the
variable to output values. If omitted, the whole variable is
subject to the output. This argument accepts a Hash whose keys
contain either "index" or a combination of "start","end", and
"stride". The value of "index" points the index of a scalar
portion of the variable. The other case is used to designate a
regularly ordered subset, where "start" and "end" specifies
bounds in each dimension and "stride" specifies intervals in
it. As in Array "start", "end", and "index" can take negative
values to specify index backward from the end. However,
"stride" has to be positive, so reversing the array must be
done afterwards if you like.</p>
<p>Example: If the variable is 2D:</p>
<p>{"start"=>[2,5],"end"=>[6,-1],"stride"=>[2,4]} -- Specifies a
subset made as follows: the 1st dimension from the element 2
to the element 6 (note that the count starts with 0, so that
the element 2 is the 3rd one) with an interval of 2;
the 2nd dimension from the element 6 to the last element
(designated by -1) with an interval of 5.</p>
<p>{"index"=>[0,0]}: Scalar of the fist element</p>
<p>{"index"=>[0,-2]}: Scalar from the 1st element of with
respect to the 1st dimension and the 2nd element from the last
with respect to the 2nd dimension</p></li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_put_var_<type>, nc_put_vars_<type>, nc_put_var1_<type></li>
</ul></dd>
<dt><h4><a name="label:77" id="label:77"><code>pack(<var>na</var>)</code></a></h4></dt><!-- RDLabel: "pack" -->
<dd>
<p>Pack a NArray (etc) using the attributes scale_factor and/or add_offset of self.</p>
<p>If scale_factor and/or add_offset is defined, returns
(na-add_offset)/scale_factor. Returns na if not.</p>
<p>Arguments</p>
<ul>
<li>na : a numeric array to pack (NArray, NArrayMiss, or Array)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NArray or NArrayMiss</li>
</ul></dd>
<dt><h4><a name="label:78" id="label:78"><code>scaled_put(<var>value</var>, <var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "scaled_put" -->
<dd>
<p>Same as <a href="#label:76">simple_put</a> but interprets the attributes scale_factor and/or add_offset using <a href="#label:77">pack</a>.</p>
<p>See the document for <a href="#label:76">simple_put</a> for arguments etc.</p></dd>
<dt><h4><a name="label:79" id="label:79"><code>get(<var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "get" -->
<dd>
<p>Aliased to <a href="#label:80">simple_get</a>.</p></dd>
<dt><h4><a name="label:80" id="label:80"><code>simple_get(<var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "simple_get" -->
<dd>
<p>Returns values of the variable</p>
<p>Arguments</p>
<ul>
<li>option (Hash) : Optional argument to limit the portion of the
variable to get values. Its usage is the same as in the method
put.</li>
</ul>
<p>Return value</p>
<ul>
<li>an NArray object</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_get_var_<type>, nc_get_vars_<type>, nc_get_var1_<type></li>
</ul></dd>
<dt><h4><a name="label:81" id="label:81"><code>unpack(<var>na</var>)</code></a></h4></dt><!-- RDLabel: "unpack" -->
<dd>
<p>Unpack a NArray (etc) using the attributes scale_factor and/or add_offset of self.</p>
<p>If scale_factor and/or add_offset is defined, returns
na * scale_factor + add_offset. Returns na if not.
Type conversion is made by the coercing -- for example
if na is sint and scale_factor and add_offset is sfloat,
return value is sfloat. The type of the return value can be specified
explicitly with <a href="#label:54">NetCDFVar.unpack_type=</a>.</p>
<p>Arguments</p>
<ul>
<li>na : a numeric array to unpack (NArray, or NArrayMiss)</li>
</ul>
<p>Return value</p>
<ul>
<li>a NArray or NArrayMiss</li>
</ul></dd>
<dt><h4><a name="label:82" id="label:82"><code>scaled_get(<var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "scaled_get" -->
<dd>
<p>Same as <a href="#label:80">simple_get</a> but interprets the attributes scale_factor and/or add_offset using <a href="#label:81">unpack</a>.</p>
<p>See the document for <a href="#label:80">simple_get</a> for arguments etc.</p></dd>
<dt><h4><a name="label:83" id="label:83"><code>[]</code></a></h4></dt><!-- RDLabel: "[]" -->
<dd>
<p>Same as NetCDFVar#get but a subset is specified as in the method [] of NArray. </p>
<p>In addition to the subset specifications supported by NArray,
ranges with steps are supported, which is specified
like {0..-1, 3}, i.e., a 1-element Hash with the key and value
representing the range (Range) and the step (Integer), respectively.
Unlike NArray, 1-dimensional indexing of multi-dimensional
variables is not support.</p></dd>
<dt><h4><a name="label:84" id="label:84"><code>[] = </code></a></h4></dt><!-- RDLabel: "[]=" -->
<dd>
<p>Same as NetCDFVar#put but a subset is specified as in the method []= of NArray. </p>
<p>In addition to the subset specifications supported by NArray,
ranges with steps are supported, which is specified
like {0..-1, 3}, i.e., a 1-element Hash with the key and value
representing the range (Range) and the step (Integer), respectively.
Unlike NArray, 1-dimensional indexing of multi-dimensional
variables is not support.</p></dd>
</dl>
<h3><a name="label:85" id="label:85">Instance Methods added by requiring "numru/netcdf_miss"</a></h3><!-- RDLabel: "Instance Methods added by requiring "numru/netcdf_miss"" -->
<dl>
<dt><h4><a name="label:86" id="label:86"><code>get_with_miss(<var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "get_with_miss" -->
<dd>
<p>Same as <a href="#label:79">get</a> but interprets data missing.</p>
<p>Data missing is specified by the standard attributes valid_range,
(valid_min and/or valid_max), or missing_value, with the precedence being
this order. Unlike the
recommendation in the NetCDF User's guide, missing_value is
interpreted if present. If missing_value and valid_* present
simultaneously, missing_value must be outside the valid range.
Otherwise, exception is raised.</p>
<p>If data missing is specified as stated above, this method returns a NArrayMiss.
If not, it returns a NArray. Thus, you can use this whether
data missing is defined or not. </p>
<p>Arguments</p>
<ul>
<li>See <a href="#label:79">get</a>.</li>
</ul>
<p>Return value</p>
<ul>
<li>an NArrayMiss (if data missing is specified) or an NArray
(if data missing is NOT specified)</li>
</ul>
<p>Possible exception in addition to NetcdfError.</p>
<ul>
<li>missing_value is in the valid range (see above).</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>See <a href="#label:79">get</a>. This method is written in Ruby.</li>
</ul>
<p>EXAMPLE</p>
<ul>
<li><p>The following is an example to replace <a href="#label:79">get</a> with <a href="#label:86">get_with_miss</a>.
It will also make <a href="#label:83">[]</a> interpret data missing,
since it calls <code>get</code> internally.</p>
<pre>file = NetCDF.open('hogehoge.nc')
var = file.var('var')
def var.get(*args); get_with_miss(*args); end
p var.get # --> interprets data missing if defined
p var[0..-1,0] # --> interprets data missing if defined (assumed 2D)</pre></li>
</ul></dd>
<dt><h4><a name="label:87" id="label:87"><code>get_with_miss_and_scaling(<var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "get_with_miss_and_scaling" -->
<dd>
<p>Same as <a href="#label:86">get_with_miss</a> but handles data scaling too using <a href="#label:81">unpack</a>.</p>
<p>Missing data handling using valid_* / missing_value is applied
basically to packed data, which is consistent with most
conventions. However, it is applied to unpacked data
if and only if the type of valid_* / missing_value is not the same as
the packed data and is the samed as the unpacked data.
This treatment can handle all conventions.</p>
<p>EXAMPLE</p>
<ul>
<li>See above. The same thing applies.</li>
</ul></dd>
<dt><h4><a name="label:88" id="label:88"><code>put_with_miss(<var>value</var>, <var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "put_with_miss" -->
<dd>
<p>Same as <a href="#label:75">put</a> but interprets data missing.</p>
<p>If <code>value</code> is an NArray, the methods behaves as <a href="#label:75">put</a>.
Data missing in <code>value</code> is interpreted if it is an NArrayMiss
and data missing is specified by attributes in <code>self</code>
(see <a href="#label:86">get_with_miss</a> ).
Namely, the data which are "invalid" in the <code>value</code> is replaced
with a missing value when written in the file.
(missing_value or _FillValue or a value outside
the valid range). No check is made whether "valid" values in the
NArrayMiss is within the valid range of <code>self</code>.</p>
<p>Arguments</p>
<ul>
<li>value : NArrayMiss or what is allowed in <a href="#label:75">put</a>.</li>
<li>option (Hash) : See <a href="#label:75">put</a>.</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>See <a href="#label:75">put</a>. This method is written in Ruby.</li>
</ul>
<p>EXAMPLE</p>
<ul>
<li><p>The following is an example to replace <a href="#label:75">put</a> with <a href="#label:88">put_with_miss</a>.
It will also make <a href="#label:84">[]=</a> interpret data missing,
since it calls <code>put</code> internally.</p>
<pre>file = NetCDF.open('hogehoge.nc')
var = file.var('var')
def var.put(*args); put_with_miss(*args); end
var.put = narray_miss # --> interprets data missing if defined
var[0..-1,0] = narray_miss # --> interprets data missing if defined (assumed 2D)</pre></li>
</ul></dd>
<dt><h4><a name="label:89" id="label:89"><code>put_with_miss_and_scaling(<var>value</var>, <var>option</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "put_with_miss_and_scaling" -->
<dd>
<p>Same as <a href="#label:88">put_with_miss</a> but handles data scaling too using <a href="#label:77">pack</a>.</p>
<p>Missing data handling using valid_* / missing_value is applied
basically to packed data, which is consistent with most
conventions. However, it is applied to unpacked data
if and only if the type of valid_* / missing_value is not the same as
the packed data and is the samed as the unpacked data.
This treatment can handle all conventions.</p>
<p>EXAMPLE</p>
<ul>
<li>See above. The same thing applies.</li>
</ul></dd>
</dl>
<p>---------------------------------------------</p>
<h1><a name="label:90" id="label:90">class NetCDFAtt</a></h1><!-- RDLabel: "class NetCDFAtt" -->
<h3><a name="label:91" id="label:91">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
<h3><a name="label:92" id="label:92">Instance Methods</a></h3><!-- RDLabel: "Instance Methods" -->
<dl>
<dt><h4><a name="label:93" id="label:93"><code>name</code></a></h4></dt><!-- RDLabel: "name" -->
<dd>
<p>Returns the name of the attribute</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>String</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>(none)</li>
</ul></dd>
<dt><h4><a name="label:94" id="label:94"><code>name=(<var>attribute_newname</var>)</code></a></h4></dt><!-- RDLabel: "name=" -->
<dd>
<p>Rename the attribute</p>
<p>Arguments</p>
<ul>
<li>attribute_newname (String) : New name</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_rename_att</li>
</ul></dd>
<dt><h4><a name="label:95" id="label:95"><code>copy(<var>var_or_file</var>)</code></a></h4></dt><!-- RDLabel: "copy" -->
<dd>
<p>Copies an attribute to a variable or a file. If file, becomes an global attribute</p>
<p>Arguments</p>
<ul>
<li>var_or_file (NetCDFVar or NetCDF)</li>
</ul>
<p>Return value</p>
<ul>
<li>Resultant new attribute (NetCDFAtt)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_copy_att</li>
</ul></dd>
<dt><h4><a name="label:96" id="label:96"><code>delete</code></a></h4></dt><!-- RDLabel: "delete" -->
<dd>
<p>Delete an attribute</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_del_att</li>
</ul></dd>
<dt><h4><a name="label:97" id="label:97"><code>put(<var>value</var>, <var>atttype</var>=<var>nil</var>)</code></a></h4></dt><!-- RDLabel: "put" -->
<dd>
<p>Sets the value of the attribute</p>
<p>Arguments</p>
<ul>
<li>value (Numeric, String, Array of Numeric, or NArray) : value of the attribute</li>
<li>atttype (nil or String) : data type of the attribute value.
nil lets it automatically determined from the value.
"char" (="string"), "byte", "sint", "int", "sfloat", or "float"
specifies the type explicitly (1,1,2,4,4,8 bytes, respectively)</li>
</ul>
<p>Return value</p>
<ul>
<li>nil</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_put_att_<type></li>
</ul></dd>
<dt><h4><a name="label:98" id="label:98"><code>get</code></a></h4></dt><!-- RDLabel: "get" -->
<dd>
<p>Returns the values of the attribute</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>String or an NArray object (NOTE: even a scalar is returned as
an NArray of length 1)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_get_att_<type></li>
</ul></dd>
<dt><h4><a name="label:99" id="label:99"><code>atttype</code></a></h4></dt><!-- RDLabel: "atttype" -->
<dd>
<p>Inquires the type of attribute values</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>"char","byte","sint","int","sfloat","float"</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_atttype</li>
</ul></dd>
<dt><h4><a name="label:100" id="label:100"><code>atttype</code></a></h4></dt><!-- RDLabel: "atttype" -->
<dd>
<p>Inquires the type of attribute values (returns a NArray typecode)</p>
<p>Arguments</p>
<ul>
<li>(none)</li>
</ul>
<p>Return value</p>
<ul>
<li>a Fixnum (NArray:BYTE, NArray:SINT, NArray:LINT, NArray:SFLOAT, NArray:SFLOAT, NArray:DFLOAT)</li>
</ul>
<p>Corresponding (dependent) function(s) in the C library of NetCDF</p>
<ul>
<li>nc_inq_atttype</li>
</ul></dd>
</dl>
</body>
</html>
|