IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20355


Ignore:
Timestamp:
Oct 24, 2008, 11:21:06 AM (18 years ago)
Author:
Paul Price
Message:

Write out realisations of the kernel as well.

File:
1 edited

Legend:

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

    r20049 r20355  
    3939#define NAME_NUMSTAMPS "NUMSTAMPS"      // Number of good stamps
    4040
    41 #define EXTNAME "SUBTRACTION_KERNEL"    // Extension name
     41#define EXTNAME_KERNEL "SUBTRACTION_KERNEL"    // Extension name for kernel
     42#define EXTNAME_IMAGE  "SUBTRACTION_KERNEL_IMAGE"    // Extension name for image
    4243
    4344//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    143144    // CVS tags, used to identify the version of this file (in case incompatibilities are introduced)
    144145    psString cvsFile = psStringCopy("$RCSfile: pmSubtractionIO.c,v $");
    145     psString cvsRev  = psStringCopy("$Revision: 1.8 $");
    146     psString cvsDate = psStringCopy("$Date: 2008-10-10 23:54:33 $");
     146    psString cvsRev  = psStringCopy("$Revision: 1.9 $");
     147    psString cvsDate = psStringCopy("$Date: 2008-10-24 21:21:06 $");
    147148    psStringSubstitute(&cvsFile, NULL, "RCSfile: ");
    148149    psStringSubstitute(&cvsRev,  NULL, "Revision: ");
     
    158159    psFree(version);
    159160
    160     if (!psFitsWriteTable(fits, header, rows, EXTNAME)) {
     161    if (!psFitsWriteTable(fits, header, rows, EXTNAME_KERNEL)) {
    161162        psError(PS_ERR_IO, false, "Unable to write subtraction kernel to FITS table.");
     163        psFree(header);
     164        psFree(rows);
     165        return false;
     166    }
     167
     168    psImage *image = psMetadataLookupPtr(NULL, ro->analysis, PM_SUBTRACTION_ANALYSIS_KERNEL_IMAGE); // Image
     169    if (image && !psFitsWriteImage(fits, header, image, 0, EXTNAME_IMAGE)) {
     170        psError(PS_ERR_IO, false, "Unable to write subtraction kernel image.");
    162171        psFree(header);
    163172        psFree(rows);
     
    248257    PS_ASSERT_FITS_NON_NULL(fits, false);
    249258
    250     if (!psFitsMoveExtName(fits, EXTNAME)) {
     259    if (!psFitsMoveExtName(fits, EXTNAME_KERNEL)) {
    251260        psError(PS_ERR_IO, false, "Unable to move to subtraction kernel table.");
    252261        return false;
Note: See TracChangeset for help on using the changeset viewer.