IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 9, 2010, 3:12:59 PM (15 years ago)
Author:
eugene
Message:

move header updates to ppStackUpdateHeader.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/ppStack/src/ppStackCombineFinal.c

    r29552 r30013  
    99#include "ppStack.h"
    1010#include "ppStackLoop.h"
    11 
    12 #define WCS_TOLERANCE 0.001             // Tolerance for WCS
    1311
    1412//#define TESTING                         // Enable test output
     
    107105    }
    108106
    109     // Propagate WCS
    110     bool wcsDone = false;           // Have we done the WCS?
    111     for (int i = 0; i < options->num && !wcsDone; i++) {
    112         if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    113             continue;
    114         }
    115 
    116         ppStackThread *thread = stack->threads->data[0]; // Representative stack
    117         pmReadout *inRO = thread->readouts->data[i]; // Template readout
    118         if (inRO && !wcsDone) {
    119             // Copy astrometry over
    120             wcsDone = true;
    121             pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
    122             pmHDU *outHDU = pmHDUFromCell(outRO->parent); // Output HDU
    123             pmChip *outChip = outRO->parent->parent; // Output chip
    124             pmFPA *outFPA = outChip->parent; // Output FPA
    125             if (!outHDU || !inHDU) {
    126                 psWarning("Unable to find HDU at FPA level to copy astrometry.");
    127             } else {
    128                 if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
    129                     psErrorClear();
    130                     psWarning("Unable to read WCS astrometry from input FPA.");
    131                     wcsDone = false;
    132                 } else {
    133                     if (!outHDU->header) {
    134                         outHDU->header = psMetadataAlloc();
    135                     }
    136                     if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
    137                         psErrorClear();
    138                         psWarning("Unable to write WCS astrometry to output FPA.");
    139                         wcsDone = false;
    140                     }
    141                 }
    142             }
    143         }
    144     }
    145 
    146     // Put version information into the header
    147     pmHDU *hdu = pmHDUFromCell(outRO->parent);
    148     if (!hdu) {
    149         psError(PPSTACK_ERR_PROG, false, "Unable to find HDU for output.");
    150         return false;
    151     }
    152     if (!hdu->header) {
    153         hdu->header = psMetadataAlloc();
    154     }
    155     ppStackVersionHeader(hdu->header);
    156 
    157 
    158107#ifdef TESTING
    159108    static int pass = 0;                // Pass through
Note: See TracChangeset for help on using the changeset viewer.