IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 13, 2007, 5:41:36 PM (19 years ago)
Author:
Paul Price
Message:

Making the astrometry pmFPAfile into its own empire. We were having trouble reading the real astrometry (separate file output from psastro) because it was using the input image header as the source. Tried playing around with supplementing FITS headers, before realising the simplest solution: the astrometry can have its own FPA, and then read the astrometric solution into the image FPA. Works nicely.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r14007 r14210  
    11# include "pswarp.h"
    22#include <ppStats.h>
     3
     4#define WCS_NONLIN_TOL 0.001            // Non-linear tolerance for header WCS
    35
    46// Loop over the inputs, warp them to the output skycell and then write out the output.
     
    2022    if (!astrom) {
    2123        astrom = input;
     24    }
     25
     26    if (astrom->camera != input->camera) {
     27        psError(PS_ERR_UNKNOWN, true, "Input camera and astrometry camera do not match.");
     28        return false;
    2229    }
    2330
     
    8996    // find the FPA phu
    9097    bool bilevelAstrometry = false;
    91     pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa);
     98    pmHDU *phu = pmFPAviewThisPHU(view, astrom->fpa);
    9299    if (phu) {
    93         char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
     100        char *ctype = psMetadataLookupStr(NULL, phu->header, "CTYPE1");
    94101        if (ctype) {
    95102            bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
     
    208215#endif
    209216
    210 
    211217    // Perform statistics on the output image
    212218    if (stats) {
     
    216222    }
    217223
    218     pmHDU *hdu = output->parent->parent->parent->hdu; // HDU for the output warped image
     224    pmHDU *hdu = outFPA->hdu;          // HDU for the output warped image
    219225    if (!hdu->header) {
    220226        hdu->header = psMetadataAlloc();
     227    }
     228
     229    if (!pmAstromWriteWCS(hdu->header, outFPA, outChip, WCS_NONLIN_TOL)) {
     230        psError(PS_ERR_UNKNOWN, false, "Unable to generate WCS header.");
     231        psFree(stats);
     232        return false;
    221233    }
    222234
Note: See TracChangeset for help on using the changeset viewer.