Esempio n. 1
0
intn write_dimension(int32 swid)
{
    char dim1[] = "ZDim";
    char dim2[] = "NDim";

    SWdefdim(swid, dim1, 4);
    SWdefdim(swid, dim2, 8);
    return SUCCEED;
}
Esempio n. 2
0
intn write_dimension(int32 swid, int xdim, int ydim, int zdim)
{
    char dim1[] = "ZDim";
    char dim2[] = "xtrack";
    char dim3[] = "ytrack";

    SWdefdim(swid, dim1, zdim);
    SWdefdim(swid, dim2, xdim);
    SWdefdim(swid, dim3, ydim);

    return SUCCEED;
}
Esempio n. 3
0
int main() {
  char filename[] = "test.he4";
  int fid = SWopen(filename, DFACC_CREATE);
  char swathname[] = "myswath";
  int swid = SWcreate(fid, swathname);

  char dimname[] = "mydim";
  const int32 dimlen = 10;
  int rc = SWdefdim(swid, dimname, dimlen);
  printf("SWdefdim: %d\n", rc);
  char fieldname[] = "test_field";
  rc = SWdefdatafield(swid, fieldname, dimname, DFNT_FLOAT, 0);
  printf("SWdefdatafield: %d\n", rc);

  int32 start = 0;
  int32 edge = dimlen;
  float data[dimlen];
  for (int i=0; i<dimlen; ++i) {
    data[i] = 1.0 + i;
  }
  rc = SWwritefield(swid, fieldname, &start, NULL, &edge, data);
  printf("SWwritefield: %d\n", rc);

  rc = SWdetach(swid);
  printf("SWdetach: %d\n", rc);
  rc = SWclose(fid);
  printf("SWclose: %d\n", rc);
}