Changeset 5134
- Timestamp:
- Sep 26, 2005, 9:49:41 AM (21 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 7 edited
-
pmObjects_EAM.c (modified) (2 diffs)
-
pmPSFtry.c (modified) (1 diff)
-
psLibUtils.c (modified) (8 diffs)
-
psLibUtils.h (modified) (1 diff)
-
psPolynomials.c (modified) (9 diffs)
-
psphotDefinePixels.c (modified) (1 diff)
-
psphotSetup.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/pmObjects_EAM.c
r5122 r5134 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-09-26 07:17:19$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-09-26 19:49:41 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 615 615 // XXX EAM : psRegionXXX funcs should take value not ptr 616 616 srcRegion = psRegionForSquare (peak->x, peak->y, Radius); 617 srcRegion = psRegionForImage (mask, &srcRegion);618 619 psImageMaskRegion (mask, &srcRegion, "OR", PSPHOT_MASK_MARKED);617 srcRegion = psRegionForImage (mask, srcRegion); 618 619 psImageMaskRegion (mask, srcRegion, "OR", PSPHOT_MASK_MARKED); 620 620 psStats *myStats = psStatsAlloc(statsOptions); 621 621 myStats = psImageStats(myStats, image, mask, 0xff); 622 psImageMaskRegion (mask, &srcRegion, "AND", ~PSPHOT_MASK_MARKED);622 psImageMaskRegion (mask, srcRegion, "AND", ~PSPHOT_MASK_MARKED); 623 623 624 624 psF64 tmpF64; -
trunk/psphot/src/pmPSFtry.c
r5127 r5134 204 204 // build binned versions of rflux, metric 205 205 dBin = (stats->max - stats->min) / 10.0; 206 psVector *rfBin = psVectorCreate ( stats->min, stats->max, dBin, PS_TYPE_F64);206 psVector *rfBin = psVectorCreate (NULL, stats->min, stats->max, dBin, PS_TYPE_F64); 207 207 psVector *daBin = psVectorAlloc (rfBin->n, PS_TYPE_F64); 208 208 psVector *maskB = psVectorAlloc (rfBin->n, PS_TYPE_U8); -
trunk/psphot/src/psLibUtils.c
r5048 r5134 8 8 // XXX EAM : these utility functions should be added back into PSLib 9 9 10 # if (0) // now in psLib (v8) 10 11 static psHash *timers = NULL; 11 12 bool psTimerClear (char *name) {13 14 bool status;15 16 if (name == NULL) return false;17 18 status = psHashRemove (timers, name);19 return (status);20 }21 22 void psTimerFree () {23 24 psFree (timers);25 p_psTimeFinalize();26 return;27 }28 12 29 13 // start/restart a named timer … … 40 24 } 41 25 26 bool psTimerClear (char *name) { 27 28 bool status; 29 30 if (name == NULL) return false; 31 32 status = psHashRemove (timers, name); 33 return (status); 34 } 35 42 36 // get current elapsed time on named timer 43 37 psF64 psTimerMark (char *name) { … … 60 54 } 61 55 56 void psTimerFree () { 57 58 psFree (timers); 59 p_psTimeFinalize(); 60 return; 61 } 62 # endif 63 64 # if (0) 62 65 // find the location of the specified argument 63 66 int psArgumentGet (int argc, char **argv, char *arg) { … … 87 90 return (N); 88 91 } 92 # endif 89 93 90 94 // we have log levels 1 (Error), 2 (Warning), 3 (Info), 4 (Details), 5 (Minutiae) … … 276 280 } 277 281 282 # if (0) 283 // now in psLib (v8) 278 284 // count number of pixels with given mask value 279 285 int psImageCountPixelMask (psImage *mask, psU8 value) … … 290 296 return (Npixels); 291 297 } 298 # endif 292 299 293 300 // define a square region centered on the given coordinate … … 438 445 # endif 439 446 447 # if (0) 440 448 psVector *psVectorCreate (double lower, double upper, double delta, psElemType type) { 441 449 … … 450 458 return (out); 451 459 } 460 # endif 452 461 453 462 // XXX EAM a utility function -
trunk/psphot/src/psLibUtils.h
r5068 r5134 30 30 31 31 // psLib extra utilities 32 # if (0) // added to psLib v8 33 int psArgumentGet (int argc, char **argv, char *arg); // added to SDRS 34 int psArgumentRemove (int N, int *argc, char **argv); // added to SDRS 35 bool psTimerClear (char *name); // added to SDRS 36 int psImageCountPixelMask (psImage *mask, psU8 value); // added to SDRS 37 psVector *psVectorCreate (double lower, double upper, double delta, psElemType type); // added to SDRS 38 # endif 39 32 40 bool psTimerStart (char *name); // added to SDRS 33 bool psTimerClear (char *name); // added to SDRS34 41 psF64 psTimerMark (char *name); // added to SDRS 35 42 void psTimerFree (); // added to SDRS (as psTimerStop) 36 43 psS32 psLogArguments (int *argc, char **argv); // added to SDRS (part of psArgumentVerbosity) 37 44 psS32 psTraceArguments (int *argc, char **argv); // added to SDRS (part of psArgumentVerbosity) 38 int psArgumentGet (int argc, char **argv, char *arg); // added to SDRS39 int psArgumentRemove (int N, int *argc, char **argv); // added to SDRS40 psVector *psVectorCreate (double lower, double upper, double delta, psElemType type); // added to SDRS41 // psVector *psGetRowVectorFromImage(psImage *image, psU32 row); // added to SDRS (as psImageRow)42 int psImageCountPixelMask (psImage *mask, psU8 value); // added to SDRS43 45 44 46 // basic image functions -
trunk/psphot/src/psPolynomials.c
r5084 r5134 12 12 void Polynomial1DDump_EAM (psPolynomial1D *poly) { 13 13 14 for (int i = 0; i < poly-> n + 1; i++) {14 for (int i = 0; i < poly->COOL_1D_n + 1; i++) { 15 15 fprintf (stderr, "x^%d : %g +/- %g\n", i, poly->coeff[i], poly->coeffErr[i]); 16 16 } … … 39 39 newPoly = (psPolynomial1D* ) psAlloc(sizeof(psPolynomial1D)); 40 40 newPoly->type = type; 41 newPoly-> n = nOrder;41 newPoly->COOL_1D_n = nOrder; 42 42 newPoly->coeff = (psF64 *)psAlloc(nTerm * sizeof(psF64)); 43 43 newPoly->coeffErr = (psF64 *)psAlloc(nTerm * sizeof(psF64)); … … 58 58 psF64 xSum = 1.0; 59 59 60 for (loop_x = 0; loop_x < myPoly-> n + 1; loop_x++) {60 for (loop_x = 0; loop_x < myPoly->COOL_1D_n + 1; loop_x++) { 61 61 if (myPoly->mask[loop_x] == 0) { 62 62 polySum += xSum * myPoly->coeff[loop_x]; … … 141 141 # endif 142 142 143 nTerm = myPoly-> n + 1;143 nTerm = myPoly->COOL_1D_n + 1; 144 144 A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); 145 145 B = psVectorAlloc(nTerm, PS_TYPE_F64); … … 223 223 224 224 if (poly == NULL) return; 225 for (int i = 0; i < poly-> nX + 1; i++) {225 for (int i = 0; i < poly->COOL_2D_nX + 1; i++) { 226 226 psFree (poly->coeff[i]); 227 227 psFree (poly->coeffErr[i]); … … 251 251 newPoly = (psPolynomial2D* ) psAlloc(sizeof(psPolynomial2D)); 252 252 newPoly->type = type; 253 newPoly-> nX = nXorder;254 newPoly-> nY = nYorder;253 newPoly->COOL_2D_nX = nXorder; 254 newPoly->COOL_2D_nY = nYorder; 255 255 256 256 newPoly->coeff = (psF64 **)psAlloc(nXterm * sizeof(psF64 *)); 257 257 newPoly->coeffErr = (psF64 **)psAlloc(nXterm * sizeof(psF64 *)); 258 newPoly->mask = ( char **)psAlloc(nXterm * sizeof(char*));258 newPoly->mask = (psMaskType **)psAlloc(nXterm * sizeof(psMaskType *)); 259 259 // XXX EAM : this is an error in the definition of the polynomial mask 260 260 // (should be psU8 not char) … … 278 278 void Polynomial2DDump_EAM (psPolynomial2D *poly) { 279 279 280 for (int i = 0; i < poly-> nX + 1; i++) {281 for (int j = 0; j < poly-> nY + 1; j++) {280 for (int i = 0; i < poly->COOL_2D_nX + 1; i++) { 281 for (int j = 0; j < poly->COOL_2D_nY + 1; j++) { 282 282 fprintf (stderr, "x^%d y^%d : %g +/- %g\n", i, j, poly->coeff[i][j], poly->coeffErr[i][j]); 283 283 } … … 298 298 299 299 // XXX EAM : nX is order, not nTerms 300 for (loop_x = 0; loop_x < myPoly-> nX + 1; loop_x++) {300 for (loop_x = 0; loop_x < myPoly->COOL_2D_nX + 1; loop_x++) { 301 301 ySum = xSum; 302 302 // XXX EAM : nX is order, not nTerms 303 for (loop_y = 0; loop_y < myPoly-> nY + 1; loop_y++) {303 for (loop_y = 0; loop_y < myPoly->COOL_2D_nY + 1; loop_y++) { 304 304 if (myPoly->mask[loop_x][loop_y] == 0) { 305 305 polySum += ySum * myPoly->coeff[loop_x][loop_y]; … … 425 425 psS32 nTerm, nXterm, nYterm; 426 426 427 nXterm = myPoly-> nX + 1;428 nYterm = myPoly-> nY + 1;427 nXterm = myPoly->COOL_2D_nX + 1; 428 nYterm = myPoly->COOL_2D_nY + 1; 429 429 nTerm = nXterm * nYterm; 430 430 -
trunk/psphot/src/psphotDefinePixels.c
r5049 r5134 11 11 // Grab a subimage of the original image of size (2 * outerRadius). 12 12 srcRegion = psRegionForSquare (x, y, Radius); 13 srcRegion = psRegionForImage (imdata->image, &srcRegion);13 srcRegion = psRegionForImage (imdata->image, srcRegion); 14 14 15 15 mySource->pixels = psImageSubset(imdata->image, srcRegion); -
trunk/psphot/src/psphotSetup.c
r5058 r5134 77 77 float YMAX = psMetadataLookupF32 (&status, config, "YMAX"); 78 78 psRegion keep = psRegionSet (XMIN, XMAX, YMIN, YMAX); 79 keep = psRegionForImage (image, &keep); 80 psImageKeepRegion (mask, &keep, "OR", PSPHOT_MASK_INVALID); 81 // XXX EAM : psRegionForImage should not take psRegion *keep 79 keep = psRegionForImage (image, keep); 80 psImageKeepRegion (mask, keep, "OR", PSPHOT_MASK_INVALID); 82 81 83 82 // mask the saturated pixels
Note:
See TracChangeset
for help on using the changeset viewer.
