Changeset 42947
- Timestamp:
- Dec 1, 2025, 3:27:15 PM (5 months ago)
- Location:
- trunk/pswarp/src
- Files:
-
- 4 edited
-
pswarp.h (modified) (1 diff)
-
pswarpArguments.c (modified) (2 diffs)
-
pswarpDefineLayout.c (modified) (7 diffs)
-
pswarpLoadAstrometry.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarp.h
r41705 r42947 199 199 pswarpBounds *pswarpBoundsAlloc(); 200 200 201 bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config );201 bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config, float *zptObs, float *zptErr); 202 202 203 203 bool pswarpTransformToTarget (pmFPA *output, pmReadout *input, pmConfig *config, bool backgroundWarp); -
trunk/pswarp/src/pswarpArguments.c
r35563 r42947 21 21 fprintf(stderr, " [-mask mask.fits] : provide a corresponding mask image\n"); 22 22 fprintf(stderr, " [-variance variance.fits] : provide a corresponding variance image\n"); 23 fprintf(stderr, " [-skycell_id skycell_id] : input skycell_id\n"); 23 24 psErrorStackPrint(stderr, "\n"); 24 25 exit(PS_EXIT_CONFIG_ERROR); … … 76 77 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "STATS", PS_DATA_STRING, 77 78 "Filename for statistics of output image", argv[N]); 79 psArgumentRemove(N, &argc, argv); 80 } 81 // Skycell id 82 if ((N = psArgumentGet(argc, argv, "-skycell_id"))) { 83 psArgumentRemove(N, &argc, argv); 84 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "SKYCELL_ID", PS_DATA_STRING, 85 "Skycell_id to use", argv[N]); 78 86 psArgumentRemove(N, &argc, argv); 79 87 } -
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; -
trunk/pswarp/src/pswarpLoadAstrometry.c
r41897 r42947 14 14 // WCS and read the headers. We place the resulting info on the target astrometry 15 15 // containers 16 bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config ) {16 bool pswarpLoadAstrometry (pmFPAfile *target, pmFPAfile *astrom, pmConfig *config, float *zptObs,float *zptErr) { 17 17 18 18 pmChip *chip = NULL; … … 126 126 return false; 127 127 } 128 *zptObs = psMetadataLookupF32 (NULL, hdu->header, "ZPT_OBS"); 129 *zptErr = psMetadataLookupF32 (NULL, hdu->header, "ZPT_ERR"); 128 130 129 131 if (bilevelAstrometry) {
Note:
See TracChangeset
for help on using the changeset viewer.
