IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 22, 2010, 8:34:28 PM (16 years ago)
Author:
Paul Price
Message:

Adding exposure map (both exposure time and number of inputs) to the outputs of ppStack. These are calculated both for the regular (convolved) and unconvolved stacks. These should compress pretty well, but I haven't enabled the compression yet. I also plan to add a weighted exposure time output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackSources.c

    r27329 r27400  
    6464
    6565    if (!options->matchZPs && !options->photometry) {
    66         int num = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
    67         options->norm = psVectorAlloc(num, PS_TYPE_F32);
    68         psVectorInit (options->norm, 0.0);
    69 
    70         // XXX do I need to set this?
    71         // options->sumExposure = sumExpTime;
    72 
     66        options->norm = psVectorAlloc(options->num, PS_TYPE_F32);
     67        psVectorInit(options->norm, 0.0);
    7368        return true;
    7469    }
     
    137132    }
    138133
    139     int num = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
     134    int num = options->num;            // Number of inputs
    140135    psAssert(num == sourceLists->n, "Wrong number of source lists: %ld\n", sourceLists->n);
    141136
     
    146141    float airmassTerm = NAN;            // Airmass term
    147142    float zpTarget = NAN;               // Target zero point
    148     float sumExpTime = 0.0;             // Sum of the exposure time
    149143    int numGoodImages = 0;              // Number of good images
    150144    for (int i = 0; i < num; i++) {
     
    160154
    161155        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest
    162         pmCell *cell = pmFPAviewThisCell(view, file->fpa); // Cell of interest
    163156
    164157#if defined(TESTING) && 0
     
    177170#endif
    178171
    179         float exptime = psMetadataLookupF32(NULL, cell->concepts, "CELL.EXPOSURE"); // Exposure time
     172        float exptime = options->exposures->data.F32[i]; // Exposure time
    180173        float airmass = psMetadataLookupF32(NULL, file->fpa->concepts, "FPA.AIRMASS"); // Airmass
    181174        const char *expFilter = psMetadataLookupStr(NULL, file->fpa->concepts, "FPA.FILTER"); // Filter name
     
    221214
    222215        zp->data.F32[i] = airmassTerm * airmass + 2.5 * log10(exptime);
    223         sumExpTime += exptime;
    224 
    225     }
    226 
    227     options->sumExposure = sumExpTime;
     216    }
    228217
    229218    if (numGoodImages == 0) {
     
    291280                }
    292281                psArray *sources = sourceLists->data[i]; // Sources of interest
    293                 float magCorr = zp->data.F32[i] + trans->data.F32[i] - 2.5*log10(sumExpTime);
     282                float magCorr = zp->data.F32[i] + trans->data.F32[i] - 2.5*log10(options->sumExposure);
    294283                if (zpExpNum == numGoodImages) {
    295284                    // Using measured zero points, so attempt to set target zero point
Note: See TracChangeset for help on using the changeset viewer.