Changeset 30802
- Timestamp:
- Mar 4, 2011, 1:28:40 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/ppStack/src
- Files:
-
- 2 edited
-
ppStackCombineFinal.c (modified) (1 diff)
-
ppStackSources.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/ppStack/src/ppStackCombineFinal.c
r30620 r30802 59 59 } 60 60 61 // call : ppStackReadoutFinal(config, outRO, readouts, rejected)61 // calls ppStackReadoutFinal(config, outRO, readouts, rejected) in ppStackReadout.c 62 62 psThreadJob *job = psThreadJobAlloc("PPSTACK_FINAL_COMBINE"); // Job to start 63 63 psArrayAdd(job->args, 1, thread); -
branches/eam_branches/ipp-20110213/ppStack/src/ppStackSources.c
r30683 r30802 206 206 } 207 207 208 // XXX this is wrong, or at least inconsistent with the above: this needs to include 209 // a value for the nominal system zero point to be consistent with zpExp 208 210 zp->data.F32[i] = airmassTerm * airmass + 2.5 * log10(exptime); 209 211 } … … 236 238 237 239 if (zpExpNum == numGoodImages) { 240 psLogMsg ("ppStack", PS_LOG_INFO, "all zero points are finite; using reported zero points listed above"); 238 241 for (int i = 0; i < num; i++) { 239 242 zp->data.F32[i] = zpExp->data.F32[i]; 243 } 244 } else { 245 psLogMsg ("ppStack", PS_LOG_INFO, "missing some zero points; using guess values:"); 246 for (int i = 0; i < num; i++) { 247 psLogMsg("ppStack", PS_LOG_INFO, "Image %d: %.2f sec exposure with zero point %.2f", i, options->exposures->data.F32[i], zp->data.F32[i]); 240 248 } 241 249 } … … 265 273 } 266 274 } 267 // M = m + c0 + c1 * airmass - 2.5log(t) + transparency 268 // Want sources to have m corresponding to airmass = 1 and t = sumExpTime and transparency = 0 269 // m_0 + c1 * airmass_0 + 2.5log(t_0) - trans_0 = m_1 + c1 * airmass_1 + 2.5log(t_1) - trans_1 270 // m_0 = m_1 + zp_1 + trans_1 - c1 * airmass_0 - 2.5log(t_0) 271 // We don't need to know the magnitude zero point for the filter, since it cancels out 275 276 // EAM : the discussion here was not quite right (or at least sloppy). Here is a replacement explanation: 277 278 // For any star, the observed instrumental magnitude on an image and the apparent magnitude are related by: 279 // M_app = m_inst + zp + c1 * airmass + 2.5log(t) + transparency 280 281 // we want to adjust the input images to be in a consistent flux system so that the 282 // final stack can be generated with a specific target zero point. Any adjustment to 283 // the flux scale of the image must be made in coordination with the resulting 284 // zeropoint, exposure time, and airmass such that the above relationship yields the 285 // same apparent magnitude for a given star: 286 287 // m_inst_i : instrumental mags on input image (in) 288 // m_inst_o : instrumental mags on re-normalized image (out) 289 290 // m_inst_o + zp_o + c1 * airmass_o + 2.5log(t_o) + trans_o = m_inst_i + zp_i + c1 * airmass_i + 2.5log(t_i) + trans_i 291 292 // m_inst_o = m_inst_i + (zp_i - zp_o) + c1 * (airmass_i - airmass_o) + 2.5log(t_i) - 2.5log(t_o) + trans_i - trans_o 293 294 // zp_i, airmass_i, t_i, trans_i : reported or measured for input image 295 296 // zp_o = zpTarget (from recipe) 297 // airmass_o = airmassTarget (from recipe) 298 // t_o = sumExpTime [sum of input exposure times: once images are scale to this time, they can be avereaged] 299 // trans_o = 0.0 [obviously!] 300 301 // we have 2 cases: (a) all reported ZPs are good or (b) some are bad: 302 // (a) FPA.ZP = zp_i + c1 * airmass_i 303 // --> zp[i] = zp_i + c1 * airmass_i + 2.5log(exptime_i) 304 // (b) zp[i] = c1 * airmass_i + 2.5log(exptime_i) 305 // NOTE: in case (b), the current code is equating the TARGET zp with the NOMINAL zp, which is wrong. 306 307 // m_inst_o - m_inst_i = zp[i] - zpTarget - c1 * airmassTarget - 2.5log(sumExpTime) + trans_i 308 272 309 if (options->matchZPs) { 273 310 options->norm = psVectorAlloc(num, PS_TYPE_F32); … … 278 315 psArray *sources = sourceLists->data[i]; // Sources of interest 279 316 float magCorr = zp->data.F32[i] - trans->data.F32[i] - 2.5*log10(options->sumExposure); 280 if (zpExpNum == numGoodImages) { 317 if (zpExpNum == numGoodImages) { // case (a) 281 318 // Using measured zero points, so attempt to set target zero point 319 // XXX see NOTE above regarding case (b) : this is wrong. the code should load a nominal zero point and supply it above 320 // 282 321 magCorr -= zpTarget; 283 322 }
Note:
See TracChangeset
for help on using the changeset viewer.
