File: he5_pt_setup.c

package info (click to toggle)
hdf-eos5 2%3A2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,692 kB
  • sloc: ansic: 92,051; fortran: 31,463; sh: 11,395; makefile: 492
file content (57 lines) | stat: -rwxr-xr-x 1,456 bytes parent folder | download | duplicates (9)
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
/*
 ----------------------------------------------------------------------------
 |    Copyright (C) 1999   Emergent IT Inc. and Raytheon Systems Company    |
 ----------------------------------------------------------------------------
 */


/* File name: he5_pt_setup.c  */
/* -------------------------- */


#include <HE5_HdfEosDef.h>


int main()
{
  herr_t  status = FAIL;

  hid_t   ptfid  = FAIL;
  hid_t   PTid1  = FAIL;
  hid_t   PTid2  = FAIL;
  hid_t   PTid3  = FAIL;

  /*
   * We first open the HDF-EOS point file, "Point.h5". Because this file
   * does not already exist, we use the H5F_ACC_TRUNC access code in the
   * open statement.  The PTopen routine returns the point file id, ptfid,
   * which is used to identify the file in subsequent routines in the
   * library.
   */

  ptfid = HE5_PTopen("Point.h5", H5F_ACC_TRUNC);

  PTid1 = HE5_PTcreate(ptfid, "Simple Point");
  PTid2 = HE5_PTcreate(ptfid, "FixedBuoy Point");
  PTid3 = HE5_PTcreate(ptfid, "FloatBuoy Point");

  /*
   * We now close the point interface with the HE5_PTdetach routine.  This step
   * is necessary to properly store the point information within the file.
   */

  status = HE5_PTdetach(PTid1);
  status = HE5_PTdetach(PTid2);
  status = HE5_PTdetach(PTid3);

  /*
   * Finally, we close the swath file using the PTclose routine.  This will
   * release the point file handles established by PTopen.
   */

  status = HE5_PTclose(ptfid);
  
  return 0;
}