summaryrefslogtreecommitdiffstats
path: root/doc/html/Dataspaces.html
blob: 439ddb2ae8093853995e03a13ab0d229ebf52707 (plain)
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
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <TITLE>Dataspace Interface (H5S)</TITLE>
</HEAD>
<body bgcolor="#FFFFFF">


<hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
   <a href="H5.intro.html">Introduction to HDF5</a>&nbsp;<br>
   <a href="RM_H5Front.html">HDF5 Reference Manual</a>&nbsp;<br>
   <a href="index.html">Other HDF5 documents and links</a>&nbsp;<br>
   <!--
   <a href="Glossary.html">Glossary</a><br>
   -->
</td>
<td valign=top align=right>
   And in this document, the 
   <a href="H5.user.html"><strong>HDF5 User's Guide:</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;
      <br>
      <a href="Files.html">Files</a>&nbsp;&nbsp;
      <a href="Datasets.html">Datasets</a>&nbsp;&nbsp;
      <a href="Datatypes.html">Datatypes</a>&nbsp;&nbsp;
      Dataspaces&nbsp;&nbsp;
      <a href="Groups.html">Groups</a>&nbsp;&nbsp;
      <br>
      <a href="References.html">References</a>&nbsp;&nbsp;
      <a href="Attributes.html">Attributes</a>&nbsp;&nbsp;
      <a href="Properties.html">Property Lists</a>&nbsp;&nbsp;
      <a href="Errors.html">Error Handling</a>&nbsp;&nbsp;
      <br>
      <a href="Filters.html">Filters</a>&nbsp;&nbsp;
      <a href="Caching.html">Caching</a>&nbsp;&nbsp;
      <a href="Chunking.html">Chunking</a>&nbsp;&nbsp;
      <a href="MountingFiles.html">Mounting Files</a>&nbsp;&nbsp;
      <br>
      <a href="Performance.html">Performance</a>&nbsp;&nbsp;
      <a href="Debugging.html">Debugging</a>&nbsp;&nbsp;
      <a href="Environment.html">Environment</a>&nbsp;&nbsp;
      <a href="ddl.html">DDL</a>&nbsp;&nbsp;
</td></tr>
</table>
</center>
<hr>


<H1>
The Dataspace Interface (H5S)</H1>

<H2>
1. Introduction</H2>
The dataspace interface (H5S) provides a mechanism to describe the positions
of the elements of a dataset and is designed in such a way as to allow
new features to be easily added without disrupting applications that use
the dataspace interface. A dataset (defined with the dataset interface) is
composed of a collection of raw data points of homogeneous type, defined in the
datatype (H5T) interface, organized according to the dataspace with this
interface.

<P>A dataspace describes the locations that dataset elements are located at.
A dataspace is either a regular N-dimensional array of data points,
called a <I>simple</I> dataspace, or a more general collection of data
points organized in another manner, called a <I>complex</I> dataspace.
A <I>scalar</I> dataspace is a special case of the <I>simple</I> data
space and is defined to be a 0-dimensional single data point in size. Currently
only <I>scalar</I> and <I>simple</I> dataspaces are supported with this version
of the H5S interface.
<I>Complex</I> dataspaces will be defined and implemented in a future
version.  <I>Complex</I> dataspaces are intended to be used for such structures
which are awkward to express in <I>simple</I> dataspaces, such as irregularly
gridded data or adaptive mesh refinement data. This interface provides
functions to set and query properties of a dataspace.

<P>Operations on a dataspace include defining or extending the extent of
the dataspace, selecting portions of the dataspace for I/O and storing the
dataspaces in the file.  The extent of a dataspace is the range of coordinates
over which dataset elements are defined and stored.  Dataspace selections are 
subsets of the extent (up to the entire extent) which are selected for some
operation.

<P>For example, a 2-dimensional dataspace with an extent of 10 by 10 may have
the following very simple selection:
    <br><br><center>
      <table border cellpadding=4>
	<tr align=center>
	  <th > </th> <th >0</th> <th >1</th> <th >2</th> <th >3</th> <th >4</th> <th >5</th> <th >6</th> <th >7</th> <th >8</th> <th >9</th>
	<tr align=center>
	  <th>0</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>1</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>2</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>3</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>4</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>5</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>6</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>7</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>8</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>9</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
      </table>
      <br><strong>Example 1: Contiguous rectangular selection</strong>
    </center>


