Changeset 33951 for branches/eam_branches/ipp-20120405/psModules
- Timestamp:
- May 29, 2012, 5:09:48 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/psModules
- Files:
-
- 8 edited
-
. (modified) (1 prop)
-
src/camera/pmFPAfile.c (modified) (1 diff)
-
src/camera/pmFPAfile.h (modified) (1 diff)
-
src/detrend/pmDetrendDB.c (modified) (1 diff)
-
src/detrend/pmDetrendDB.h (modified) (1 diff)
-
src/objects/pmSource.c (modified) (3 diffs)
-
src/objects/pmSource.h (modified) (2 diffs)
-
src/objects/pmSourceMoments.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/psModules
- Property svn:mergeinfo changed
/trunk/psModules (added) merged: 33838,33848,33879,33913
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120405/psModules/src/camera/pmFPAfile.c
r33690 r33951 382 382 // Number of the file in list 383 383 psString num = NULL; // Number to use 384 psStringAppend(&num, "% 03d", file->fileID);384 psStringAppend(&num, "%" PRId64, file->fileID); 385 385 psStringSubstitute(&newRule, num, "{FILE.ID}"); 386 386 psFree(num); -
branches/eam_branches/ipp-20120405/psModules/src/camera/pmFPAfile.h
r33690 r33951 114 114 115 115 int fileIndex; // Index of file 116 int fileID;// internal sequence number116 psS64 fileID; // internal sequence number 117 117 118 118 psS64 imageId, sourceId; // Image and source identifiers -
branches/eam_branches/ipp-20120405/psModules/src/detrend/pmDetrendDB.c
r31067 r33951 107 107 DETREND_STRING_CASE(ASTROM); 108 108 DETREND_STRING_CASE(NOISEMAP); 109 DETREND_STRING_CASE(VIDEOMASK); 110 DETREND_STRING_CASE(VIDEODARK); 109 111 DETREND_STRING_CASE(LINEARITY); 110 112 default: -
branches/eam_branches/ipp-20120405/psModules/src/detrend/pmDetrendDB.h
r29833 r33951 36 36 PM_DETREND_TYPE_ASTROM, 37 37 PM_DETREND_TYPE_NOISEMAP, 38 PM_DETREND_TYPE_VIDEOMASK, 39 PM_DETREND_TYPE_VIDEODARK, 38 40 PM_DETREND_TYPE_LINEARITY, 39 41 } pmDetrendType; -
branches/eam_branches/ipp-20120405/psModules/src/objects/pmSource.c
r33947 r33951 39 39 #include "pmSourceExtendedPars.h" 40 40 #include "pmSourceDiffStats.h" 41 #include "pmSourcePhotometry.h" 41 42 #include "pmSource.h" 42 43 … … 163 164 source->radialAper = NULL; 164 165 source->parent = NULL; 166 source->tmpPtr = NULL; 165 167 source->imageID = -1; 166 168 source->nFrames = 0; … … 1170 1172 PAR[PM_PAR_SYY] = oldshape.sy; 1171 1173 PAR[PM_PAR_SXY] = oldshape.sxy; 1174 1175 return true; 1176 } 1177 1178 bool pmSourceSmoothOp (pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy) 1179 { 1180 // assert (mode & PM_MODEL_OP_NOISE); 1181 PS_ASSERT_PTR_NON_NULL(source, false); 1182 PS_ASSERT_PTR_NON_NULL(source->peak, false); 1183 PS_ASSERT_PTR_NON_NULL(target, false); 1184 1185 if (add) { 1186 psTrace ("psphot", 3, "adding smoothed object at %f,%f\n", source->peak->xf, source->peak->yf); 1187 } else { 1188 psTrace ("psphot", 3, "removing smooted object at %f,%f\n", source->peak->xf, source->peak->yf); 1189 } 1190 1191 pmModel *model = pmSourceGetModel(NULL, source); 1192 if (!model) { 1193 return false; 1194 } 1195 pmSourceSmoothOpModel (model, source, mode, target, sigma, add, maskVal, dx, dy); 1196 1197 return true; 1198 } 1199 1200 bool pmSourceSmoothOpModel (pmModel *model, pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy) 1201 { 1202 bool status; 1203 psEllipseShape oldshape; 1204 psEllipseShape newshape; 1205 psEllipseAxes axes; 1206 1207 if (add) { 1208 psTrace ("psphot", 4, "adding smoothed object at %f,%f\n", model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS]); 1209 } else { 1210 psTrace ("psphot", 4, "removing smoothed object at %f,%f\n", model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS]); 1211 } 1212 1213 psF32 *PAR = model->params->data.F32; 1214 1215 // Isn't this hanging around somewhere? 1216 float oldFlux = NAN; 1217 if (!pmSourcePhotometryModel (NULL, &oldFlux, model)) return false; 1218 1219 // save original values 1220 float oldI0 = PAR[PM_PAR_I0]; 1221 float oldsxx = PAR[PM_PAR_SXX]; 1222 float oldsyy = PAR[PM_PAR_SYY]; 1223 float oldsxy = PAR[PM_PAR_SXY]; 1224 1225 // Since we are going to scale the flux correctly we need to get our 1226 // factors of sqrt(2) right 1227 oldshape.sx = oldsxx / M_SQRT2; 1228 oldshape.sy = oldsyy / M_SQRT2; 1229 oldshape.sxy = oldsxy; 1230 1231 // XXX can this be done more intelligently? 1232 if (oldI0 == 0.0) return false; 1233 if (!isfinite(oldI0)) return false; 1234 1235 // increase size and height of source 1236 axes = psEllipseShapeToAxes (oldshape, 20.0); 1237 axes.major = sqrt(PS_SQR(axes.major) + PS_SQR(sigma)); 1238 axes.minor = sqrt(PS_SQR(axes.minor) + PS_SQR(sigma)); 1239 newshape = psEllipseAxesToShape (axes); 1240 PAR[PM_PAR_SXX] = newshape.sx * M_SQRT2; 1241 PAR[PM_PAR_SYY] = newshape.sy * M_SQRT2; 1242 PAR[PM_PAR_SXY] = newshape.sxy; 1243 1244 PAR[PM_PAR_I0] = 1.0; 1245 1246 float newFlux; 1247 if (!pmSourcePhotometryModel (NULL, &newFlux, model)) return false; 1248 1249 PAR[PM_PAR_I0] = oldFlux / newFlux; 1250 1251 if (add) { 1252 status = pmModelAddWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy); 1253 } else { 1254 status = pmModelSubWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy); 1255 } 1256 1257 // restore original values 1258 PAR[PM_PAR_I0] = oldI0; 1259 PAR[PM_PAR_SXX] = oldsxx; 1260 PAR[PM_PAR_SYY] = oldsyy; 1261 PAR[PM_PAR_SXY] = oldsxy; 1172 1262 1173 1263 return true; -
branches/eam_branches/ipp-20120405/psModules/src/objects/pmSource.h
r33947 r33951 118 118 psArray *radialAper; ///< radial flux in circular apertures 119 119 pmSource *parent; ///< reference to the master source from which this is derived 120 psPtr *tmpPtr; ///< pointer that may be used to store data in a particular module. e.g. psphotKronIterate. 120 121 int imageID; 121 122 psU16 nFrames; … … 303 304 bool pmSourceNoiseOp (pmSource *source, pmModelOpMode mode, float FACTOR, float SIZE, bool add, psImageMaskType maskVal, int dx, int dy); 304 305 306 bool pmSourceSmoothOp (pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy); 307 bool pmSourceSmoothOpModel (pmModel *model, pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy); 308 305 309 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psImageMaskType maskVal, int dx, int dy); 306 310 bool pmSourceCacheModel (pmSource *source, psImageMaskType maskVal); -
branches/eam_branches/ipp-20120405/psModules/src/objects/pmSourceMoments.c
r32347 r33951 319 319 } 320 320 321 source->moments->Mrf = RF/RS;322 321 source->moments->Mrh = RH/RS; 323 322 324 // if Mrf (first radial moment) is very small, we are getting into low-significance323 // if Mrf = RF/RS (first radial moment) is very small, we are getting into low-significance 325 324 // territory. saturate at minKronRadius. conversely, if Mrf is >> radius for faint 326 325 // sources, we are clearly making an error. saturate at radius. 327 float kronRefRadius = MAX(minKronRadius, source->moments->Mrf);326 float kronRefRadius = MAX(minKronRadius, RF/RS); 328 327 if (source->moments->SN < 10) { 329 328 kronRefRadius = MIN(radius, kronRefRadius); 330 329 } 330 source->moments->Mrf = kronRefRadius; 331 331 332 332 // *** now calculate the kron flux values using the 1st radial moment
Note:
See TracChangeset
for help on using the changeset viewer.
