Changeset 41382 for trunk/psModules/src/objects/pmSourceIO_Ghosts.c
- Timestamp:
- Jun 23, 2020, 3:29:09 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO_Ghosts.c (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO_Ghosts.c
r41367 r41382 55 55 #include "pmAstrometryWCS.h" 56 56 57 # include "p sastroInternal.h"57 # include "pmSourceInternal.h" 58 58 static psVector *chipXmin = NULL; 59 59 static psVector *chipXmax = NULL; … … 68 68 md = psMetadataLookupMetadata (&status, ghostModel, NAME); \ 69 69 if (!md) { \ 70 psError(P SASTRO_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \70 psError(PM_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \ 71 71 goto escape; \ 72 72 } \ 73 73 OUT = psPolynomial2DfromMetadata(md); \ 74 74 if (!OUT) { \ 75 psError(P SASTRO_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \75 psError(PM_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \ 76 76 goto escape; \ 77 77 } … … 80 80 md = psMetadataLookupMetadata (&status, ghostModel, NAME); \ 81 81 if (!md) { \ 82 psError(P SASTRO_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \82 psError(PM_ERR_CONFIG, true, "Missing %s in model file %s", NAME, ghostFile); \ 83 83 goto escape; \ 84 84 } \ 85 85 OUT = psPolynomial1DfromMetadata(md); \ 86 86 if (!OUT) { \ 87 psError(P SASTRO_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \87 psError(PM_ERR_CONFIG, true, "Trouble interpretting %s in model file %s", NAME, ghostFile); \ 88 88 goto escape; \ 89 89 } … … 116 116 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); 117 117 if (!recipe) { 118 psError(P SASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");118 psError(PM_ERR_CONFIG, true, "Can't find PSASTRO recipe"); 119 119 return false; 120 120 } … … 129 129 130 130 if (!pmConfigFileRead (&ghostModel, ghostFile, "GHOST MODEL")) { 131 psError(P SASTRO_ERR_CONFIG, true, "Trouble loading ghost model");131 psError(PM_ERR_CONFIG, true, "Trouble loading ghost model"); 132 132 return false; 133 133 } … … 156 156 pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 157 157 if (!astrom) { 158 psError(P SASTRO_ERR_CONFIG, true, "Can't find input data");158 psError(PM_ERR_CONFIG, true, "Can't find input data"); 159 159 goto escape; 160 160 } … … 162 162 163 163 // really error-out here? or just skip? 164 if (!p sastroZeroPointFromRecipeGlint (&zeropt, &exptime, &MAX_MAG,NULL, fpa_ast, recipe)) {164 if (!pmSourceZeroPointFromRecipeGlint (&zeropt, &exptime, &MAX_MAG,NULL, fpa_ast, recipe)) { 165 165 psLogMsg ("psastro", PS_LOG_INFO, "failed to load zeropt data from recipe"); 166 166 goto escape; … … 202 202 if (ref->Mag > MAX_MAG) continue; 203 203 204 p sastroGhost *ghost = psastroGhostAlloc ();204 pmSourceGhost *ghost = pmSourceGhostAlloc (); 205 205 ghost->srcFP->x = ref->FP->x; 206 206 ghost->srcFP->y = ref->FP->y; … … 239 239 // XXX this code yields a single chip: we need to provide results for any chips 240 240 // which encompass the full size of the ghost 241 pmChip *ghostChip = p sastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, -ghost->srcFP->x, -ghost->srcFP->y);242 ghostChip = p sastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y);241 pmChip *ghostChip = pmSourceFindChip (&ghost->chip->x, &ghost->chip->y, fpa, -ghost->srcFP->x, -ghost->srcFP->y); 242 ghostChip = pmSourceFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y); 243 243 244 244 //do a rudimentary check of whether the ghost is on the pixel FPA … … 331 331 } 332 332 333 static void p sastroGhostFree (psastroGhost *ghost) {333 static void pmSourceGhostFree (pmSourceGhost *ghost) { 334 334 335 335 if (ghost == NULL) return; … … 342 342 } 343 343 344 p sastroGhost *psastroGhostAlloc (void) {345 346 p sastroGhost *ghost = (psastroGhost *) psAlloc(sizeof(psastroGhost));347 psMemSetDeallocator(ghost, (psFreeFunc) p sastroGhostFree);344 pmSourceGhost *pmSourceGhostAlloc (void) { 345 346 pmSourceGhost *ghost = (pmSourceGhost *) psAlloc(sizeof(pmSourceGhost)); 347 psMemSetDeallocator(ghost, (psFreeFunc) pmSourceGhostFree); 348 348 349 349 ghost->srcFP = psPlaneAlloc(); … … 365 365 366 366 367 bool p sastroChipBounds (pmFPA *fpa) {367 bool pmSourceChipBounds (pmFPA *fpa) { 368 368 369 369 chipXmin = psVectorAlloc (fpa->chips->n, PS_TYPE_F32); … … 416 416 } 417 417 418 pmChip *p sastroFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA) {418 pmChip *pmSourceFindChip (double *xChip, double *yChip, pmFPA *fpa, double xFPA, double yFPA) { 419 419 420 420 *xChip = NAN; … … 422 422 423 423 if (!chipXmin) { 424 p sastroChipBounds (fpa);424 pmSourceChipBounds (fpa); 425 425 } 426 426 … … 458 458 459 459 // identify chips which land on this column (FP coords) 460 bool p sastroFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) {460 bool pmSourceFindChipInXrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) { 461 461 462 462 if (!chipXmin || !chipXmax) { … … 470 470 471 471 // identify chips which land on this row (FP coords) 472 bool p sastroFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) {472 bool pmSourceFindChipInYrange (pmFPA *fpa, int nChip, double xFPA, double yFPA) { 473 473 474 474 if (!chipYmin || !chipYmax) { … … 482 482 483 483 // return the FPA coordinates of the Y edges of the chip 484 bool p sastroFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) {484 bool pmSourceFindChipYedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) { 485 485 486 486 *yFPAs = chipYmin->data.F32[nChip]; … … 490 490 491 491 // return the FPA coordinates of the X edges of the chip 492 bool p sastroFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) {492 bool pmSourceFindChipXedges (double *yFPAs, double *yFPAe, pmFPA *fpa, int nChip) { 493 493 494 494 *yFPAs = chipXmin->data.F32[nChip]; … … 498 498 499 499 // convert FPA to Chip coordinates 500 bool p sastroFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA) {500 bool pmSourceFPAtoChip (double *xChip, double *yChip, pmFPA *fpa, int nChip, double xFPA, double yFPA) { 501 501 502 502 pmChip *chip = fpa->chips->data[nChip]; … … 512 512 } 513 513 514 bool p sastroExtractFreeChipBounds () {514 bool pmSourceExtractFreeChipBounds () { 515 515 516 516 psFree (chipXmin);
Note:
See TracChangeset
for help on using the changeset viewer.
