IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12270


Ignore:
Timestamp:
Mar 6, 2007, 8:50:21 AM (19 years ago)
Author:
eugene
Message:

adding case for missing EXTTYPE in old formats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/gstars.c

    r11584 r12270  
    176176      }
    177177  }
     178  // some old format files did not write EXTTYPE.  they have a single table in the first
     179  // extension matched to the header in the PHU
     180  if (Nimage == 0) {
     181      extsize[0] = headers[0][0].size + gfits_matrix_size (headers[0]);
     182      extsize[1] = headers[1][0].size + gfits_matrix_size (headers[1]);
     183      gfits_scan (headers[1], "EXTNAME", "%s", 1, tmpword);
     184      if (!strcmp (tmpword, "SMPFILE")) {
     185          extdata[Nimage] = strcreate (tmpword);
     186          exttype[Nimage] = strcreate ("SMPDATA");
     187          exthead[Nimage] = strcreate ("PHU");
     188          extnum_head[Nimage] = 0;
     189          extnum_data[Nimage] = 1;
     190          Nimage = 1;
     191      }
     192  }
     193  if (Nimage == 0) Shutdown ("no object data in file");
     194   
    178195  if (VERBOSE) fprintf (stderr, "file %s has %d headers, including %d images\n", file[0], Nheader, Nimage);
    179196
     
    185202      ReadImageHeader (headers[Nhead], &image[i], 0);
    186203
    187       if (!strcmp(exthead[i], "PHU")) continue;
     204      // this is an error we should not encounter
     205      if (!strcmp(extdata[i], "PHU")) Shutdown ("error in data segment: PHU cannot be table");
    188206
    189207      // advance the pointer to the start of the corresponding table block
Note: See TracChangeset for help on using the changeset viewer.