IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30802


Ignore:
Timestamp:
Mar 4, 2011, 1:28:40 PM (15 years ago)
Author:
eugene
Message:

add some comments to clarify the re-normalization process

Location:
branches/eam_branches/ipp-20110213/ppStack/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/ppStack/src/ppStackCombineFinal.c

    r30620 r30802  
    5959        }
    6060
    61         // call: ppStackReadoutFinal(config, outRO, readouts, rejected)
     61        // calls ppStackReadoutFinal(config, outRO, readouts, rejected) in ppStackReadout.c
    6262        psThreadJob *job = psThreadJobAlloc("PPSTACK_FINAL_COMBINE"); // Job to start
    6363        psArrayAdd(job->args, 1, thread);
  • branches/eam_branches/ipp-20110213/ppStack/src/ppStackSources.c

    r30683 r30802  
    206206        }
    207207
     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
    208210        zp->data.F32[i] = airmassTerm * airmass + 2.5 * log10(exptime);
    209211    }
     
    236238
    237239    if (zpExpNum == numGoodImages) {
     240        psLogMsg ("ppStack", PS_LOG_INFO, "all zero points are finite; using reported zero points listed above");
    238241        for (int i = 0; i < num; i++) {
    239242            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]);
    240248        }
    241249    }
     
    265273            }
    266274        }
    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
    272309        if (options->matchZPs) {
    273310            options->norm = psVectorAlloc(num, PS_TYPE_F32);
     
    278315                psArray *sources = sourceLists->data[i]; // Sources of interest
    279316                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)
    281318                    // 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                    //
    282321                    magCorr -= zpTarget;
    283322                }
Note: See TracChangeset for help on using the changeset viewer.