Changeset 34049 for branches/eam_branches/ipp-20120601
- Timestamp:
- Jun 20, 2012, 12:22:52 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120601
- Files:
-
- 21 edited
-
. (modified) (1 prop)
-
Ohana/src/opihi/cmd.astro (modified) (1 prop)
-
ippTasks/addstar.pro (modified) (1 diff)
-
ppImage/src (modified) (1 prop)
-
psModules (modified) (1 prop)
-
psModules/src/objects/pmModelFuncs.h (modified) (2 diffs)
-
psModules/src/objects/pmSource.c (modified) (10 diffs)
-
psModules/src/objects/pmSource.h (modified) (1 diff)
-
psModules/src/objects/pmSourcePhotometry.c (modified) (16 diffs)
-
psModules/src/objects/pmSourcePhotometry.h (modified) (3 diffs)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotAddNoise.c (modified) (1 diff)
-
psphot/src/psphotEfficiency.c (modified) (1 diff)
-
psphot/src/psphotFitSourcesLinear.c (modified) (17 diffs)
-
psphot/src/psphotReplaceUnfit.c (modified) (2 diffs)
-
psphot/src/psphotStackImageLoop.c (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
psvideophot (modified) (1 prop)
-
tools/regpeek.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120601
- Property svn:mergeinfo changed
/trunk (added) merged: 33979-33980,33986-33991,33993-33994,34006-34008,34010-34018
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120601/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/ippTasks/addstar.pro
r33706 r34049 321 321 end 322 322 if ("$STAGE" == "staticsky") 323 $run = $run -- multi_num $STAGE_EXTRA1323 $run = $run --stage_extra1 $STAGE_EXTRA1 --stage_id $STAGE_ID 324 324 end 325 325 if ("$STAGE" == "cam") -
branches/eam_branches/ipp-20120601/ppImage/src
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/psModules
- Property svn:mergeinfo changed
/trunk/psModules (added) merged: 33993
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120601/psModules/src/objects/pmModelFuncs.h
r33963 r34049 29 29 # define PM_MODEL_FUNCS_H 30 30 31 # define HAVE_MODEL_VAR 1 32 31 33 /// @addtogroup Objects Object Detection / Analysis Functions 32 34 /// @{ … … 55 57 PM_MODEL_OP_NORM = 0x20, 56 58 PM_MODEL_OP_NOISE = 0x40, 59 # if (HAVE_MODEL_VAR) 57 60 PM_MODEL_OP_MODELVAR = 0x80, 61 # endif 58 62 } pmModelOpMode; 59 63 -
branches/eam_branches/ipp-20120601/psModules/src/objects/pmSource.c
r34044 r34049 51 51 psFree(tmp->pixels); 52 52 psFree(tmp->variance); 53 # if (HAVE_MODEL_VAR) 53 54 psFree(tmp->modelVar); 55 # endif 54 56 psFree(tmp->maskObj); 55 57 psFree(tmp->maskView); … … 78 80 psFree (source->pixels); 79 81 psFree (source->variance); 82 # if (HAVE_MODEL_VAR) 80 83 psFree (source->modelVar); 84 # endif 81 85 psFree (source->maskObj); 82 86 psFree (source->maskView); … … 86 90 source->pixels = NULL; 87 91 source->variance = NULL; 92 # if (HAVE_MODEL_VAR) 88 93 source->modelVar = NULL; 94 # endif 89 95 source->maskObj = NULL; 90 96 source->maskView = NULL; … … 116 122 source->pixels = NULL; 117 123 source->variance = NULL; 124 # if (HAVE_MODEL_VAR) 118 125 source->modelVar = NULL; 126 # endif 119 127 source->maskObj = NULL; 120 128 source->maskView = NULL; … … 204 212 source->pixels = in->pixels ? psImageCopyView(NULL, in->pixels) : NULL; 205 213 source->variance = in->variance ? psImageCopyView(NULL, in->variance) : NULL; 214 # if (HAVE_MODEL_VAR) 206 215 source->modelVar = NULL; 216 # endif 207 217 source->maskView = in->maskView ? psImageCopyView(NULL, in->maskView) : NULL; 208 218 … … 1033 1043 1034 1044 bool addNoise = mode & PM_MODEL_OP_NOISE; 1045 1046 # if (HAVE_MODEL_VAR) 1035 1047 bool addModelVar = mode & PM_MODEL_OP_MODELVAR; 1036 1037 1048 if (addModelVar) psAssert (source->modelVar, "programming error"); 1049 # endif 1038 1050 1039 1051 // require the use of pmModelAddWithOffset if we are adding noise (because the model size and norm are rescaled) … … 1058 1070 } 1059 1071 1072 # if (HAVE_MODEL_VAR) 1060 1073 psF32 **target = addModelVar ? source->modelVar->data.F32 : source->pixels->data.F32; 1074 # else 1075 psF32 **target = source->pixels->data.F32; 1076 # endif 1061 1077 1062 1078 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { … … 1073 1089 } 1074 1090 } 1091 # if (HAVE_MODEL_VAR) 1075 1092 if (!addModelVar) { 1076 1093 if (add) { … … 1080 1097 } 1081 1098 } 1099 # else 1100 if (add) { 1101 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1102 } else { 1103 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1104 } 1105 # endif 1082 1106 return true; 1083 1107 } … … 1087 1111 target = source->variance; 1088 1112 } 1113 # if (HAVE_MODEL_VAR) 1089 1114 if (addModelVar) { 1090 1115 target = source->modelVar; 1091 1116 } 1117 # endif 1092 1118 1093 1119 if (add) { 1094 1120 status = pmModelAddWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1121 # if (HAVE_MODEL_VAR) 1095 1122 if (!addNoise && !addModelVar) source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1123 # else 1124 source->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 1125 # endif 1096 1126 } else { 1097 1127 status = pmModelSubWithOffset (target, source->maskObj, model, PM_MODEL_OP_FULL, maskVal, dx, dy); 1128 # if (HAVE_MODEL_VAR) 1098 1129 if (!addNoise && !addModelVar) source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1130 # else 1131 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 1132 # endif 1099 1133 } 1100 1134 if (!status) { -
branches/eam_branches/ipp-20120601/psModules/src/objects/pmSource.h
r33963 r34049 72 72 psImage *pixels; ///< Rectangular region including object pixels. 73 73 psImage *variance; ///< Image variance. 74 # if (HAVE_MODEL_VAR) 74 75 psImage *modelVar; ///< variance based on current models 76 # endif 75 77 psImage *maskObj; ///< unique mask for this object which marks included pixels associated with objects. 76 78 psImage *maskView; ///< view into global image mask for this object region -
branches/eam_branches/ipp-20120601/psModules/src/objects/pmSourcePhotometry.c
r33963 r34049 899 899 } 900 900 901 # if (HAVE_MODEL_VAR) 901 902 double pmSourceModelWeight(const pmSource *Mi, int term, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 903 # else 904 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal) 905 # endif 902 906 { 903 907 PS_ASSERT_PTR_NON_NULL(Mi, NAN); 908 # if (HAVE_MODEL_VAR) 904 909 double flux = 0, wt = 1.0, factor = 0; 910 # else 911 double flux = 0, wt = 0, factor = 0; 912 # endif 905 913 906 914 const psImage *Pi = Mi->modelFlux; 907 915 assert (Pi != NULL); 908 916 917 # if (HAVE_MODEL_VAR) 909 918 const psImage *Wi = NULL; 910 919 switch (fitVarMode) { … … 922 931 psAbort("programming error"); 923 932 } 924 933 # else 934 const psImage *Wi = Mi->variance; 935 if (!unweighted_sum) { 936 assert (Wi != NULL); 937 } 938 # endif 925 939 const psImage *Ti = Mi->maskObj; 926 940 assert (Ti != NULL); … … 928 942 for (int yi = 0; yi < Pi->numRows; yi++) { 929 943 for (int xi = 0; xi < Pi->numCols; xi++) { 930 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi] & maskVal) continue; 944 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi] & maskVal) 945 continue; 946 # if (HAVE_MODEL_VAR) 931 947 if (fitVarMode != PM_SOURCE_PHOTFIT_CONST) { 932 948 wt = covarFactor * Wi->data.F32[yi][xi]; 933 949 if (wt == 0) continue; 934 950 } 951 # else 952 if (!unweighted_sum) { 953 wt = covarFactor * Wi->data.F32[yi][xi]; 954 if (wt == 0) 955 continue; 956 } 957 # endif 935 958 936 959 switch (term) { … … 948 971 } 949 972 973 # if (HAVE_MODEL_VAR) 950 974 // wt is 1.0 for CONST 951 975 flux += (factor * Pi->data.F32[yi][xi]) / wt; 976 # else 977 if (unweighted_sum) { 978 flux += (factor * Pi->data.F32[yi][xi]); 979 } else { 980 flux += (factor * Pi->data.F32[yi][xi]) / wt; 981 } 982 # endif 952 983 } 953 984 } … … 955 986 } 956 987 988 # if (HAVE_MODEL_VAR) 957 989 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 990 # else 991 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal) 992 # endif 958 993 { 959 994 PS_ASSERT_PTR_NON_NULL(Mi, NAN); … … 963 998 int xIs, xJs, yIs, yJs; 964 999 int xIe, yIe; 1000 # if (HAVE_MODEL_VAR) 965 1001 double flux; 966 1002 double wt = 1.0; 1003 # else 1004 double flux, wt; 1005 # endif 967 1006 968 1007 const psImage *Pi = Mi->modelFlux; … … 971 1010 assert (Pj != NULL); 972 1011 1012 # if (HAVE_MODEL_VAR) 973 1013 const psImage *Wi = NULL; 974 1014 switch (fitVarMode) { … … 986 1026 psAbort("programming error"); 987 1027 } 1028 # else 1029 const psImage *Wi = Mi->variance; 1030 if (!unweighted_sum) { 1031 assert (Wi != NULL); 1032 } 1033 # endif 988 1034 989 1035 const psImage *Ti = Mi->maskObj; … … 1015 1061 continue; 1016 1062 1063 # if (HAVE_MODEL_VAR) 1017 1064 float value = (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 1018 1065 switch (fitVarMode) { … … 1031 1078 1032 1079 flux += value / wt; 1080 # else 1081 // XXX skip the nonsense weight pixels? 1082 if (unweighted_sum) { 1083 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 1084 } else { 1085 wt = covarFactor * Wi->data.F32[yi][xi]; 1086 if (wt > 0) { 1087 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt; 1088 } 1089 } 1090 # endif 1033 1091 } 1034 1092 } … … 1036 1094 } 1037 1095 1096 # if (HAVE_MODEL_VAR) 1038 1097 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal) 1098 # else 1099 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal) 1100 # endif 1039 1101 { 1040 1102 PS_ASSERT_PTR_NON_NULL(Mi, NAN); … … 1044 1106 int xIs, xJs, yIs, yJs; 1045 1107 int xIe, yIe; 1108 # if (HAVE_MODEL_VAR) 1046 1109 double flux; 1047 1110 double wt = 1.0; 1111 # else 1112 double flux, wt; 1113 # endif 1048 1114 1049 1115 const psImage *Pi = Mi->pixels; … … 1052 1118 assert (Pj != NULL); 1053 1119 1120 # if (HAVE_MODEL_VAR) 1054 1121 const psImage *Wi = NULL; 1055 1122 switch (fitVarMode) { … … 1067 1134 psAbort("programming error"); 1068 1135 } 1136 # else 1137 const psImage *Wi = Mi->variance; 1138 if (!unweighted_sum) { 1139 assert (Wi != NULL); 1140 } 1141 # endif 1069 1142 1070 1143 const psImage *Ti = Mi->maskObj; … … 1096 1169 continue; 1097 1170 1171 # if (HAVE_MODEL_VAR) 1098 1172 float value = (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 1099 1173 switch (fitVarMode) { … … 1113 1187 flux += value / wt; 1114 1188 1189 # else 1190 // XXX skip the nonsense weight pixels? 1191 if (unweighted_sum) { 1192 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]); 1193 } else { 1194 wt = covarFactor * Wi->data.F32[yi][xi]; 1195 if (wt > 0) { 1196 flux += (Pi->data.F32[yi][xi] * Pj->data.F32[yj][xj]) / wt; 1197 } 1198 } 1199 # endif 1115 1200 } 1116 1201 } -
branches/eam_branches/ipp-20120601/psModules/src/objects/pmSourcePhotometry.h
r33963 r34049 38 38 } pmSourcePhotometryMode; 39 39 40 # if (HAVE_MODEL_VAR) 40 41 typedef enum { 41 42 PM_SOURCE_PHOTFIT_NONE = 0, … … 44 45 PM_SOURCE_PHOTFIT_MODEL_VAR = 3, 45 46 } pmSourceFitVarMode; 47 # endif 46 48 47 49 bool pmSourcePhotometryModel( … … 82 84 bool pmSourceMeasureDiffStats (pmSource *source, psImageMaskType maskVal, psImageMaskType markVal); 83 85 86 # if (HAVE_MODEL_VAR) 84 87 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal); 85 88 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal); 86 89 double pmSourceModelWeight(const pmSource *Mi, int term, const pmSourceFitVarMode fitVarMode, const float covarFactor, psImageMaskType maskVal); 90 # else 91 double pmSourceDataDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal); 92 double pmSourceModelDotModel (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal); 93 double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal); 94 # endif 87 95 88 96 bool pmSourceNeighborFlags (pmSource *source); -
branches/eam_branches/ipp-20120601/psphot
- Property svn:mergeinfo changed
/trunk/psphot (added) merged: 33980,33993-33994
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120601/psphot/src
- Property svn:mergeinfo changed
/trunk/psphot/src (added) merged: 33980,33993-33994
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120601/psphot/src/psphot.h
r33963 r34049 99 99 100 100 bool psphotFitSourcesLinear (pmConfig *config, const pmFPAview *view, const char *filerule, bool final); 101 102 # if (HAVE_MODEL_VAR) 101 103 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final, pmSourceFitVarMode fitVarMode); 104 # else 105 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final); 106 # endif 102 107 103 108 bool psphotSourceSize (pmConfig *config, const pmFPAview *view, const char *filerule, bool getPSFsize); -
branches/eam_branches/ipp-20120601/psphot/src/psphotAddNoise.c
r32348 r34049 47 47 48 48 psArray *sources = detections->allSources; 49 psAssert (sources, "missing sources?"); 49 //psAssert (sources, "missing sources?"); 50 // if no work, should just return true 51 if (!sources) return true; 50 52 51 53 psTimerStart ("psphot.noise"); -
branches/eam_branches/ipp-20120601/psphot/src/psphotEfficiency.c
r33963 r34049 420 420 421 421 // psphotFitSourcesLinearReadout subtracts the model fits 422 # if (HAVE_MODEL_VAR) 422 423 if (!psphotFitSourcesLinearReadout(recipe, readout, fakeSourcesAll, psf, true, PM_SOURCE_PHOTFIT_CONST)) { 424 # else 425 if (!psphotFitSourcesLinearReadout(recipe, readout, fakeSourcesAll, psf, true)) { 426 # endif 423 427 psError(PS_ERR_UNKNOWN, false, "Unable to perform linear fit on fake sources."); 424 428 psFree(fakeSources); -
branches/eam_branches/ipp-20120601/psphot/src/psphotFitSourcesLinear.c
r33963 r34049 12 12 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psImageMaskType markVal); 13 13 14 # if (HAVE_MODEL_VAR) 14 15 bool psphotGenerateModelVariance (pmConfig *config, const pmFPAview *view, pmFPAfile *file, int index, psMetadata *recipe, pmReadout *readout, psArray *sources); 15 16 pmSourceFitVarMode psphotGetFitVarMode (psMetadata *recipe); 16 17 bool psphotFreeModelVariance (pmReadout *readout, psArray *sources); 18 # endif 17 19 18 20 // for now, let's store the detections on the readout->analysis for each readout … … 28 30 assert (recipe); 29 31 32 # if (HAVE_MODEL_VAR) 30 33 pmSourceFitVarMode fitVarMode = psphotGetFitVarMode (recipe); 31 34 if (!fitVarMode) { … … 37 40 // do a single pass. 38 41 pmSourceFitVarMode fitVarModePass1 = (fitVarMode == PM_SOURCE_PHOTFIT_MODEL_VAR) ? PM_SOURCE_PHOTFIT_CONST : fitVarMode; 42 # endif 39 43 40 44 int num = psphotFileruleCount(config, filerule); … … 64 68 psAssert (psf, "missing psf?"); 65 69 66 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final, fitVarModePass1)) { 70 # if (HAVE_MODEL_VAR) 71 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final, fitVarModePass1)) 72 # else 73 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final)) 74 # endif 75 { 67 76 psError (PSPHOT_ERR_CONFIG, false, "failed to fit sources (linear) for %s entry %d", filerule, i); 68 77 return false; 69 78 } 70 79 80 # if (HAVE_MODEL_VAR) 71 81 // the MODEL_VAR weighting scheme requires knowledge of the model fluxes to generate the variance 72 82 // after we have determined the initial set of fits, then we can generate the variance image and … … 94 104 } 95 105 } 106 # endif 96 107 97 108 psphotVisualShowResidualImage (readout, (num > 0)); … … 102 113 } 103 114 115 # if (HAVE_MODEL_VAR) 104 116 // look up the fit variance mode from the recipe; older recipes do not have the value 105 117 // 'LINEAR_FIT_VARIANCE_MODE'; in those cases, look for 'CONSTANT_PHOTOMETRIC_WEIGHTS' as a boolean and … … 130 142 return PM_SOURCE_PHOTFIT_NONE; 131 143 } 132 133 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final, pmSourceFitVarMode fitVarMode) { 134 144 # endif 145 146 # if (HAVE_MODEL_VAR) 147 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final, pmSourceFitVarMode fitVarMode) 148 # else 149 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final) 150 # endif 151 { 135 152 bool status; 136 153 float x; … … 168 185 if (psRegionIsNaN (AnalysisRegion)) psAbort("analysis region mis-defined"); 169 186 187 # if (!HAVE_MODEL_VAR) 188 bool CONSTANT_PHOTOMETRIC_WEIGHTS = 189 psMetadataLookupBool(&status, recipe, "CONSTANT_PHOTOMETRIC_WEIGHTS"); 190 if (!status) { 191 psAbort("You must provide a value for the BOOL recipe CONSTANT_PHOTOMETRIC_WEIGHTS"); 192 } 193 # endif 170 194 int SKY_FIT_ORDER = psMetadataLookupS32(&status, recipe, "SKY_FIT_ORDER"); 171 195 if (!status) { … … 295 319 psSparseBorder *border = psSparseBorderAlloc (sparse, nBorder); 296 320 321 # if (HAVE_MODEL_VAR) 297 322 // if fitVarMode is MODEL_VAR, then we need to generate the model image variance 298 323 // XXX we have two possibilities here: … … 302 327 303 328 // 2) do a single pass, and use the model guess to define the model variance (but do I trust the Model Guess?) 329 # endif 304 330 305 331 // fill out the sparse matrix elements and border elements (B) … … 310 336 311 337 // diagonal elements of the sparse matrix (auto-cross-product) 338 # if (HAVE_MODEL_VAR) 312 339 f = pmSourceModelDotModel (SRCi, SRCi, fitVarMode, covarFactor, maskVal); 340 # else 341 f = pmSourceModelDotModel (SRCi, SRCi, CONSTANT_PHOTOMETRIC_WEIGHTS, covarFactor, maskVal); 342 # endif 313 343 psSparseMatrixElement (sparse, i, i, f); 314 344 345 # if (HAVE_MODEL_VAR) 315 346 // if we have used CONSTANT errors, then we need to calculate the value of the parameter error 316 347 if (fitVarMode != PM_SOURCE_PHOTFIT_IMAGE_VAR) { … … 320 351 errors->data.F32[i] = 1.0 / sqrt(f); 321 352 } 322 353 # else 354 // the formal error depends on the weighting scheme 355 if (CONSTANT_PHOTOMETRIC_WEIGHTS) { 356 float var = pmSourceModelDotModel (SRCi, SRCi, false, covarFactor, maskVal); 357 errors->data.F32[i] = 1.0 / sqrt(var); 358 } else { 359 errors->data.F32[i] = 1.0 / sqrt(f); 360 } 361 # endif 323 362 324 363 // find the image x model value 364 # if (HAVE_MODEL_VAR) 325 365 f = pmSourceDataDotModel (SRCi, SRCi, fitVarMode, covarFactor, maskVal); 366 # else 367 f = pmSourceDataDotModel (SRCi, SRCi, CONSTANT_PHOTOMETRIC_WEIGHTS, covarFactor, maskVal); 368 # endif 326 369 psSparseVectorElement (sparse, i, f); 327 370 … … 329 372 switch (SKY_FIT_ORDER) { 330 373 case 1: 374 # if (HAVE_MODEL_VAR) 331 375 f = pmSourceModelWeight (SRCi, 1, fitVarMode, covarFactor, maskVal); 332 376 psSparseBorderElementB (border, i, 1, f); 333 377 f = pmSourceModelWeight (SRCi, 2, fitVarMode, covarFactor, maskVal); 334 378 psSparseBorderElementB (border, i, 2, f); 379 # else 380 f = pmSourceModelWeight (SRCi, 1, CONSTANT_PHOTOMETRIC_WEIGHTS, covarFactor, maskVal); 381 psSparseBorderElementB (border, i, 1, f); 382 f = pmSourceModelWeight (SRCi, 2, CONSTANT_PHOTOMETRIC_WEIGHTS, covarFactor, maskVal); 383 psSparseBorderElementB (border, i, 2, f); 384 # endif 335 385 336 386 case 0: 387 # if (HAVE_MODEL_VAR) 337 388 f = pmSourceModelWeight (SRCi, 0, fitVarMode, covarFactor, maskVal); 389 # else 390 f = pmSourceModelWeight (SRCi, 0, CONSTANT_PHOTOMETRIC_WEIGHTS, covarFactor, maskVal); 391 # endif 338 392 psSparseBorderElementB (border, i, 0, f); 339 393 break; … … 355 409 356 410 // got an overlap; calculate cross-product and add to output array 411 # if (HAVE_MODEL_VAR) 357 412 f = pmSourceModelDotModel (SRCi, SRCj, fitVarMode, covarFactor, maskVal); 413 # else 414 f = pmSourceModelDotModel (SRCi, SRCj, CONSTANT_PHOTOMETRIC_WEIGHTS, covarFactor, maskVal); 415 # endif 358 416 psSparseMatrixElement (sparse, j, i, f); 359 417 } … … 393 451 394 452 // set the sky, sky_x, sky_y components of border matrix 453 # if (HAVE_MODEL_VAR) 395 454 SetBorderMatrixElements (border, readout, fitSources, (fitVarMode == PM_SOURCE_PHOTFIT_CONST), SKY_FIT_ORDER, markVal); 455 # else 456 SetBorderMatrixElements (border, readout, fitSources, CONSTANT_PHOTOMETRIC_WEIGHTS, SKY_FIT_ORDER, markVal); 457 # endif 396 458 397 459 psSparseConstraint constraint; … … 552 614 } 553 615 616 # if (HAVE_MODEL_VAR) 554 617 bool psphotModelBackgroundReadout(psImage *model, // Model image 555 618 psImage *modelStdev, // Model stdev image … … 661 724 return true; 662 725 } 726 # endif -
branches/eam_branches/ipp-20120601/psphot/src/psphotReplaceUnfit.c
r32721 r34049 60 60 61 61 psArray *sources = detections->allSources; 62 psAssert (sources, "missing sources?"); 62 //psAssert (sources, "missing sources?"); 63 if (!sources) return true; 63 64 64 65 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) … … 139 140 140 141 psArray *sources = detections->allSources; 141 psAssert (sources, "missing sources?"); 142 142 //psAssert (sources, "missing sources?"); 143 if (!sources) return true; 144 143 145 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 144 146 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels -
branches/eam_branches/ipp-20120601/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/pstamp/scripts
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/psvideophot
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/tools/regpeek.pl
r32419 r34049 3 3 use DBI; 4 4 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 5 use PS::IPP::Config 1.0.1 qw( :standard ); 6 7 my $ipprc = PS::IPP::Config->new(); # IPP Configuration 8 my $siteConfig = $ipprc->{_siteConfig}; 5 9 6 10 my $dbname = 'gpc1'; … … 65 69 66 70 sub init_gpc_db { 71 ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind 67 72 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 68 my $dbserver = 'ippdb01'; 69 my $dbuser = 'ippuser'; 70 my $dbpass = 'ippuser'; 73 #my $dbserver = 'ippdb01'; 74 #my $dbuser = 'ippuser'; 75 #my $dbpass = 'ippuser'; 76 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 77 my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER"); 78 my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD"); 79 die "database configuration not set up" unless defined($dbserver); 80 die "database configuration not set up" unless defined($dbuser); 81 die "database configuration not set up" unless defined($dbpass); 71 82 $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" . 72 83 "mysql_socket=" . DB_SOCKET(), 73 84 ${dbuser},${dbpass}, 74 { RaiseError => 1, AutoCommit => 1}85 { RaiseError => 1, AutoCommit => 1} 75 86 ) or die "Unable to connect to database $DBI::errstr\n"; 76 87 return($db);
Note:
See TracChangeset
for help on using the changeset viewer.
