- Timestamp:
- Apr 26, 2013, 9:07:23 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130419/pswarp/src/pswarpLoadAstrometry.c
r35424 r35434 14 14 // WCS and read the headers. We place the resulting info on the target astrometry 15 15 // containers 16 bool pswarpLoadAstrometry (pm Config *config, pmFPAfile *astrom, pmFPAfile *target) {16 bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config) { 17 17 18 18 pmChip *chip = NULL; 19 19 pmCell *cell = NULL; 20 21 // XXX assert that astrom be WCS or CMF? 20 22 21 23 // XXX set the type to be WCS … … 42 44 while ((cell = pmFPAviewNextCell (view, astrom->fpa, 1)) != NULL) { 43 45 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 44 if (!cell->process || !cell->file_exists) { continue; }46 if (!cell->process) { continue; } 45 47 if (!pmFPAfileRead (astrom, view, config)) { 46 48 psError(psErrorCodeLast(), false, "failed READ at CELL %s", astrom->name); … … 89 91 // apply the bilevel astrometry elements to the target 90 92 if (bilevelAstrometry) { 91 if (!pmAstromReadBilevelMosaic( target->fpa, phu->header)) {93 if (!pmAstromReadBilevelMosaic(astrom->fpa, phu->header)) { 92 94 psError(psErrorCodeLast(), false, "Unable to read bilevel mosaic astrometry for skycell."); 93 95 psFree(view); … … 95 97 } 96 98 } 99 // for pswarpLocalFrame, I need transformations and HDUs on a single fpa (so set on astrom as well as target) 100 target->fpa->toTPA = psMemIncrRefCounter (astrom->fpa->toTPA); 101 target->fpa->fromTPA = psMemIncrRefCounter (astrom->fpa->fromTPA); 102 target->fpa->toSky = psMemIncrRefCounter (astrom->fpa->toSky); 97 103 98 104 while ((chip = pmFPAviewNextChip (view, astrom->fpa, 1)) != NULL) { … … 110 116 // We read from the astrometry source into the target. 111 117 pmChip *targetChip = pmFPAviewThisChip(view, target->fpa); ///< Chip in the output 118 if (!targetChip) continue; // only load astrometry into output chips which exist! 119 112 120 if (bilevelAstrometry) { 113 if (!pmAstromReadBilevelChip( targetChip, hdu->header)) {121 if (!pmAstromReadBilevelChip(chip, hdu->header)) { 114 122 psError(psErrorCodeLast(), false, "Unable to read bilevel chip astrometry for skycell."); 115 123 psFree(view); … … 118 126 } else { 119 127 // we use a default FPA pixel scale of 1.0 120 if (!pmAstromReadWCS(target->fpa, targetChip, hdu->header, 1.0)) {128 if (!pmAstromReadWCS(target->fpa, chip, hdu->header, 1.0)) { 121 129 psError(psErrorCodeLast(), false, "Unable to read WCS astrometry for skycell."); 122 130 psFree(view); … … 124 132 } 125 133 } 134 targetChip->toFPA = psMemIncrRefCounter (chip->toFPA); 135 targetChip->fromFPA = psMemIncrRefCounter (chip->fromFPA); 126 136 } 127 137
Note:
See TracChangeset
for help on using the changeset viewer.