<br>Or, a more complex selection may be defined:
    <br><br><center>
      <table border cellpadding=4>
	<tr align=center>
	  <th > </th> <th >0</th> <th >1</th> <th >2</th> <th >3</th> <th >4</th> <th >5</th> <th >6</th> <th >7</th> <th >8</th> <th >9</th>
	<tr align=center>
	  <th>0</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>1</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>2</th>
          <td>-</td><td>X</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>3</th>
          <td>-</td><td>X</td><td>-</td><td>X</td><td>-</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>4</th>
          <td>-</td><td>X</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>5</th>
          <td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>6</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>7</th>
          <td>-</td><td>-</td><td>X</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>8</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>9</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
      </table>
      <br><strong>Example 2: Non-contiguous selection</strong>
    </center>

<P>Selections within dataspaces have an offset within the extent which is used
to locate the selection within the extent of the dataspace.  Selection offsets
default to 0 in each dimension, but may be changed to move the selection within
a dataspace.  In example 2 above, if the offset was changed to 1,1, the selection
would look like this:
    <br><br><center>
      <table border cellpadding=4>
	<tr align=center>
	  <th > </th> <th >0</th> <th >1</th> <th >2</th> <th >3</th> <th >4</th> <th >5</th> <th >6</th> <th >7</th> <th >8</th> <th >9</th>
	<tr align=center>
	  <th>0</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>1</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>2</th>
          <td>-</td><td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>X</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>3</th>
          <td>-</td><td>-</td><td>X</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>4</th>
          <td>-</td><td>-</td><td>X</td><td>-</td><td>X</td><td>-</td><td>-</td><td>X</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>5</th>
          <td>-</td><td>-</td><td>X</td><td>-</td><td>X</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>6</th>
          <td>-</td><td>-</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>X</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>7</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>8</th>
          <td>-</td><td>-</td><td>-</td><td>X</td><td>X</td><td>X</td><td>X</td><td>-</td><td>-</td><td>-</td>
	<tr align=center>
	  <th>9</th>
          <td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td>
      </table>
      <br><strong>Example 3: Non-contiguous selection with 1,1 offset</strong>
    </center>

<P>Selections also have a linearization ordering of the points selected
(defaulting to "C" order, ie. last dimension changing fastest).  The
linearization order may be specified for each point or it may be chosen by
the axis of the dataspace.  For example, with the default "C" ordering,
example 1's selected points are iterated through in this order: (1,1), (1,2),
(1,3), (2,1), (2,2), etc.  With "FORTRAN" ordering, example 1's selected points 
would be iterated through in this order: (1,1), (2,1), (3,1), (4,1), (5,1),
(1,2), (2,2), etc.

<P>A dataspace may be stored in the file as a permanent object, to allow many
datasets to use a commonly defined dataspace.  Dataspaces with extendable
extents (ie. unlimited dimensions) are not able to be stored as permanent
dataspaces.

<P>Dataspaces may be created using an existing permanent dataspace as a
container to locate the new dataspace within.  These dataspaces are complete
dataspaces and may be used to define datasets.  A dataspaces with a "parent"
can be queried to determine the parent dataspace and the location within the
parent.  These dataspaces must currently be the same number of dimensions as
the parent dataspace.

<H2> 2. General Dataspace Operations</H2>
The functions defined in this section operate on dataspaces as a whole.
New dataspaces can be created from scratch or copied from existing data
spaces. When a dataspace is no longer needed its resources should be released
by calling <TT>H5Sclose()</TT>.
<DL>

<DT>
<TT>hid_t H5Screate(H5S_class_t <I>type</I>)</TT></DT>

<DD>
    This function creates a new dataspace of a particular <I>type</I>.  The
types currently supported are H5S_SCALAR and H5S_SIMPLE; 
others are planned to be added later.  
</DD>

<DT>
<TT>hid_t H5Sopen(hid_t <I>location</I>, const char *<I>name</I>)</TT></DT>

<DD>
    This function opens a permanent dataspace for use in an application.
The <I>location</I> argument is a file or group ID and <I>name</I> is
an absolute or relative path to the permanent dataspace.  The dataspace ID which
is returned is a handle to a permanent dataspace which can't be modified.
</DD>

<DT>
<TT>hid_t H5Scopy (hid_t <I>space</I>)</TT></DT>

