IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2010, 9:12:53 AM (16 years ago)
Author:
Paul Price
Message:

Pulling r27400 out of the trunk until it can be developed further (compression, make optional). Development will continue on branches/pap_stack/

File:
1 edited

Legend:

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

    r27400 r27402  
    6464
    6565    if (!options->matchZPs && !options->photometry) {
    66         options->norm = psVectorAlloc(options->num, PS_TYPE_F32);
    67         psVectorInit(options->norm, 0.0);
     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
    6873        return true;
    6974    }
     
    132137    }
    133138
    134     int num = options->num;            // Number of inputs
     139    int num = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
    135140    psAssert(num == sourceLists->n, "Wrong number of source lists: %ld\n", sourceLists->n);
    136141
     
    141146    float airmassTerm = NAN;            // Airmass term
    142147    float zpTarget = NAN;               // Target zero point
     148    float sumExpTime = 0.0;             // Sum of the exposure time
    143149    int numGoodImages = 0;              // Number of good images
    144150    for (int i = 0; i < num; i++) {
     
    154160
    155161        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest
     162        pmCell *cell = pmFPAviewThisCell(view, file->fpa); // Cell of interest
    156163
    157164#if defined(TESTING) && 0
     
    170177#endif
    171178
    172         float exptime = options->exposures->data.F32[i]; // Exposure time
     179        float exptime = psMetadataLookupF32(NULL, cell->concepts, "CELL.EXPOSURE"); // Exposure time
    173180        float airmass = psMetadataLookupF32(NULL, file->fpa->concepts, "FPA.AIRMASS"); // Airmass
    174181        const char *expFilter = psMetadataLookupStr(NULL, file->fpa->concepts, "FPA.FILTER"); // Filter name
     
    214221
    215222        zp->data.F32[i] = airmassTerm * airmass + 2.5 * log10(exptime);
    216     }
     223        sumExpTime += exptime;
     224
     225    }
     226
     227    options->sumExposure = sumExpTime;
    217228
    218229    if (numGoodImages == 0) {
     
    280291                }
    281292                psArray *sources = sourceLists->data[i]; // Sources of interest
    282                 float magCorr = zp->data.F32[i] + trans->data.F32[i] - 2.5*log10(options->sumExposure);
     293                float magCorr = zp->data.F32[i] + trans->data.F32[i] - 2.5*log10(sumExpTime);
    283294                if (zpExpNum == numGoodImages) {
    284295                    // Using measured zero points, so attempt to set target zero point
Note: See TracChangeset for help on using the changeset viewer.