IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 18, 2009, 12:19:57 PM (16 years ago)
Author:
Paul Price
Message:

Ensure unconvolved output gets header updates (software version, WCS) as well as the convolved output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCleanup.c

    r26117 r26184  
    99#include "ppStack.h"
    1010#include "ppStackLoop.h"
    11 
    12 #define WCS_TOLERANCE 0.001             // Tolerance for WCS
    1311
    1412
     
    3432
    3533    // Close up
    36     bool wcsDone = false;           // Have we done the WCS?
    37     for (int i = 0; i < options->num; i++) {
    38         if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    39             continue;
    40         }
    41 
    42         ppStackThread *thread = stack->threads->data[0]; // Representative stack
    43         pmReadout *inRO = thread->readouts->data[i]; // Template readout
    44         if (inRO && !wcsDone) {
    45             // Copy astrometry over
    46             wcsDone = true;
    47             pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
    48             pmHDU *outHDU = pmHDUFromCell(options->outRO->parent); // Output HDU
    49             pmChip *outChip = options->outRO->parent->parent; // Output chip
    50             pmFPA *outFPA = outChip->parent; // Output FPA
    51             if (!outHDU || !inHDU) {
    52                 psWarning("Unable to find HDU at FPA level to copy astrometry.");
    53             } else {
    54                 if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
    55                     psErrorClear();
    56                     psWarning("Unable to read WCS astrometry from input FPA.");
    57                     wcsDone = false;
    58                 } else {
    59                     if (!outHDU->header) {
    60                         outHDU->header = psMetadataAlloc();
    61                     }
    62                     if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
    63                         psErrorClear();
    64                         psWarning("Unable to write WCS astrometry to output FPA.");
    65                         wcsDone = false;
    66                     }
    67                 }
    68             }
    69         }
    70     }
    7134
    7235    ppStackMemDump("cleanup");
     
    9659    }
    9760
    98     // Put version information into the header
    99     pmHDU *hdu = pmHDUFromCell(options->outRO->parent);
    100     if (!hdu) {
    101         psError(PS_ERR_UNKNOWN, false, "Unable to find HDU for output.");
    102         return false;
    103     }
    104     if (!hdu->header) {
    105         hdu->header = psMetadataAlloc();
    106     }
    107     ppStackVersionHeader(hdu->header);
    108 
    10961    return true;
    11062}
Note: See TracChangeset for help on using the changeset viewer.