Changeset 42947 for trunk/pswarp/src/pswarpDefineLayout.c
- Timestamp:
- Dec 1, 2025, 3:27:15 PM (8 months ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpDefineLayout.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpDefineLayout.c
r41526 r42947 11 11 # include "pswarp.h" 12 12 13 bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin );13 bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin, float zptObs, float zptErr); 14 14 15 15 // load the astrometry header info and generate the tranformations … … 17 17 18 18 bool status = false; 19 float zptObs = 0.; 20 float zptErr = 0.; 19 21 20 22 pmFPAfile *output = psMetadataLookupPtr(&status, config->files, "PSWARP.OUTPUT"); … … 29 31 return false; 30 32 } 31 if (!pswarpLoadAstrometry (output, skycell, config )) {33 if (!pswarpLoadAstrometry (output, skycell, config,&zptObs,&zptErr)) { 32 34 psError(PSWARP_ERR_CONFIG, false, "problem loading output astrometry\n"); 33 35 return false; 34 36 } 37 35 38 36 39 // if a background model is supplied and the output is requested, then … … 68 71 return false; 69 72 } 70 if (!pswarpLoadAstrometry (input, astrom, config )) {73 if (!pswarpLoadAstrometry (input, astrom, config,&zptObs,&zptErr)) { 71 74 psError(PSWARP_ERR_CONFIG, false, "problem loading input astrometry\n"); 72 75 return false; … … 126 129 pmCell *refcell = pmFPAviewThisCell(view, skycell->fpa); ///< Target cell 127 130 128 if (!pswarpGenerateOutputCell (chip, cell, refcell, output->xBin, output->yBin )){131 if (!pswarpGenerateOutputCell (chip, cell, refcell, output->xBin, output->yBin,zptObs,zptErr)){ 129 132 psError(PSWARP_ERR_DATA, false, "failed to generate output cell"); 130 133 psFree(view); 131 134 return false; 132 135 } 136 137 //also output the skycell id 138 char *skycell_id = psMetadataLookupStr(&status, config->arguments, "SKYCELL_ID"); 139 pmHDU *outHDU = pmHDUFromCell (cell); ///< HDU for the output warped image 140 psMetadataAddStr (outHDU->header, PS_LIST_TAIL, "SKYCELL_ID", PS_META_REPLACE, "skycell_id", skycell_id); 133 141 134 142 if (bkgModel) { 135 143 pmChip *bkgChip = pmFPAviewThisChip(view, bkgModel->fpa); ///< Target cell 136 144 pmCell *bkgCell = pmFPAviewThisCell(view, bkgModel->fpa); ///< Target cell 137 if (!pswarpGenerateOutputCell (bkgChip, bkgCell, refcell, bkgModel->xBin, bkgModel->yBin )) {145 if (!pswarpGenerateOutputCell (bkgChip, bkgCell, refcell, bkgModel->xBin, bkgModel->yBin,zptObs,zptErr)) { 138 146 psError(PSWARP_ERR_DATA, false, "failed to generate output cell"); 139 147 psFree(view); … … 152 160 } 153 161 154 bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin ) {162 bool pswarpGenerateOutputCell (pmChip *chip, pmCell *cell, pmCell *refcell, float xBin, float yBin, float zptObs, float zptErr) { 155 163 156 164 bool status = false; … … 197 205 pmHDU *outHDU = pmHDUFromCell (cell); ///< HDU for the output warped image 198 206 outHDU->header = psMetadataCopy(outHDU->header, hdu->header); 207 208 psMetadataAddF32 (outHDU->header, PS_LIST_TAIL, "ZPT_OBS", PS_META_REPLACE, "measured zero point", zptObs); 209 psMetadataAddF32 (outHDU->header, PS_LIST_TAIL, "ZPT_ERR", PS_META_REPLACE, "error on zero point", zptErr); 199 210 pswarpVersionHeader(outHDU->header); 200 211 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
