Changeset 23486
- Timestamp:
- Mar 23, 2009, 9:25:43 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
-
ppStats/src/ppStats.h (modified) (1 diff)
-
psLib/src/imageops/psImageBinning.c (modified) (1 diff)
-
psLib/src/imageops/psImageBinning.h (modified) (1 diff)
-
psLib/src/jpeg/psImageJpeg.c (modified) (1 diff)
-
psLib/src/jpeg/psImageJpeg.h (modified) (2 diffs)
-
psLib/src/math/psMinimizeLMM.c (modified) (14 diffs)
-
psLib/src/math/psMinimizeLMM.h (modified) (2 diffs)
-
psLib/src/math/psSpline.c (modified) (5 diffs)
-
psLib/src/math/psSpline.h (modified) (1 diff)
-
psLib/src/sys/psError.c (modified) (2 diffs)
-
psLib/src/sys/psError.h (modified) (1 diff)
-
psLib/src/sys/psLogMsg.c (modified) (1 diff)
-
psLib/src/sys/psLogMsg.h (modified) (2 diffs)
-
psastro/src/psastro.h (modified) (1 diff)
-
psphot/src/psphot.h (modified) (5 diffs)
-
psphot/src/psphotReadout.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStats.h
r23163 r23486 149 149 150 150 // used by ppStatsFromMetadata: 151 psDataType psDataTypeFromString (char *typename);152 ppStatsEntry *ppStatsEntryAlloc ();151 psDataType psDataTypeFromString(char *typename); 152 ppStatsEntry *ppStatsEntryAlloc(void); 153 153 154 154 psArray *ppStatsFromMetadataEntries (psMetadata *recipe); -
trunk/psLib/src/imageops/psImageBinning.c
r21107 r23486 31 31 } 32 32 33 psImageBinning *psImageBinningAlloc( ) {33 psImageBinning *psImageBinningAlloc(void) { 34 34 psImageBinning *binning = (psImageBinning*)psAlloc(sizeof(psImageBinning)); 35 35 psMemSetDeallocator(binning, (psFreeFunc)psImageBinningFree); -
trunk/psLib/src/imageops/psImageBinning.h
r21107 r23486 42 42 43 43 44 psImageBinning *psImageBinningAlloc( ) PS_ATTR_MALLOC;44 psImageBinning *psImageBinningAlloc(void) PS_ATTR_MALLOC; 45 45 bool psMemCheckBinning(psPtr ptr); 46 46 -
trunk/psLib/src/jpeg/psImageJpeg.c
r22681 r23486 35 35 } 36 36 37 psImageJpegColormap *psImageJpegColormapAlloc ()37 psImageJpegColormap *psImageJpegColormapAlloc(void) 38 38 { 39 39 psImageJpegColormap *map = psAlloc(sizeof(psImageJpegColormap)); -
trunk/psLib/src/jpeg/psImageJpeg.h
r14452 r23486 1 1 /* @file psImageJpeg.h 2 2 * @brief functions to generate JPEG images from psImage 3 * 3 * 4 4 * @author EAM 5 5 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ … … 28 28 29 29 // allocate a colormap (does not define the map values) 30 psImageJpegColormap *psImageJpegColormapAlloc( ) PS_ATTR_MALLOC;30 psImageJpegColormap *psImageJpegColormapAlloc(void) PS_ATTR_MALLOC; 31 31 32 32 // set the colormap values using the supplied name -
trunk/psLib/src/math/psMinimizeLMM.c
r21183 r23486 95 95 // check for non-finite entries in result 96 96 for (int i = 0; i < Beta->n; i++) { 97 if (!isfinite(Beta->data.F32[i])) {98 // psError(PS_ERR_BAD_PARAMETER_VALUE, 3, "Fit value diverges: vector[%d] is %.2f\n", i, Beta->data.F32[i]);99 return false;100 }97 if (!isfinite(Beta->data.F32[i])) { 98 // psError(PS_ERR_BAD_PARAMETER_VALUE, 3, "Fit value diverges: vector[%d] is %.2f\n", i, Beta->data.F32[i]); 99 return false; 100 } 101 101 } 102 102 … … 104 104 // (we must do this before truncating Beta below) 105 105 if (dLinear) { 106 *dLinear = psMinLM_dLinear(Beta, beta, lambda);107 } 108 109 // full-length Beta for checkLimits functions 106 *dLinear = psMinLM_dLinear(Beta, beta, lambda); 107 } 108 109 // full-length Beta for checkLimits functions 110 110 psVector *tmpBeta = psVectorAlloc(params->n, PS_TYPE_F32); 111 111 psVectorInit (tmpBeta, 0.0); … … 113 113 // set tmpBeta values which are not masked 114 114 for (int j = 0, n = 0; j < params->n; j++) { 115 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) continue;116 tmpBeta->data.F32[j] = Beta->data.F32[n];117 n++;115 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) continue; 116 tmpBeta->data.F32[j] = Beta->data.F32[n]; 117 n++; 118 118 } 119 119 … … 127 127 if (checkLimits) { 128 128 checkLimits (PS_MINIMIZE_BETA_LIMIT, j, Params->data.F32, tmpBeta->data.F32); 129 }129 } 130 130 131 131 Params->data.F32[j] = params->data.F32[j] - tmpBeta->data.F32[j]; … … 135 135 checkLimits (PS_MINIMIZE_PARAM_MIN, j, Params->data.F32, tmpBeta->data.F32); 136 136 checkLimits (PS_MINIMIZE_PARAM_MAX, j, Params->data.F32, tmpBeta->data.F32); 137 }137 } 138 138 } 139 139 140 140 // apply tmpBeta after limits have been checked 141 141 for (int j = 0, n = 0; j < params->n; j++) { 142 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) continue;143 Beta->data.F32[n] = tmpBeta->data.F32[j];144 n++;142 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) continue; 143 Beta->data.F32[n] = tmpBeta->data.F32[j]; 144 n++; 145 145 } 146 146 … … 169 169 // if none are available, return false 170 170 if (!psMinLM_AllocAB (&Alpha, &Beta, params, paramMask)) { 171 return false;171 return false; 172 172 } 173 173 … … 241 241 // beta only counts unmasked parameters 242 242 for (int i = 0; i < beta->n; i++) { 243 dh = lambda*B[i] + b[i];244 sh = 0.5*B[i]*dh;245 Sh += sh;243 dh = lambda*B[i] + b[i]; 244 sh = 0.5*B[i]*dh; 245 Sh += sh; 246 246 dLinear += lambda*PS_SQR(B[i]) + B[i]*b[i]; 247 247 } … … 295 295 assert (!isnan(chisq)); 296 296 297 // we track alpha,beta and params,deriv separately297 // we track alpha,beta and params,deriv separately 298 298 for (int j = 0, J = 0; j < params->n; j++) { 299 299 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) continue; … … 304 304 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[k])) continue; 305 305 alpha->data.F32[J][K] += weight * deriv->data.F32[k]; 306 K++;306 K++; 307 307 } 308 308 beta->data.F32[J] += weight * delta; 309 J++;309 J++; 310 310 } 311 311 } … … 328 328 between that function at the specified coords and the specified value at those 329 329 coords. 330 330 331 331 This requires F32 input data; all internal calls use F32. 332 332 XXX Make an F64 version? … … 386 386 // Alpha & Beta only contain elements to represent the unmasked parameters 387 387 if (!psMinLM_AllocAB (&Alpha, &Beta, params, paramMask)) { 388 psAbort ("programming error: no unmasked parameters to be fit\n");389 } 390 388 psAbort ("programming error: no unmasked parameters to be fit\n"); 389 } 390 391 391 psImage *alpha = psImageAlloc(Alpha->numCols, Alpha->numRows, PS_TYPE_F32); 392 392 psVector *beta = psVectorAlloc(Beta->n, PS_TYPE_F32); … … 490 490 psTrace ("psLib.math", 5, "failure to calculate covariance matrix\n"); 491 491 } 492 // set covar values which are not masked493 psImageInit (covar, 0.0);494 for (int j = 0, J = 0; j < params->n; j++) {495 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) {496 covar->data.F32[j][j] = 1.0;497 continue;498 }499 for (int k = 0, K = 0; k < params->n; k++) {500 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[k])) continue;501 covar->data.F32[j][k] = Alpha->data.F32[J][K];502 K++;503 }504 J++;505 }492 // set covar values which are not masked 493 psImageInit (covar, 0.0); 494 for (int j = 0, J = 0; j < params->n; j++) { 495 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[j])) { 496 covar->data.F32[j][j] = 1.0; 497 continue; 498 } 499 for (int k = 0, K = 0; k < params->n; k++) { 500 if (paramMask && (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[k])) continue; 501 covar->data.F32[j][k] = Alpha->data.F32[J][K]; 502 K++; 503 } 504 J++; 505 } 506 506 } 507 507 … … 533 533 // count unmasked parameters 534 534 if (paramMask) { 535 nParams = 0;536 for (int i = 0; i < paramMask->n; i++) {537 if (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue;538 nParams ++;539 }540 } 541 542 if (nParams == 0) { 543 return false;535 nParams = 0; 536 for (int i = 0; i < paramMask->n; i++) { 537 if (paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue; 538 nParams ++; 539 } 540 } 541 542 if (nParams == 0) { 543 return false; 544 544 } 545 545 … … 585 585 } 586 586 587 psMinConstraint* psMinConstraintAlloc( )587 psMinConstraint* psMinConstraintAlloc(void) 588 588 { 589 589 psMinConstraint *tmp = psAlloc(sizeof(psMinConstraint)); -
trunk/psLib/src/math/psMinimizeLMM.h
r15046 r23486 94 94 psMinConstraint; 95 95 96 psMinConstraint *psMinConstraintAlloc( ) PS_ATTR_MALLOC;96 psMinConstraint *psMinConstraintAlloc(void) PS_ATTR_MALLOC; 97 97 98 98 /** Allocates a psMinimization structure. … … 174 174 psF32 lambda); 175 175 176 // allocate alpha and beta for unmasked parameters only 176 // allocate alpha and beta for unmasked parameters only 177 177 bool psMinLM_AllocAB (psImage **Alpha, psVector **Beta, const psVector *params, const psVector *paramMask); 178 178 -
trunk/psLib/src/math/psSpline.c
r12434 r23486 103 103 tabulated function at n points, this routine calculates the second 104 104 derivatives of the interpolating cubic splines at those n points. 105 105 106 106 The first and second derivatives at the endpoints were previously undefined in 107 107 the SDR. From bugzilla #???, they are required to be 0.0, implementing natural 108 108 splines. 109 109 110 110 Endpoints are defined by 111 111 PS_LEFT_SPLINE_DERIV 112 112 PS_RIGHT_SPLINE_DERIV 113 113 114 114 This routine assumes that vectors x and y are of the appropriate types/sizes 115 115 (F32). 116 116 117 117 XXX: use recycled vectors for internal data. 118 118 XXX: do an F64 version? … … 177 177 } 178 178 179 psSpline1D *psSpline1DAlloc( )179 psSpline1D *psSpline1DAlloc(void) 180 180 { 181 181 psSpline1D *tmpSpline = (psSpline1D *) psAlloc(sizeof(psSpline1D)); … … 192 192 psVectorFitSpline1D(): given a set of x/y vectors, this routine generates the 193 193 linear or cublic splines which satisfy those data points. 194 194 195 195 The formula for calculating the spline polynomials is derived from Numerical 196 196 Recipes in C. The basic idea is that the polynomial is … … 206 206 into a polynomial in terms of x, and then saving the coefficients of the 207 207 powers of x in the spline polynomials. This gets pretty complicated. 208 208 209 209 XXX: What types must be supported? 210 210 *****************************************************************************/ … … 354 354 (vectorBinDisectF32()). Then it evaluates the spline at that x location 355 355 by a call to the 1D polynomial functions. 356 356 357 357 XXX: The spline eval functions require input and output to be F32. however 358 358 the spline fit functions require F32 and F64. 359 359 360 360 XXX: This only works if spline->knots if psF32. Must we add support for psU32 and 361 361 psF64? -
trunk/psLib/src/math/psSpline.h
r14452 r23486 46 46 * @return psSpline1D* new 1-D spline struct 47 47 */ 48 psSpline1D *psSpline1DAlloc( ) PS_ATTR_MALLOC;48 psSpline1D *psSpline1DAlloc(void) PS_ATTR_MALLOC; 49 49 50 50 /** Evaluates 1-D spline polynomials at a specific coordinate. -
trunk/psLib/src/sys/psError.c
r19034 r23486 146 146 147 147 psErrorCode p_psErrorV(const char* filename, 148 unsigned int lineno,149 const char* func,150 psErrorCode code,151 bool new,152 const char* format,153 va_list ap)148 unsigned int lineno, 149 const char* func, 150 psErrorCode code, 151 bool new, 152 const char* format, 153 va_list ap) 154 154 { 155 155 char errMsg[MAX_STRING_LENGTH]; … … 245 245 } 246 246 247 long psErrorGetStackSize( )247 long psErrorGetStackSize(void) 248 248 { 249 249 psArray *errorStack = psErrorStackGet(); -
trunk/psLib/src/sys/psError.h
r19034 r23486 87 87 * @return int The number of items on the error stack 88 88 */ 89 long psErrorGetStackSize( );89 long psErrorGetStackSize(void); 90 90 91 91 -
trunk/psLib/src/sys/psLogMsg.c
r23216 r23486 76 76 } 77 77 78 int psLogGetLevel( )78 int psLogGetLevel(void) 79 79 { 80 80 return globalLogLevel; -
trunk/psLib/src/sys/psLogMsg.h
r14452 r23486 63 63 * @return int: The current file descriptor. 64 64 */ 65 int psLogGetDestination( );65 int psLogGetDestination(void); 66 66 67 67 … … 83 83 * @return int: The current logging level. 84 84 */ 85 int psLogGetLevel( );85 int psLogGetLevel(void); 86 86 87 87 /** This procedure sets the log format for future log messages. The argument -
trunk/psastro/src/psastro.h
r23412 r23486 58 58 bool psastroMaskUpdates (pmConfig *config); 59 59 60 psPlaneDistort *psPlaneDistortIdentity ( );60 psPlaneDistort *psPlaneDistortIdentity (void); 61 61 bool psPlaneDistortIsIdentity (psPlaneDistort *distort); 62 62 -
trunk/psphot/src/psphot.h
r23242 r23486 23 23 24 24 bool psphotModelTest (pmConfig *config, const pmFPAview *view, psMetadata *recipe); 25 bool psphotInit ( );25 bool psphotInit (void); 26 26 bool psphotReadout (pmConfig *config, const pmFPAview *view); 27 27 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources); … … 35 35 36 36 // XXX test functions 37 psArray *psphotFakeSources ( );37 psArray *psphotFakeSources (void); 38 38 39 39 // psphotReadout functions … … 76 76 77 77 // thread-related: 78 bool psphotSetThreads ( );78 bool psphotSetThreads (void); 79 79 bool psphotChooseCellSizes (int *Cx, int *Cy, pmReadout *readout, int nThreads); 80 80 bool psphotCoordToCell (int *group, int *cell, float x, float y, int Cx, int Cy); … … 136 136 bool psphotPlotMoments (pmConfig *config, pmFPAview *view, psArray *sources); 137 137 bool psphotPlotPSFModel (pmConfig *config, pmFPAview *view, psArray *sources); 138 bool psphotFitInit ( );139 bool psphotFitSummary ( );138 bool psphotFitInit (void); 139 bool psphotFitSummary (void); 140 140 141 141 bool psphotMergeSources (psArray *oldSources, psArray *newSources); … … 230 230 psImage *pmPCMDataSaveImage (pmPCMData *pcm); 231 231 232 int psphotKapaOpen ( );233 bool psphotKapaClose ( );232 int psphotKapaOpen (void); 233 bool psphotKapaClose (void); 234 234 bool psphotImageBackgroundCellHistogram (psVector *values, float mean, float sigma, int ix, int iy); 235 235 bool psphotDiagnosticPlots (const pmConfig *config, const char *name, ...); -
trunk/psphot/src/psphotReadout.c
r21366 r23486 2 2 3 3 // this should be called by every program that links against libpsphot 4 bool psphotInit ( ) {4 bool psphotInit (void) { 5 5 6 6 psphotErrorRegister(); // register our error codes/messages
Note:
See TracChangeset
for help on using the changeset viewer.
