Changeset 36329
- Timestamp:
- Dec 2, 2013, 9:59:15 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/psModules/src/objects
- Files:
-
- 3 edited
-
pmModelFuncs.h (modified) (1 diff)
-
pmSource.h (modified) (1 diff)
-
pmSourceIO_CMF.c.in (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psModules/src/objects/pmModelFuncs.h
r36326 r36329 47 47 PM_MODEL_SERSIC_PCM_FAIL_GRID = 0x100, ///< sersic model fit failed on the grid search 48 48 PM_MODEL_PCM_FAIL_GUESS = 0x200, ///< non-sersic model fit failed on the initial moments-based guess 49 PM_MODEL_BEST_FIT = 0x400, ///< this model was the best fit and was subtracted 49 50 } pmModelStatus; 50 51 -
branches/eam_branches/ipp-20130904/psModules/src/objects/pmSource.h
r36157 r36329 40 40 PM_SOURCE_TMPF_PETRO_KEEP = 0x0100, 41 41 PM_SOURCE_TMPF_PETRO_SKIP = 0x0200, 42 PM_SOURCE_TMPF_GALAXY_FIT = 0x0400, // not just galaxies (trails as well) 43 PM_SOURCE_TMPF_PETRO_FIT = 0x0800, 42 44 } pmSourceTmpF; 43 45 -
branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO_CMF.c.in
r36326 r36329 789 789 char name[64]; 790 790 791 pmModelType modelTypeTrail = pmModelClassGetType("PS_MODEL_TRAIL"); 792 791 793 // create a header to hold the output data 792 794 psMetadata *outhead = psMetadataAlloc (); … … 798 800 sources = psArraySort (sources, pmSourceSortByFlux); 799 801 800 @>PS1_DV2@float magOffset;801 @>PS1_DV2@float zeroptErr;802 @>PS1_DV2@float fwhmMajor;803 @>PS1_DV2@float fwhmMinor;804 @>PS1_DV2@pmSourceOutputsCommonValues (&magOffset, &zeroptErr, &fwhmMajor, &fwhmMinor, readout, imageHeader);802 float magOffset; 803 float zeroptErr; 804 float fwhmMajor; 805 float fwhmMinor; 806 pmSourceOutputsCommonValues (&magOffset, &zeroptErr, &fwhmMajor, &fwhmMinor, readout, imageHeader); 805 807 806 808 // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams … … 853 855 xPos = PAR[PM_PAR_XPOS]; 854 856 yPos = PAR[PM_PAR_YPOS]; 855 xErr = dPAR[PM_PAR_XPOS]; 856 yErr = dPAR[PM_PAR_YPOS]; 857 858 // for the extended source models, we do not always fit the centroid in the non-linear fitting process 859 // current situation (hard-wired into psphotSourceFits.c:psphotFitPCM, 860 // SERSIC, DEV, EXP : X,Y not fitted (PCM and not PCM) 861 // TRAIL : X,Y are fitted 862 // 863 864 // XXX this should be based on what happened, not on the model type 865 if (model->type == modelTypeTrail) { 866 xErr = dPAR[PM_PAR_XPOS]; 867 yErr = dPAR[PM_PAR_YPOS]; 868 } else { 869 // this is definitely an underestimate since it does not 870 // account for the extent of the source 871 xErr = fwhmMajor * model->magErr / 2.35; 872 yErr = fwhmMinor * model->magErr / 2.35; 873 } 857 874 858 875 @>PS1_DV2@ psSphere ptSky = {0.0, 0.0, 0.0, 0.0}; … … 870 887 row = psMetadataAlloc (); 871 888 872 // XXX we are not writing out the mode (flags) or the type (psf, ext, etc)873 889 // the psMetadataAdd entry and the double quotes are used by grep to select the output fields for automatic documentation 874 890 // This set of psMetadataAdd Entries marks the "----" "Start of the XFIT segment" … … 950 966 951 967 snprintf (name, 64, "EXT_PAR_%02d", k); 952 968 953 969 if (k < model->params->n) { 954 970 psMetadataAddF32 (row, PS_LIST_TAIL, name, 0, "", model->params->data.F32[k]); … … 960 976 // optionally, write out the covariance matrix values 961 977 // XXX do I need to pad this to match the biggest covar matrix? 962 if ( model->covar) {978 if (false && model->covar) { 963 979 for (int iy = 0; iy < model->covar->numCols; iy++) { 964 980 for (int ix = iy; ix < model->covar->numCols; ix++) { … … 1089 1105 if (model->params->n > 7) { 1090 1106 PAR[7] = psMetadataLookupF32(&status, row, "EXT_PAR_07"); 1091 } 1092 // read the covariance matrix 1093 int nparams = model->params->n; 1094 psImage *covar = psImageAlloc(nparams, nparams, PS_TYPE_F32); 1095 for (int y = 0; y < nparams; y++) { 1096 for (int x = 0; x < nparams; x++) { 1097 char name[64]; 1098 snprintf(name, 64, "EXT_COVAR_%02d_%02d", y, x); 1099 covar->data.F32[y][x] = psMetadataLookupF32(&status, row, name); 1100 } 1101 } 1102 model->covar = covar; 1107 // XXX add an error: 1108 // dPAR[7] = psMetadataLookupF32(&status, row, "EXT_PAR_07_"); 1109 } 1110 1111 // XXX : make this depend on what is in the cmf 1112 if (0) { 1113 // read the covariance matrix 1114 int nparams = model->params->n; 1115 psImage *covar = psImageAlloc(nparams, nparams, PS_TYPE_F32); 1116 for (int y = 0; y < nparams; y++) { 1117 for (int x = 0; x < nparams; x++) { 1118 char name[64]; 1119 snprintf(name, 64, "EXT_COVAR_%02d_%02d", y, x); 1120 covar->data.F32[y][x] = psMetadataLookupF32(&status, row, name); 1121 } 1122 } 1123 model->covar = covar; 1124 } 1103 1125 1104 1126 if (modelType == extModelType) {
Note:
See TracChangeset
for help on using the changeset viewer.
