2
----------------------------------------------------------------------------
3
| Copyright (C) 1999 Emergent IT Inc. and Raytheon Systems Company |
4
----------------------------------------------------------------------------
7
#include <HE5_HdfEosDef.h>
10
/* ----------------------------------------------------------- */
11
/* In this program we (1) open the "Swath.h5" HDF-EOS file, */
12
/* (2) attach to the "Swath1" swath, and (3) define the */
13
/* external data field "ExtData". */
14
/* ----------------------------------------------------------- */
29
/* Open the file, "Swath.h5", using the H5F_ACC_RDWR access code */
30
/* ------------------------------------------------------------- */
31
swfid = HE5_SWopen("Swath.h5", H5F_ACC_RDWR);
34
/* Attach to the "Swath1" swath */
35
/* ---------------------------- */
36
SWid = HE5_SWattach(swfid, "Swath1");
39
/* Set the data sizes and offsets in external files */
40
/* ------------------------------------------------ */
41
size[0] = 10 * sizeof(int); offset[0] = 0;
42
size[1] = 20 * sizeof(int); offset[1] = 40;
43
size[2] = 30 * sizeof(int); offset[2] = 80;
45
/* Set external data files first */
46
/* ----------------------------- */
47
status = HE5_SWsetextdata(SWid, "external_1.data,external_2.data,external_3.data", offset, size);
48
printf("Status returned by HE5_SWsetextdata(...) : %d\n",status);
50
/* Define field containing external data */
51
/* ------------------------------------- */
52
status = HE5_SWdefdatafield(SWid, "ExtData", "ExtDim", NULL, H5T_NATIVE_INT, 0);
53
printf("Status returned by HE5_SWdefdatafield(...\"ExtData\",...) : %d\n",status);
57
/* Detach from the swath */
58
/* --------------------- */
59
status = HE5_SWdetach(SWid);
60
printf("Status returned by HE5_SWdetach(...) : %d\n",status);
64
status = HE5_SWclose(swfid);
65
printf("Status returned by HE5_SWclose(...) : %d\n",status);