IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35002


Ignore:
Timestamp:
Jan 20, 2013, 8:59:30 PM (13 years ago)
Author:
eugene
Message:

allow mkcmf to make an approximately correct mef; read headers of said mef

Location:
branches/eam_branches/ipp-20121219/Ohana/src/addstar/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/GetFileMode.c

    r34088 r35002  
    2222  if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ;
    2323
    24   if (haveNaxis && ((Naxis == 2) || TEXTMODE || !simple)) {
     24  if (haveNaxis && (Naxis == 2)) {
     25    int Nx, Ny;
     26    gfits_scan (header, "NAXIS1",  "%d", 1, &Nx);
     27    gfits_scan (header, "NAXIS2",  "%d", 1, &Ny);
     28    if ((Nx > 0) && (Ny > 0)) {
     29      if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) {
     30        return MOSAIC_CMP;
     31      }
     32      return SIMPLE_CMP;
     33    }
     34  }
     35
     36  if (haveNaxis && (TEXTMODE || !simple)) {
    2537    if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) {
    2638      return MOSAIC_CMP;
  • branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/mkcmf.c

    r34996 r35002  
    313313  gfits_modify (ftable.header, "EXTNAME",   "%s", 1, "Chip.psf");
    314314
    315   fits = fopen (argv[2], "w");
     315  // open for append (if you want a new file, need to blow the old object)
     316  fits = fopen (argv[2], "a+");
    316317  if (fits == NULL) {
    317318    fprintf (stderr, "ERROR: can't open output file %s\n", argv[2]);
    318319    exit (1);
     320  }
     321
     322  /* position to begining of file to write header */
     323  off_t Nend = ftello (f);
     324
     325  /* if we are appending, fix up header */
     326  if (Nend > 0) {
     327    static char simple[] = "XTENSION= 'IMAGE  '            / Image extension";
     328    int Ns, No;
     329    Ns = strlen (simple);
     330    No = 80 - Ns;
     331    strncpy (header.buffer, simple, Ns);
     332    memset (&header.buffer[Ns], ' ', No);
    319333  }
    320334
Note: See TracChangeset for help on using the changeset viewer.