Changeset 36731
- Timestamp:
- May 5, 2014, 2:33:52 PM (12 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 2 edited
-
psphotFullForceSummary.c (modified) (1 diff)
-
psphotFullForceSummaryReadout.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFullForceSummary.c
r36718 r36731 186 186 psFitsClose(fits); 187 187 188 // Convert to an array indexed by ID 188 // Convert to a set of arrays indexed by model type + 1 189 // which contain pointers to arrays indexed by ID 189 190 #define MAX_MODEL_TYPE 10 190 191 psArray *sortedTables = psArrayAlloc(MAX_MODEL_TYPE+1); -
trunk/psphot/src/psphotFullForceSummaryReadout.c
r36718 r36731 12 12 psVector *fRMajor; 13 13 psVector *fRMinor; 14 psArray *zeroPt; 15 psArray *exptime; 16 psArray *cffTables; 14 psArray *zeroPt; // zero points for each input used with exptime to scale flux 15 psArray *exptime; // exposure times for each input 16 psArray *cffTables; // one for each model type index is (model_type + 1) entry 0 is no extended model (star) 17 17 } galaxyShapeOptions; 18 18 … … 384 384 // save the flux and dFlux values from entry with lowest chisq 385 385 psF64 fluxBest = fluxVec->data.F32[min_k]; 386 psF64 dFlux0 = dFluxVec->data.F32[min_k]; 386 psF64 dFluxBest = dFluxVec->data.F32[min_k]; 387 psF64 dFlux0 = NAN; 387 388 psF64 flux0 = NAN; 388 389 389 390 if (useFit) { 390 #define NUM_TRIALS_INIT 9 // this isn't used for anything execpt for the initial vector lengths391 #define NUM_TRIALS_INIT 9 391 392 psVector *major = psVectorAllocEmpty(NUM_TRIALS_INIT, PS_TYPE_F64); 392 393 psVector *minor = psVectorAllocEmpty(NUM_TRIALS_INIT, PS_TYPE_F64); … … 477 478 psPolynomial2D *chisqFit = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); 478 479 psPolynomial2D *fluxFit = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); 480 psPolynomial2D *fluxErrorFit = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); 479 481 chisqFit->coeffMask[2][2] = PS_POLY_MASK_SET; 480 482 chisqFit->coeffMask[2][1] = PS_POLY_MASK_SET; … … 483 485 fluxFit->coeffMask[2][1] = PS_POLY_MASK_SET; 484 486 fluxFit->coeffMask[1][2] = PS_POLY_MASK_SET; 487 fluxErrorFit->coeffMask[2][2] = PS_POLY_MASK_SET; 488 fluxErrorFit->coeffMask[2][1] = PS_POLY_MASK_SET; 489 fluxErrorFit->coeffMask[1][2] = PS_POLY_MASK_SET; 485 490 486 491 bool goodFit = psVectorFitPolynomial2D (chisqFit, NULL, 0xff, chisq, NULL, major, minor); … … 504 509 } else { 505 510 flux0 = fluxBest; 511 } 512 513 // .. and compute dFlux at the minimum chisq position 514 bool goodFluxErrorFit = psVectorFitPolynomial2D(fluxErrorFit, NULL, 0xFF, dFlux, NULL, major, minor); 515 if (goodFluxErrorFit) { 516 dFlux0 = psPolynomial2DEval(fluxErrorFit, major0, minor0); 517 } else { 518 dFlux0 = dFluxBest; 506 519 } 507 520 … … 540 553 } 541 554 psFree(chisqFit); 555 psFree(fluxFit); 556 psFree(fluxErrorFit); 542 557 psFree(major); 543 558 psFree(minor); … … 552 567 model->chisq = minChisq; 553 568 flux0 = fluxBest; 569 dFlux0 = dFluxBest; 554 570 #ifdef PRINTVALS 555 571 fprintf(stderr, "%4d %3d %3ld | %6.3f %6.3f %6.3f %6.3f skip fit\n", … … 581 597 static bool setOptions(galaxyShapeOptions *opt, pmReadout *readout, psMetadata *recipe, bool makeVectors) { 582 598 bool status; 583 bool useAnalysis; 599 bool useAnalysis; // fall back to recipe if we dont' find values in analysis. Probably should no longer do this 584 600 585 601 psMetadataLookupF32(&useAnalysis, readout->analysis, "GALAXY_SHAPES_FR_MAJOR_MIN");
Note:
See TracChangeset
for help on using the changeset viewer.