<DD>
    This function creates a new dataspace which is an exact copy of the
dataspace <I>space</I>.
</DD>

<DT>
<TT>hid_t H5Ssubspace (hid_t <I>space</I>)</TT></DT>

<DD>
    This function uses the currently defined selection and offset in <I>space</I>
to create a dataspace which is located within <I>space</I>.  The <I>space</I>
dataspace must be a sharable dataspace located in the file, not a dataspace for
a dataset.  The relationship of the new dataspace within the existing dataspace
is preserved when the new dataspace is used to create datasets.  Currently,
only subspaces which are equivalent to simple dataspaces (ie. rectangular
contiguous areas) are allowed.  A subspace is not "simplified" or reduced in
the number of dimensions used if the selection is "flat" in one dimension, they
always have the same number of dimensions as their parent dataspace.
</DD>

<DT>
<TT>herr_t H5Scommit (hid_t <I>location</I>, const char *<I>name</I>, hid_t <I>space</I>)</TT></DT>

<DD>
    The dataspaces specified with <I>space</I> is stored in the file specified
by <I>location</I>.  <I>Location</I> may be either a file or group handle
and <I>name</I> is an absolute or relative path to the location to store the
dataspace.  After this call, the dataspace is permanent and can't be modified.
</DD>

<DT>
<TT>herr_t H5Sclose (hid_t <I>space</I>)</TT></DT>

<DD>
Releases resources associated with a dataspace. Subsequent use of the
dataspace identifier after this call is undefined.
</DD>

<!--		NOT YET IMPLEMENTED (R1.2 -- 9908)

<DT>
<TT>H5S_class_t H5Sextent_class (hid_t <I>space</I>)</TT></DT>

<DD>
Query a dataspace to determine the current class of a dataspace.  The value
which is returned is one of: H5S_SCALAR, H5S_SIMPLE on success or
H5S_NO_CLASS on failure.
</DD>

-->

</DL>


<H2> 3. Dataspace Extent Operations</H2>
These functions operate on the extent portion of a dataspace.

<DL>
<DT>
<TT>herr_t H5Sset_extent_simple (hid_t <I>space</I>, int <I>rank</I>, const hsize_t
*<I>current_size</I>, const hsize_t *<I>maximum_size</I>)</TT></DT>

<DD>
Sets or resets the size of an existing dataspace, where <I>rank</I> is
the dimensionality, or number of dimensions, of the dataspace.
<I>current_size</I> is an array of size <I>rank</I> which contains the new size
of each dimension in the dataspace.  <I>maximum_size</I> is an array of size
<I>rank</I> which contains the maximum size of each dimension in the dataspace. 
Any previous extent is removed from the dataspace, the dataspace type is set to
H5S_SIMPLE and the extent is set as specified.
</DD>

<DT>
<TT>herr_t H5Sset_extent_none (hid_t <I>space</I>)</TT></DT>

<DD>
Removes the extent from a dataspace and sets the type to H5S_NO_CLASS.
</DD>

<DT>
<TT>herr_t H5Sextent_copy (hid_t <I>dest_space</I>,
    hid_t <I>source_space</I>)</TT></DT>

<DD>
Copies the extent from <I>source_space</I> to <I>dest_space</I>, which may
change the type of the dataspace.  Returns non-negative on success, negative on
failure.
</DD>

<DT>
<TT>hsize_t H5Sget_simple_extent_npoints (hid_t <I>space</I>)</TT></DT>

<DD>
This function determines the number of elements in a dataspace. For example, a
simple 3-dimensional dataspace with dimensions 2, 3 and 4 would have 24
elements.
Returns the number of elements in the dataspace, negative on failure.
</DD>

<DT>
<TT>int H5Sget_simple_extent_ndims (hid_t <I>space</I>)</TT></DT>

<DD>
This function determines the dimensionality (or rank) of a dataspace. 
Returns the number of dimensions in the dataspace, negative on failure.
</DD>

<DT>
<TT>herr_t H5Sget_simple_extent_dims (hid_t <I>space</I>, hsize_t *<I>dims</I>,
    hsize_t *<I>max</I>)</TT></DT>

<DD>
The function retrieves the size of the extent of the dataspace <I>space</I> by
placing the size of each dimension in the array <I>dims</I>.  Also retrieves
the size of the maximum extent of the dataspace, placing the results in
<I>max</I>.
Returns non-negative on success, negative on failure.
</DD>

