- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psastro/src/psastroUseModel.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/psastro/src/psastroUseModel.c
r21409 r27840 1 1 /** @file psastroMosiacAstrom.c 2 2 * 3 * @brief 3 * @brief 4 4 * 5 5 * @ingroup libpsastro … … 17 17 /** 18 18 * Apply the generic astrometry model to this image. This assumes the WCS i 19 * terms either do not exist or are invalid 19 * terms either do not exist or are invalid 20 20 */ 21 21 bool psastroUseModel (pmConfig *config, psMetadata *recipe) { … … 29 29 if (!useModel) return true; 30 30 31 // identify reference astrometry table. 31 // identify reference astrometry table. 32 32 // if not defined, correction was not requested; skip step 33 33 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSASTRO.MODEL"); … … 69 69 pmFPAview *myView = pmFPAviewAlloc (0); 70 70 71 // loop over all chips, replace input astrometry elements with those from astrom 71 // loop over all chips, replace input astrometry elements with those from astrom 72 72 pmChip *obsChip = NULL; 73 73 while ((obsChip = pmFPAviewNextChip (myView, input->fpa, 1)) != NULL) { 74 psTrace ("psastro", 4, "Chip %d: %x %x\n", myView->chip, obsChip->file_exists, obsChip->process);75 if (!obsChip->process || !obsChip->file_exists || !obsChip->data_exists) { continue; }74 psTrace ("psastro", 4, "Chip %d: %x %x\n", myView->chip, obsChip->file_exists, obsChip->process); 75 if (!obsChip->process || !obsChip->file_exists || !obsChip->data_exists) { continue; } 76 76 77 // set the chip astrometry using the astrom file78 pmChip *refChip = pmFPAviewThisChip (myView, astrom->fpa);77 // set the chip astrometry using the astrom file 78 pmChip *refChip = pmFPAviewThisChip (myView, astrom->fpa); 79 79 80 psFree (obsChip->toFPA);81 psFree (obsChip->fromFPA);80 psFree (obsChip->toFPA); 81 psFree (obsChip->fromFPA); 82 82 83 // supply astrometry from model 84 obsChip->toFPA = psMemIncrRefCounter (refChip->toFPA);85 obsChip->fromFPA = psMemIncrRefCounter (refChip->fromFPA);83 // supply astrometry from model 84 obsChip->toFPA = psMemIncrRefCounter (refChip->toFPA); 85 obsChip->fromFPA = psMemIncrRefCounter (refChip->fromFPA); 86 86 87 // XXX if we want to write out the result, update the header here. this needs to be88 // updated with the correct HDU selection. obsChip->hdu may not exist.89 // pmAstromWriteBilevelChip (obsChip->hdu->header, obsChip, NONLIN_TOL);87 // XXX if we want to write out the result, update the header here. this needs to be 88 // updated with the correct HDU selection. obsChip->hdu may not exist. 89 // pmAstromWriteBilevelChip (obsChip->hdu->header, obsChip, NONLIN_TOL); 90 90 } 91 91 … … 108 108 if (DEBUG) psastroDumpCorners ("corners.up.ast2.dat", "corners.dn.ast2.dat", astrom->fpa); 109 109 110 // loop over all chips, replace input astrometry elements with those from astrom 110 // loop over all chips, replace input astrometry elements with those from astrom 111 111 pmChip *obsChip = NULL; 112 112 while ((obsChip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { … … 120 120 psFree (obsChip->fromFPA); 121 121 122 // supply astrometry from model 122 // supply astrometry from model 123 123 obsChip->toFPA = psMemIncrRefCounter (refChip->toFPA); 124 124 obsChip->fromFPA = psMemIncrRefCounter (refChip->fromFPA); … … 147 147 // psFree (updates); 148 148 149 // files associated with the science image 150 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 151 psError (PS_ERR_IO, false, "Can't close the astrometry model file"); 152 return false; 153 } 154 149 155 psFree (view); 150 156 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
