Repository navigation
Expand file tree
/
Copy pathug05spreadsheet.html
More file actions
executable file
·438 lines (361 loc) · 16.3 KB
/
Copy pathug05spreadsheet.html
File metadata and controls
executable file
·438 lines (361 loc) · 16.3 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
<?php
$page_title = "HDFView User's Guide -- Table Viewer";
include ("../../../links.php");
include ("../../../includes/header.html");
?>
<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 a dataset of image. You can select rows
and columns and plot the row/cloumn data in 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>
If a dataset has three or more dimensions you can only view two dimensions
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.
<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></li>
<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 class="li2"><a href="ug05spreadsheet.html#ug05lineplot">5.3 Display 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 Value to Text File</a></li>
<li class="li2"><a href="ug05spreadsheet.html#ug05import">5.6 Import Data from Text File</a></li>
</UL>
<hr noshade size=1>
<h2>
<a NAME="ug05display"></a>5.1 Open Dataset</h2>
To open the entire content of dataset, double click on the dataset or select
the dataset then choose "Open" command from the Object menu or popup menu.
A new spreadsheet is created in the content panel of the HDFView.
<p>HDFView displays numerical datasets in a "spreadsheet", which shows the
data values in a grid. A one-dimensional dataset is displayed as one column
and number of rows of dimension size. A two-dimensional dataset is displayed
as number of columns of the first dimension size and 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 "Open As" command.
<p>
<center>
<img SRC="images/dataset_2d.gif" >
<br><b>Spreadsheet with 2D dataset</b></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 order of dimension to display, e.g., to switch the columns
and rows.
<p>To make a selection, select a dataset from the tree and choose "Open
As" command from the Object menu or the popup menu. The selection
dialog appears. You can make a selection by draging 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>
<img SRC="images/dataset_subset.gif" >
<br><b>Selection of Dataset.</b></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 in image, click the check box
of image in the selection dialog and select a predefined color table the 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.
<h3><a NAME="ug05subset_size"></a>
5.2.1 Dimension size</h3>
A subset is determined by the start and end locations and 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>
HDFView GUI uses common-sense indexing scheme for selecting rows and columns.
If I want a subset that begins at i,j the START coordinates will starts at j, j
instead of i-1, j-1.
<p>
Here is an example of 2D integer dataset of size 8 X 9.
<center>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="360" BGCOLOR="#FFF999" >
<caption><b>2D 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 2D int array
<p>
<center>
<img SRC="images/dataset_subset_example1.gif">
<br><b>the whole dataset -- start=(1, 1), end=(8, 9) and stride=(1, 1)</b>
</center>
<p>
<center>
<img SRC="images/dataset_subset_example2.gif">
<br><b>subset -- start=(2, 3), end=(6, 7) and stride=(1, 1)</b>
</center>
<p>
<center>
<b>subset with stride -- start=(2, 3), end=(6, 7) and stride=(2, 2)</b>
<img SRC="images/dataset_subset_example3.gif">
<br><b>subset with stride -- start=(2, 3), end=(6, 7) and stride=(2, 2)</b>
</center>
<h3><a NAME="ug05subset_3d"></a>
5.2.2 Three or More Dimensions</h3>
For a three or more dimensional dataset, the first two dimensions are displayed
as 2D spreadsheet and the third dimension is chosen as the page number
of the 2D spreadsheet, i.e. dim[0]=height, dim[1]=width and dim[2]=depth
by default. Using "Open As" to change the default order of dimensions.
You can flip the page forward or backward to look at the 2D data values
at different position along the third dimension. The current page number
is displayed in the status bar of the HDFView.
<p>To flip a data sheet of a 3D dataset, you can use the "First",
"Previous", "Next" or "Last" command on the tool bar.
<p>The following figure shows how a 5D integer dataset of size of
10 x 20 x 30 x 40 x 50 is displayed. The data is displayed in spreadsheet of 40 X 50
(dim3 by dim4) of page 2 (dim2) cuting locations 2 at dim0 and 3 at dim1.
<p>
<center>
<img SRC="images/dataset_3d.gif" >
<br><b>Spreadsheet with 3D dataset.</b></center>
<h3><a NAME="ug05subset_transpose"></a>
5.2.3 Swap Dimension and Data Transpose</h3>
By default, HDFView choose first coordinate dim[0] as COLUMN index, and the
second corrdinate dim[1] as ROW index. For example, a 2D dataset
of 8 X 9 (dim0=8, dim1=9) is displayed as eight rows and nine columns by default.
You can also swap the dimension order. However, swapping the dimension order does
not change the data order.
<p>
Let's use the previous example.
<center>
<table BORDER=0 CELLSPACING=0 COLS=1 WIDTH="360" BGCOLOR="#FFF999" >
<caption><b>2D 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.
<center>
<img SRC="images/dataset_subset_example1.gif">
<br><b>default dimension order -- row index = dim[0], column index = dim[1]</b>
</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>
<img SRC="images/dataset_reorder.gif">
<br><b>swap row/column dimensions -- row index = dim[1], column index = dim[0]</b>
</center>
<p>
At 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 normal dimension
order (not the swapped order) and check the "Transpose" checkbox. For example,
<p>
Transpose the data to display the dataset as nine rows and eight columns. The
order of data is also changed
<p>
<center>
<img SRC="images/dataset_transpose.gif">
<br><b>transpose data -- row index = dim[1], column index = dim[0]</b>
</center>
<h3><a NAME="ug05subset_compound"></a>
5.2.4 Compound Dataset Options</h3>
HDFView displays HDF4 Vdata and simple one dimension HDF5 compound dataset (without
nested compound) as a 2D table with rows as records and columns as fields/members.
<p>
<center>
<img SRC="images/dataset_compound.gif" >
<br><b>Compound Dataset</b></center>
<p>
You can also select fields/members to display. For contiguous selection, hold
down the "Shift" key while click the first and last fields/members of your selection.
For discontiguous selection, hold down the "Ctrl" key while click the fileds/members
to select.
<center>
<img SRC="images/dataset_subset_compound.gif" >
<br><b>Field/Member Selection of Compound Dataset</b></center>
<p>
HDFView displays nested HDF5 compound dataset as flat list of members. The nested
names are separated by ".". For example, if compound dataset "A" has the following
nested structure,
<pre>
A --> m01
A --> m02
A --> nest1 --> m11
A --> nest1 --> m12
A --> nest1 --> nest2 --> m21
A --> nest1 --> nest2 --> m22
i.e.
A = { m01, m02, nest1{m11, m12, nest2{ m21, m22}}}
</pre>
The flat list of members of the compound dataset "A" will be
{m01, m02, nest1.m11, nest1.m12, nest1.nest2.m21, nest1.nest2.m22}.
<p>
<center>
<img SRC="images/dataset_subset_nested.gif" >
<br><b>Nested Compound Dataset</b></center>
<p>
HDFView displays multi-dimension compound dataset as 2D table with nested sub-columns.
The members are shown in sub-columns.
<p>
<center>
<img SRC="images/dataset_compound_2d.gif" >
<br><b>2D Compound Dataset</b></center>
<h2>
<a NAME="ug05lineplot"></a>
5.3 Display Column/Row Line Plot</h2>
Column or row data of numerical values can be displayed in a simple line
plot. Select rows or columns by drag the mouse on the rows or column, respectively,
then click the chart icon: <img SRC="images/icon_chart.gif">.
The row or column data is plotted against column or row index, respectively.
HDFView displays up to 10 rows or columns a time.
<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.
<center>
<img SRC="images/chart_line.gif" >
<br><b>Line Plot.</b></center>
<h2>
<a NAME="ug05change"></a>
5.4 Change Data Value</h2>
You can change the values of a dataset in two ways: typing data into the table
cell or paste data from system clipboard. HDFView will reject invalid data values.
For example, it will not accept a floating point number into an integer
dataset. Table 5.1
lists the rules for entering data. <b><i>The change of data value is only in
memory. It is not saved to file untill 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 COLS=2 WIDTH="100%" >
<tr>
<td><b>Data type</b></td>
<td><b>Acceptable formats</b></td>
</tr>
<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</b> <b>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, you select the data cells
to copy, then choose the "Copy Data" command from the "Object" menu. Select where
to copy the data to and select the "Paste Data" command.
<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, select and
copy data from the application, then paste the data to the HDFView TableView,
<i>vice versa</i>.
<p>
You can also change values by predefined math functions. To change table values, you
select the data area and choose "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 selected data cells will be changed based on the
mathematic function.
<h2>
<a NAME="ug05save"></a>
5.5 Save Data Value to Text File</h2>
Writing table data into ASCII file is nearly transparent. Select "Save As Text" from
the object menu and the file dialog 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. HDFView cannot read
back the text file</I></B>.
<center>
<img SRC="images/save_as_text.gif" >
<br><b>Save As Text</b></center>
<h2>
<a NAME="ug05import"></a>
5.6 Import Data from Text File</h2>
You can fill the table cells directly from text file. Choose "Import Data From Text File"
command from table menu and select the text file to import. The data values must be
separated by 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,
<pre>
10 11 12 13 14 15
16 17 18 19 20 21
</pre>
and
<pre>
10 11 12 13
14 15 16 17
18 19
20 21
</pre>
are the same.
<?php
include ("../../../includes/footer.html");
?>