</DL>

<H2> 4. Dataspace Selection Operations</H2>
Selections are maintained separately from extents in dataspaces and operations
on the selection of a dataspace do not affect the extent of the dataspace.
Selections are independent of extent type and the boundaries of selections are
reconciled with the extent at the time of the data transfer.  Selection offsets
apply a selection to a location within an extent, allowing the same selection
to be moved within the extent without requiring a new selection to be specified.
Offsets default to 0 when the dataspace is created.  Offsets are applied when
an I/O transfer is performed (and checked during calls to H5Sselect_valid).
Selections have an iteration order for the points selected, which can be any
permutation of the dimensions involved (defaulting to 'C' array order) or a
specific order for the selected points, for selections composed of single array
elements with H5Sselect_elements.  Selections can also be copied or combined
together in various ways with H5Sselect_op.  Further methods of selecting
portions of a dataspace may be added in the future.

<DL>
<DT>
<TT>herr_t H5Sselect_hyperslab (hid_t <I>space</I>, h5s_selopt_t <I>op</I>,
    const hssize_t * <I>start</I>, const hsize_t * <I>stride</I>,
    const hsize_t * <I>count</I>, const hsize_t * <I>block</I>)</TT></DT>

<DD>
This function selects a hyperslab region to add to the current selected region
for the <I>space</I> dataspace.  The <I>start</I>, <I>stride</I>, <I>count</I>
and <I>block</I> arrays must be the same size as the rank of the dataspace.  
The selection operator <I>op</I> determines how the new selection is to be
combined with the already existing selection for the dataspace.  
Currently, The following operators are supported:
  <dir>
  <table width=80% border=0>
    <tr><td valign=top>
      <code>H5S_SELECT_SET</code>
      </td><td valign=top>
      Replaces the existing selection with the parameters from this call.  
      Overlapping blocks are not supported with this operator.
    </td></tr><tr><td valign=top>
      <code>H5S_SELECT_OR</code>
      </td><td valign=top>
      Adds the new selection to the existing selection.
    </td></tr>
  </table>
  </dir>
