IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 8, 2008, 11:05:47 AM (18 years ago)
Author:
Paul Price
Message:

Fixing SEGV when !inRO (e.g., convolution fails, readout rejected out of hand).

File:
1 edited

Legend:

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

    r19347 r19411  
    795795            ppStackThread *thread = stack->threads->data[0]; // Representative stack
    796796            pmReadout *inRO = thread->readouts->data[i]; // Template readout
    797             pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
    798             pmHDU *outHDU = pmHDUFromCell(outRO->parent); // Output HDU
    799             pmChip *outChip = outRO->parent->parent; // Output chip
    800             pmFPA *outFPA = outChip->parent; // Output FPA
    801             if (!outHDU || !inHDU) {
    802                 psWarning("Unable to find HDU at FPA level to copy astrometry.");
    803             } else {
    804                 if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
    805                     psErrorClear();
    806                     psWarning("Unable to read WCS astrometry from input FPA.");
    807                     wcsDone = false;
     797            if (inRO) {
     798                pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
     799                pmHDU *outHDU = pmHDUFromCell(outRO->parent); // Output HDU
     800                pmChip *outChip = outRO->parent->parent; // Output chip
     801                pmFPA *outFPA = outChip->parent; // Output FPA
     802                if (!outHDU || !inHDU) {
     803                    psWarning("Unable to find HDU at FPA level to copy astrometry.");
    808804                } else {
    809                     if (!outHDU->header) {
    810                         outHDU->header = psMetadataAlloc();
    811                     }
    812                     if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
     805                    if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
    813806                        psErrorClear();
    814                         psWarning("Unable to write WCS astrometry to output FPA.");
     807                        psWarning("Unable to read WCS astrometry from input FPA.");
    815808                        wcsDone = false;
     809                    } else {
     810                        if (!outHDU->header) {
     811                            outHDU->header = psMetadataAlloc();
     812                        }
     813                        if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
     814                            psErrorClear();
     815                            psWarning("Unable to write WCS astrometry to output FPA.");
     816                            wcsDone = false;
     817                        }
    816818                    }
    817819                }
Note: See TracChangeset for help on using the changeset viewer.