Repository navigation
Expand file tree
/
Copy pathug05spreadsheet.html
More file actions
executable file
·520 lines (451 loc) · 20.5 KB
/
Copy pathug05spreadsheet.html
File metadata and controls
executable file
·520 lines (451 loc) · 20.5 KB
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
<?php
$page_title = "HDFView User's Guide -- Table Viewer";
include ("../../../links.php");
include ("../../../includes/header.html");
?>
<link href="edit.css" rel="stylesheet" type="text/css" />
<p>
<a href="index.html">[Index]</a>
<a href="ug01introduction.html">[1]</a>
<a href="ug02start.html">[2]</a>
<a href="ug03objects.html">[3]</a>
<a href="ug04treeview.html">[4]</a>
<a href="ug05spreadsheet.html">[5]</a>
<a href="ug06imageview.html">[6]</a>
<a href="ug07textview.html">[7]</a>
</p>
<p>
<fieldset><h1>Chapter 5: Table Viewer</h1></fieldset>
</p>
<p>
HDFView displays datasets in a two-dimensional table, the TableView. The TableView
allows you to view and change the values of an image's dataset. You can select rows
and columns and plot the row/cloumn data in a line plot. The current version of
HDFView does not allow
you to change data values of an HDF4 Vdata or an HDF5 compound dataset.</p>
<p>
If a dataset has three or more dimensions you can only view two dimensions at a time. Using the <a href="images/dataset_open_as.gif"> Dataset Selection Dialog </a>,
you may select any two dimensions of the dataset to display and a third dimension
to flip the two-dimension table along that dimension.</p>
<ul class="ul">
<li class="li2"><a href="ug05spreadsheet.html#ug05display">5.1 Open Dataset</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05subset">5.2 Subset and Dimension Selection</a>
<ul class="ul">
<li class="li2"> <a href="ug05spreadsheet.html#ug05subset_size">5.2.1 Dimension Size</a></li>
<li class="li2"> <a href="ug05spreadsheet.html#ug05subset_3d">5.2.2 Three or More Dimensions</a></li>
<li class="li2"> <a href="ug05spreadsheet.html#ug05subset_transpose">5.2.3 Swap Dimension and Data Transpose</a></li>
<li class="li2"> <a href="ug05spreadsheet.html#ug05subset_compound">5.2.4 Compound Dataset Options</a></li>
</ul></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05lineplot">5.3 Display a Column/Row Line Plot</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05change">5.4 Change Data Value</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05save">5.5 Save Data Values to a Text File</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05import">5.6 Import Data from a Text File</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05datasetreferences">5.7 Dataset storing references</a></li>
<ul class="ul">
<li class="li2"> <a href="ug05spreadsheet.html#ug05objectref">5.7.1 Dataset Storing Object References</a></li>
<li class="li2"> <a href="ug05spreadsheet.html#ug05regionalref">5.7.2 Dataset Storing Dataset Region References</a></li>
</ul></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05savebinary">5.8 Sava Data Values to a Binary File</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05importbinary">5.9 Import Data from a Binary File</a></li>
</ul>
<hr noshade size=1 />
<h2>
<a name="ug05display"></a>5.1 Open Dataset</h2>
<p>
To open the entire contents of a dataset, double-click on the dataset or select
the dataset, then choose the "Open" command from the Object menu or popup menu.
A new spreadsheet is created in the content panel of HDFView.</p>
<p>HDFView displays numerical datasets in a "spreadsheet", which shows the
data values in a grid. A one-dimensional dataset is displayed as a single column
and a number of rows of dimension size. A two-dimensional dataset is displayed
as a number of columns of the first dimension size and a number of rows of
the second dimension size, i.e. dim[0]=height and dim[1]=width by default.
You can change the order of the dimensions using the "Open As" command.</p>
<center><p>
<img src="images/dataset_2d.gif" />
<br />
<b>Spreadsheet with a 2-D dataset</b></p>
</center>
<h2>
<a name="ug05subset"></a>5.2 Subset and Dimension Selection</h2>
<p>Opening an entire large dataset may cause an 'Out Of Memory Error' because
the Java Virtual Machine cannot create the required objects. HDFView provides
options to select a subset of a dataset for display. You can also select
dimensions and the order of dimensions to display, e.g., to switch the columns
and rows.</p>
<p>To make a selection, select a dataset from the tree and choose the "Open
As" command from the Object menu or the popup menu. The selection
dialog box appears. You can make a selection by dragging the mouse on the preview
image or entering the values of start, end, and stride. The figure below shows that
a subset is selected from a true color image with the size of 3796 x 3720.</p>
<center><p>
<img src="images/dataset_subset.png" />
<br /><b>Selection of Dataset.</b></p></center>
<p>By default, a scalar dataset (e.g., a dataset or SDS of numbers)
is displayed in a spreadsheet. You can also display
a dataset as an image. To display a dataset as an image, click the Image radio button in the Dataset
Selection dialog box and select a predefined color table for the
dataset. This operation takes the data values of the dataset as values of an
indexed array, i.e., as indexes into a palette. The default palette will
be used to create the image from the dataset if it does not have an attached
palette. If the data values are not integers or have a range outside
0 to 255: they are binned into 256 equally spaced intervals.</p>
<h3><a name="ug05subset_size"></a>
5.2.1 Dimension Size</h3>
<p>
A subset is determined by the start and end locations, and the stride. The "Start"
array determines the starting coordinates of the subset to select. The "End"
array determines the ending coordinates of the subset to select. The "Stride"
array chooses array locations from the dataspace with each value in the stride
array determining how many elements to move in each dimension. Setting a value
in the stride array to 1 moves to each element in that dimension of the dataspace;
setting a value of 2 in a location in the stride array moves to every other
element in that dimension of the dataspace. In other words, the stride determines
the number of elements to move from the start location in each dimension.</p>
<p>
HDFView GUI uses a common-sense indexing scheme for selecting rows and columns.
If the user wants a subset that begins at i,j the START coordinates will start at j, j
instead of i-1, j-1.</p>
<p>
The following is an example of a 2-D integer dataset of size 8 X 9.</p>
<center>
<table border="0" cellspacing="0" cellpadding="1" width="360" bgcolor="#FFF999" >
<caption>
<b>2-D int array of size 8X9</b>
</caption>
<tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td></tr>
<tr><td>21</td><td>22</td><td>23</td><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td></tr>
<tr><td>31</td><td>32</td><td>33</td><td>34</td><td>35</td><td>36</td><td>37</td><td>38</td><td>39</td></tr>
<tr><td>41</td><td>42</td><td>43</td><td>44</td><td>45</td><td>46</td><td>47</td><td>48</td><td>49</td></tr>
<tr><td>51</td><td>52</td><td>53</td><td>54</td><td>55</td><td>56</td><td>57</td><td>58</td><td>59</td></tr>
<tr><td>61</td><td>62</td><td>63</td><td>64</td><td>65</td><td>66</td><td>67</td><td>68</td><td>69</td></tr>
<tr><td>71</td><td>72</td><td>73</td><td>74</td><td>75</td><td>76</td><td>77</td><td>78</td><td>79</td></tr>
<tr><td>81</td><td>82</td><td>83</td><td>84</td><td>85</td><td>86</td><td>87</td><td>88</td><td>89</td></tr>
</table>
</center>
<p>
The following are a few examples of subsets of the 2-D int array.</p>
<center><p>
<img src="images/dataset_subset_example1.gif" />
<br />
<b>The whole dataset -- start=(0, 0), end=(7, 8) and stride=(1, 1)</b></p>
</center>
<center><p>
<img src="images/dataset_subset_example2.gif" />
<br />
<b>Subset -- start=(2, 3), end=(6, 7) and stride=(1, 1)</b></p>
</center>
<center><p>
<img src="images/dataset_subset_example3.gif" />
<br />
<b>Subset with stride -- start=(2, 3), end=(7, 8) and stride=(2, 2)</b></p>
</center>
<h3><a name="ug05subset_3d"></a>
5.2.2 Three or More Dimensions</h3>
<p>
For a three or more dimensional dataset, the first two dimensions are displayed
as a 2-D spreadsheet, and the third dimension is chosen as the page number
of the 2-D spreadsheet, i.e. dim[0]=height, dim[1]=width and dim[2]=depth
by default. Using the "Open As" option to change the default order of dimensions, the user can flip the page forward or backward to look at the 2D data values
at different positions along the third dimension. The current page number
is displayed in the status bar of the HDFView.</p>
<p>To flip a data sheet of a 3-D dataset, use the "First",
"Previous", "Next" or "Last" command on the tool bar.</p>
<p>The following figure shows how a 4-D integer dataset of size 5 x 4 x 3 x 2 is displayed.
The data is displayed in a spreadsheet of 5 X 4
(dim0 by dim1), of page 2 (dim2), cutting locations 2 at dim3.</p>
<center><p>
<img src="images/dataset_3d.gif" />
<br />
<b>Spreadsheet with 4-D dataset <span class="comment"></b></p>
</center>
<h3><a name="ug05subset_transpose"></a>
5.2.3 Swap Dimension and Data Transpose</h3>
<p>
By default, HDFView chooses the first coordinate, dim[0], as the
ROW index and the second coordinate, dim[1], as the COLUMN index.
For example, a 2-D dataset of 8 X 9 (dim0=8, dim1=9) is displayed
as eight rows and nine columns by default.</p>
<p>
You can also swap the dimension order. However, swapping the dimension
order does not change the data order. To change the data order,
use the "Transpose" option. Swapping and transposing only apply
to the data in the display and not to the data in the file.</p>
<p>
Let us use the previous example to demonstrate this procedure.</p>
<center>
<table border="0" cellspacing="0" cellpadding="1" width="360" bgcolor="#FFF999" >
<caption>
<b>2-D int array of size 8X9</b>
</caption>
<tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td></tr>
<tr><td>21</td><td>22</td><td>23</td><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td></tr>
<tr><td>31</td><td>32</td><td>33</td><td>34</td><td>35</td><td>36</td><td>37</td><td>38</td><td>39</td></tr>
<tr><td>41</td><td>42</td><td>43</td><td>44</td><td>45</td><td>46</td><td>47</td><td>48</td><td>49</td></tr>
<tr><td>51</td><td>52</td><td>53</td><td>54</td><td>55</td><td>56</td><td>57</td><td>58</td><td>59</td></tr>
<tr><td>61</td><td>62</td><td>63</td><td>64</td><td>65</td><td>66</td><td>67</td><td>68</td><td>69</td></tr>
<tr><td>71</td><td>72</td><td>73</td><td>74</td><td>75</td><td>76</td><td>77</td><td>78</td><td>79</td></tr>
<tr><td>81</td><td>82</td><td>83</td><td>84</td><td>85</td><td>86</td><td>87</td><td>88</td><td>89</td></tr>
</table>
</center>
<p>
By default, the dataset is displayed at eight rows and nine columns.</p>
<center><p>
<img src="images/dataset_subset_example1.gif" />
<br />
<b>Default dimension order -- row index = dim[0], column index = dim[1]</b></p>
</center>
<p>
Swap row and column dimensions to display the dataset as nine rows and eight columns. The
order of data stays the same (counting from the location [0, 0], [0, 1], ... [2, 0], [2, 1], ...).</p>
<center><p>
<img src="images/dataset_reorder.gif" />
<br />
<b>Swap row/column dimensions -- row index = dim[1], column index = dim[0]</b></p>
</center>
<p>
In some cases, we also want to transpose the data (changing the data order) when
we swap the row and column dimensions. To transpose the data, select the "Transpose"
option from the drop-down menu. For example, transpose the data to display the dataset as
nine rows and eight columns. The order of the data is also changed</p>
<center><p>
<img src="images/dataset_transpose.gif" />
<br />
<b>Transpose data -- row index = dim[1], column index = dim[0]</b></p>
</center>
<h3><a name="ug05subset_compound"></a>
5.2.4 Compound Dataset Options</h3>
<p>
HDFView displays HDF4 Vdata and a simple, one-dimension HDF5 compound dataset (without a nested compound) as a 2-D table with rows as records and columns as fields/members.</p>
<center><p>
<img src="images/dataset_compound.gif" >
<br /><b>Compound Dataset</b></p></center>
<p>
You can also select fields/members to display. For a contiguous selection, hold
down the "Shift" key while clicking the first and last fields/members of your selection.
For a discontiguous selection, hold down the "Ctrl" key while clicking the fileds/members that you want to select.</p>
<center><p>
<img src="images/dataset_subset_compound.gif" />
<br /><b>Field/Member Selection of Compound Dataset</b></p></center>
<p>
HDFView displays a nested HDF5 compound dataset as a flat list of members. The nested
names are separated by "." (a period). For example, if a compound dataset "A" has the following
nested structure:</p>
<pre>
A --> a_name
A --> b_name
A --> c_name
A --> nested_name --> a_name
A --> nested_name --> c_name
i.e.
A = {a_name, b_name, c_name, nested_name{a_name, c_name}}
</pre>
<p>
The flat list of members of the compound dataset "A" will be
{a_name, b_name, c_name, nested_name->a_name, nested_name->c_name}}.</p>
<center><p>
<img src="images/dataset_subset_nested.gif" />
<br /><b>Nested Compound Dataset</b></p></center>
<p>
HDFView displays multi-dimension compound datasets as a 2-D table with nested sub-columns.
The members are shown in the sub-columns.</p>
<center><p>
<img src="images/dataset_compound_2d.gif" />
<br />
<b>2-D Compound Dataset</b></p>
</center>
<h2>
<a name="ug05lineplot"></a>
5.3 Display a Column/Row Line Plot</h2>
<p>
Column or row data of numerical values can be displayed in a simple line
plot. Select rows or columns by dragging the mouse on the rows or columns that you want to plot;
then click the chart icon: <img src="images/icon_chart.gif" />
The row or column data is plotted against a column or row index, respectively.<span class="comment">[Comment: Do you mean respectively or sonversely? You say "row or column data ... against ...column or row index".] HDFView displays up to 10 rows or columns at a time.</p>
<p>The following figure shows that data of five columns are displayed in five
lines of different colors. The horizontal labels are the row index of the
100 data points. The vertical labels are the ten points of equal data range
with the maximum and minimum of the column data. The line legend is drawn at
the right of the line plot with column names and line colors.</p>
<center><p>
<img src="images/chart_line.gif" />
<br /><b>Line Plot</b></p>
</center>
<h2>
<a name="ug05change"></a>
5.4 Change Data Value</h2>
<p>
You can change the values of a dataset in two ways: type data into the table
cell or paste data from the system clipboard. HDFView rejects invalid data values.
For example, it does not accept a floating point number into an integer
dataset. Table 5.1
lists the rules for entering data. <b><i>Any </i></b><b><i>changes of data values only exist in
memory. They are not saved to file until you choose "Update File" from the Object
menu, or, when you dismiss the table, you will be asked if you want to save the change
to the file</i></b>.</p>
<center><table border="2" width="100%" >
<thead><tr>
<th><b>Data type</b></th>
<th><b>Acceptable formats</b></th></tr>
</thead>
<tr>
<td>byte</td>
<td>-127 to 128</td>
</tr>
<tr>
<td>short</td>
<td>-32768 to 32767</td>
</tr>
<tr>
<td>int</td>
<td>-2147483648 to 2147483647</td>
</tr>
<tr>
<td>float, double</td>
<td>Numbers of the form "99.9" or "8", and "-9.9" or "-9", and ".9" or
"-.9" Numeric overflow or underflow will be detected.</td>
</tr>
<tr>
<td>string</td>
<td>A string longer than the stored value will be silently truncated when
written to the file.</td>
</tr>
<tr>
<td>unsigned byte</td>
<td>0 to 255</td>
</tr>
<tr>
<td>unsigned short</td>
<td>0 to 65535</td>
</tr>
<tr>
<td>unsigned int</td>
<td>0 to 4294967295</td>
</tr>
<caption align="bottom">
<b>Table 5.1 Data Formats for Entering Data</b>
</caption>
</table></center>
<p>
Data values can be copied with "Copy" and "Paste". Data can be copied within a
spreadsheet or between two spreadsheets. To copy data, select the data cells
to copy, then choose the "Copy Data" command from the "Object" menu. Then select the cells to paste into and select the "Paste Data" command from the "Object" menu.</p>
<p>
You can also copy and paste between HDFView and other applications. To copy external
data from other application such as a text editor or MS Spreadsheet<span class="comment">[Comment: Do you mean Microsoft Excel?], select and
copy data from the application, then paste the data into the HDFView TableView, and vice versa.</p>
<p>
You can also change values by using predefined math functions. To change table values, select the data area and choose the "Math conversion" command from the "Table" menu. A list
of predefined mathematic functions are provided. Select a function and enter the
function parameters. The values of the selected data cells will be changed based on the
mathematic function.</p>
<h2>
<a name="ug05save"></a>
5.5 Save Data Values to a Text File</h2>
<p>
Writing table data into an ASCII file is nearly transparent. Select "Export data to Text File" from
the "Table" menu, and the Save Current Data to Text
File dialog box pops up for you to enter the name of the file.
The data values of the current table will be written to the file. The data values
are separated by the data delimiter specified by the user options. <b><i>The text
file does not contain any datatype and dataspace information.</i></b>.</p>
<center><p>
<img src="images/save_as_text.gif" />
<br />
<b>Save Current Data to Text File</b></p>
</center>
<h2>
<a name="ug05import"></a>
5.6 Import Data from a Text File</h2>
<p>
You can fill the table cells directly from a text file. Choose the "Import Data From Text File"
command from the "Table" menu and select the text file to import. The data values must be
separated by a space or the delimiter specified in the "User Options". The cells of
the table are filled row by row starting with the selected cell. The line breaks in the
text file are not important. For example,</p>
<pre>
10 11 12 13 14 15
16 17 18 19 20 21
</pre>
<p>
and
</p>
<pre>
10 11 12 13
14 15 16 17
18 19
20 21
</pre>
<p>
are the same.</p>
<h2>
<a name="ug05datasetreferences"></a>
5.7 Dataset storing references</h2>
<p>A dataset can store reference values of other datasets in the same file.</p>
<h3><a name="ug05objectref"></a>
5.7.1 Dataset Storing Object References</h3>
<p>
A dataset can store object references of other datasets. You can open a dataset containing object references. You can then right click on any value
in the dataset and it will give two options, to either open as a table or an image.</p>
<center><p>
<img src="images/dataset_object_references.png" />
<br />
<b>Dataset storing object references</b></p>
</center>
<p>
If opened as a table, then the dataset of reference value "7428" is opened as shown below</p>
<center><p>
<img src="images/data_pointed_by_ref.png" />
<br />
<b>Dataset pointed by object reference</b></p>
</center>
<h3><a name="ug05regionalref"></a>
5.7.2 Dataset Storing Dataset Region References</h3>
<p>
A dataset can store dataset region reference values. You can right click on any value to either show the dataset as a table or a image.</p>
<center><p>
<img src="images/dataset_region_ref.png" />
<br />
<b>Dataset pointed by region reference</b></p>
</center>
<h2>
<a name="ug05savebinary"></a>
5.8 Save Data Values to a Binary File</h2>
<p>
The table data can be written to a binary file. Select "Export Data to Binary File" from
the "Table" menu. Select the order in which you want the bytes to be. The "Save Current Data to Binary
File" dialog box pops up for you to enter the name of the file.
The data values of the current table will be written to the file. <b><i>The binary
file does not contain any datatype and dataspace information. Currently, only the entire contents of the table are wrriten to a binary file.</i></b>.</p>
<center><p>
<img src="images/save_as_binary.png" />
<br />
<b>Save Current Data to Binary File</b></p>
</center>
<h2>
<a name="ug05importbinary"></a>
5.9 Import Data from a Binary File</h2>
<p>
You can fill the table directly from a binary file. Choose the "Import Data From Binary File"
command from the "Table" menu and select the byte order. It is assumed that the user should know the data type in the binary file and the byte order.
Select the binary file to import. The cells of
the table are filled with the corresponding values.
<!-- BEGIN OF FOOTER INFO -->
<hr noshade size=1 />
<p>
<a href="index.html">[Index]</a>
<a href="ug01introduction.html">[1]</a>
<a href="ug02start.html">[2]</a>
<a href="ug03objects.html">[3]</a>
<a href="ug04treeview.html">[4]</a>
<a href="ug05spreadsheet.html">[5]</a>
<a href="ug06imageview.html">[6]</a>
<a href="ug07textview.html">[7]</a>
</p>
<p>
<!-- END OF FOOTER INFO -->
<!--
<?php
include ("../../../includes/footer.html");
?>
-->