IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 26, 2008, 4:54:44 PM (18 years ago)
Author:
Paul Price
Message:

In the case that there is no chip/cell (the readout is orphaned), the
fallback extension name is used when writing. Mirror this for reading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionIO.c

    r19189 r19230  
    11#include <stdio.h>
    22#include <pslib.h>
    3 #include <strings.h>
     3#include <string.h>
    44
    55#include "pmHDU.h"
     
    3333#define NAME_SOL2 "SOLUTION_2"          // Solution for convolving image 2
    3434
     35#define FALLBACK_EXTNAME "SUBTRACTION_KERNEL" // Fallback extension name
    3536
    3637// Generate an extension name for the subtraction kernel
     38// In the case that there is no chip/cell (the readout is orphaned), the fallback extension name is used
    3739static psString subtractionKernelExtname(const pmReadout *ro // Readout containing kernel
    3840                                         )
     
    6163
    6264    if (!extname) {
    63         extname = psStringCopy("SUBTRACTION_KERNEL");
     65        extname = psStringCopy(FALLBACK_EXTNAME);
    6466    }
    6567
     
    165167    // CVS tags, used to identify the version of this file (in case incompatibilities are introduced)
    166168    psString cvsFile = psStringCopy("$RCSfile: pmSubtractionIO.c,v $");
    167     psString cvsRev  = psStringCopy("$Revision: 1.2 $");
    168     psString cvsDate = psStringCopy("$Date: 2008-08-25 22:14:04 $");
     169    psString cvsRev  = psStringCopy("$Revision: 1.3 $");
     170    psString cvsDate = psStringCopy("$Date: 2008-08-27 02:54:44 $");
    169171    psStringSubstitute(&cvsFile, NULL, "RCSfile: ");
    170172    psStringSubstitute(&cvsRev,  NULL, "Revision: ");
     
    276278    psString extname = subtractionKernelExtname(ro); // Extension name
    277279    if (!psFitsMoveExtName(fits, extname)) {
    278         psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
    279         psFree(extname);
    280         return false;
     280        if (strcmp(extname, FALLBACK_EXTNAME) != 0) {
     281            psErrorClear();
     282            if (!psFitsMoveExtName(fits, FALLBACK_EXTNAME)) {
     283                psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
     284                psFree(extname);
     285                return false;
     286            }
     287        } else {
     288            psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
     289            psFree(extname);
     290            return false;
     291        }
    281292    }
    282293    psFree(extname);
Note: See TracChangeset for help on using the changeset viewer.