<P>
The <I>start</I> array determines the starting coordinates of the hyperslab
to select.  The <I>stride</I> array chooses array locations from the dataspace
with each value in the <I>stride</I> array determining how many elements to move
in each dimension.  Setting a value in the <I>stride</I> array to 1 moves to
each element in that dimension of the dataspace, setting a value of 2 in a
location in the <I>stride</I> array moves to every other element in that
dimension of the dataspace.  In other words, the <I>stride</I> determines the
number of elements to move from the <I>start</I> location in each dimension.
Stride values of 0 are not allowed.  If the <I>stride</I> parameter is <TT>NULL</TT>,
a contiguous hyperslab is selected (as if each value in the <I>stride</I> array
was set to all 1's).  The <I>count</I> array determines how many blocks to
select from the dataspace, in each dimension.  The <I>block</I> array determines
the size of the element block selected from the dataspace.  If the <I>block</I>
parameter is set to <TT>NULL</TT>, the block size defaults to a single element
in each dimension (as if the <I>block</I> array was set to all 1's).
<P>For example, in a 2-dimensional dataspace, setting <I>start</I> to [1,1],
<I>stride</I> to [4,4], <I>count</I> to [3,7] and <I>block</I> to [2,2] selects
21 2x2 blocks of array elements starting with location (1,1) and selecting
blocks at locations (1,1), (5,1), (9,1), (1,5), (5,5), etc.
<P>Regions selected with this function call default to 'C' order iteration when
I/O is performed.
</DD>

<DT>
<TT>herr_t H5Sselect_elements (hid_t <I>space</I>, h5s_selopt_t <I>op</I>,
    const size_t <I>num_elements</I>, const hssize_t *<I>coord</I>[])</TT></DT>

<DD>
This function selects array elements to be included in the selection for the
<I>space</I> dataspace.  The number of elements selected must be set with the
<I>num_elements</I>.  The <I>coord</I> array is a two-dimensional array of size
&lt;dataspace rank&gt; by &lt;<I>num_elements</I>&gt; in size (ie. a list of
coordinates in the array).  The order of the element coordinates in the
<I>coord</I> array also specifies the order that the array elements are
iterated through when I/O is performed.  Duplicate coordinate locations are not
checked for.

<P>The selection operator <I>op</I> determines how the new selection is to be
combined with the already existing selection for the dataspace.  
The following operators are supported:
  <dir>
  <table width=80% border=0>
    <tr><td valign=top>
      <code>H5S_SELECT_SET</code>
      </td><td valign=top>
      Replaces the existing selection with the parameters from this call.  
      Overlapping blocks are not supported with this operator.
    </td></tr><tr><td valign=top>
      <code>H5S_SELECT_OR</code>
      </td><td valign=top>
      Adds the new selection to the existing selection.
    </td></tr>
  </table>
  </dir>
When operators other than
H5S_SELECT_SET are used to combine a new selection with an existing selection,
the selection ordering is reset to 'C' array ordering.
</DD>

<DT>
<TT>herr_t H5Sselect_all (hid_t <I>space</I>)</TT></DT>

<DD>
This function selects the special H5S_SELECT_ALL region for the <I>space</I>
dataspace.  H5S_SELECT_ALL selects the entire dataspace for any dataspace is is
applied to.
</DD>

<DT>
<TT>herr_t H5Sselect_none (hid_t <I>space</I>)</TT></DT>

<DD>
This function resets the selection region for the <I>space</I>
dataspace not to include any elements.
</DD>

<DT>
<TT>herr_t H5Sselect_op (hid_t <I>space1</I>, h5s_selopt_t <I>op</I>,
    hid_t <I>space2</I>)</TT></DT>

<DD>
Uses <I>space2</I> to perform an operation on <I>space1</I>.  The valid
operations for <I>op</I> are:
<DL>
    <DT>H5S_SELECT_COPY
    <DD>Copies the selection from <I>space2</I> into <I>space1</I>, removing any
        previously defined selection for <I>space1</I>.  The selection order
        and offset are also copied to <I>space1</I>
    <DT>H5S_SELECT_UNION
    <DD>Performs a set union of the selection of the dataspace <I>space2</I>
        with the selection from the dataspace <I>space1</I>, with the result
        being stored in <I>space1</I>.  The selection order for <I>space1</I> is
        reset to 'C' order.
    <DT>H5S_SELECT_INTERSECT
    <DD>Performs an set intersection of the selection from <I>space2</I> with
        <I>space1</I>, with the result being stored in <I>space1</I>.  The
        selection order for <I>space1</I> is reset to 'C' order.
    <DT>H5S_SELECT_DIFFERENCE
    <DD>Performs a set difference of the selection from <I>space2</I> with
        <I>space1</I>, with the result being stored in <I>space1</I>.  The
        selection order for <I>space1</I> is reset to 'C' order.
</DL>

</DD>

<DT>
<TT>herr_t H5Sselect_order (hid_t <I>space</I>,
        hsize_t <I>perm_vector</I>[])</TT></DT>

<DD>
This function selects the order to iterate through the dimensions of a dataspace
when performing I/O on a selection.  If a specific order has already been
selected for the selection with H5Sselect_elements, this function will remove
it and use a dimension oriented ordering on the selected elements.  The elements
of the <I>perm_vector</I> array must be unique and between 0 and the rank of the
dataspace, minus 1.  The order of the elements in <I>perm_vector</I> specify
the order to iterate through the selection for each dimension of the dataspace.
To iterate through a 3-dimensional dataspace selection in 'C' order, specify
the elements of the <I>perm_vector</I> as [0, 1, 2], for FORTRAN order they
would be [2, 1, 0].  Other orderings, such as [1, 2, 0] are also possible, but
may execute slower.
</DD>

<DT>
<TT>htri_t H5Sselect_valid (hid_t <I>space</I>)</TT></DT>

<DD>
This function verifies that the selection for a dataspace is within the extent
of the dataspace, if the currently set offset for the dataspace is used.
Returns TRUE if the selection is contained within the extent, FALSE if it
is not contained within the extent and FAIL on error conditions (such as if
the selection or extent is not defined).
</DD>

<DT>
<TT>hsize_t H5Sget_select_npoints (hid_t <I>space</I>)</TT></DT>

<DD>
This function determines the number of elements in the current selection
of a dataspace.
</DD>

<DT>
<TT>herr_t H5Soffset_simple (hid_t <I>space</I>, const hssize_t *
    <I>offset</I>)</TT></DT>

<DD>
Sets the offset of a simple dataspace <I>space</I>.  The <I>offset</I> array
must be the same number of elements as the number of dimensions for the
dataspace.  If the <I>offset</I> array is set to <TT>NULL</TT>, the offset
for the dataspace is reset to 0.
</DD>

</DL>

<H2> 5. Misc. Dataspace Operations</H2>

<DL>

<DT>
<TT>herr_t H5Slock (hid_t <I>space</I>)</TT></DT>

<DD>
Locks the dataspace so that it cannot be modified or closed.  When the library
exits, the dataspace will be unlocked and closed.
</DD>

<DT>
<TT>hid_t H5Screate_simple(int <I>rank</I>, const hsize_t *<I>current_size</I>,
    const hsize_t *<I>maximum_size</I>)</TT></DT>

<DD>
    This function is a "convenience" wrapper to create a simple dataspace
and set it's extent in one call.  It is equivalent to calling H5Screate
and H5Sset_extent_simple() in two steps.
</DD>

<DT>
<TT>int H5Sis_subspace(hid_t <I>space</I>)</TT></DT>

<DD>
    This function returns positive if <I>space</I> is located within another
dataspace, zero if it is not, and negative on a failure.
</DD>

<DT>
<TT>char *H5Ssubspace_name(hid_t <I>space</I>)</TT></DT>

<DD>
    This function returns the name of the named dataspace that <I>space</I>
is located within.  If <I>space</I> is not located within another dataspace,
or an error occurs, NULL is returned.  The application is responsible for
freeing the string returned.
</DD>

<DT>
<TT>herr_t H5Ssubspace_location(hid_t <I>space</I>, hsize_t *<I>loc</I>)</TT></DT>

<DD>
    If <I>space</I> is located within another dataspace, this function puts
the location of the origin of <I>space</I> in the <I>loc</I> array.  The <I>loc</I>
array must be at least as large as the number of dimensions of <I>space</I>.
If <I>space</I> is not located within another dataspace
or an error occurs, a negative value is returned, otherwise a non-negative value
is returned.
</DD>

</DL>


<hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
   <a href="H5.intro.html">Introduction to HDF5</a>&nbsp;<br>
   <a href="RM_H5Front.html">HDF5 Reference Manual</a>&nbsp;<br>
   <a href="index.html">Other HDF5 documents and links</a>&nbsp;<br>
   <!--
   <a href="Glossary.html">Glossary</a><br>
   -->
</td>
<td valign=top align=right>
   And in this document, the 
   <a href="H5.user.html"><strong>HDF5 User's Guide:</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;
      <br>
      <a href="Files.html">Files</a>&nbsp;&nbsp;
      <a href="Datasets.html">Datasets</a>&nbsp;&nbsp;
      <a href="Datatypes.html">Datatypes</a>&nbsp;&nbsp;
      Dataspaces&nbsp;&nbsp;
      <a href="Groups.html">Groups</a>&nbsp;&nbsp;
      <br>
      <a href="References.html">References</a>&nbsp;&nbsp;
      <a href="Attributes.html">Attributes</a>&nbsp;&nbsp;
      <a href="Properties.html">Property Lists</a>&nbsp;&nbsp;
      <a href="Errors.html">Error Handling</a>&nbsp;&nbsp;
      <br>
      <a href="Filters.html">Filters</a>&nbsp;&nbsp;
      <a href="Caching.html">Caching</a>&nbsp;&nbsp;
      <a href="Chunking.html">Chunking</a>&nbsp;&nbsp;
      <a href="MountingFiles.html">Mounting Files</a>&nbsp;&nbsp;
      <br>
      <a href="Performance.html">Performance</a>&nbsp;&nbsp;
      <a href="Debugging.html">Debugging</a>&nbsp;&nbsp;
      <a href="Environment.html">Environment</a>&nbsp;&nbsp;
      <a href="ddl.html">DDL</a>&nbsp;&nbsp;
</td></tr>
</table>
</center>



<hr>
<address>
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
</address>

<!-- Created: Thu Dec  4 14:57:32 EST 1997 -->
<!-- hhmts start -->
Last modified:  13 December 1999
<!-- hhmts end -->

<br>
Describes HDF5 Release 1.4, February 2001


</BODY>
</HTML>