IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28423


Ignore:
Timestamp:
Jun 22, 2010, 1:43:44 PM (16 years ago)
Author:
rhenders
Message:

Now calculating and storing total detections for an exposure and saving it so we can log it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/ippToPspsBatchDetection.c

    r28305 r28423  
    1313#include "fitsio.h"
    1414
    15 // Gets flux from magnitude
     15// Gets uncalibrated instrumental flux from magnitude
    1616static __inline bool ippToPsps_getFlux(const float zeroPoint, const float exposureTime, const float magnitude, float* flux) {
    1717
    18     // use uncalibrated instrumental flux
    1918    *flux = powf(10.0, -0.4*magnitude) / exposureTime;
    20 
    21     // use calibrated flux in Janskys, where 3631 Jy is the zero point flux for the filter: constant over all filters because we're using AB magnitudes
    22     //float flux = 3631 * powf(10.0, -0.4*(magnitude + zeroPoint)) / exposureTime;
    23 
    24     //    printf("mag=%f\texpTime=%f\tzeroPoint=%f\tflux=%f\n", magnitude, exposureTime, zeroPoint, flux);
    2519    return (!isfinite(*flux) || *flux < 0.000001) ? false : true;
    2620}
     
    163157    uint32_t numInvalidFlux;
    164158    long numDetectionsOut;
     159    long totalDetectionsOut = 0;
    165160    long removeList[MAXDETECT];
    166161    long thisObjId;
     
    365360                    extensionName, nDet, numDetectionsOut, unmatched, numOfDuplicates, numInvalidFlux);
    366361
     362            totalDetectionsOut += numDetectionsOut;
     363
    367364            if (dvoDetections!= NULL) dvoFree(dvoDetections);
    368365            SkyListFree(skylist);
    369366        }
    370367    }
     368
     369    psLogMsg("ippToPsps", PS_LOG_INFO, "Total detections for this exposure = %ld\n", totalDetectionsOut);
    371370
    372371    for (uint32_t i=0; i<MAXDETECT;i++) free(assocDate[i]);
     
    390389        if (fprintf(this->resultsFile, "%ld\n", maxObjID) < 1 )
    391390            psError(PS_ERR_IO, false, "Unable to write max Object ID to'%s'\n", this->resultsPath);
     391        if (fprintf(this->resultsFile, "%ld\n", totalDetectionsOut) < 1 )
     392            psError(PS_ERR_IO, false, "Unable to write totalDetectionsOut to'%s'\n", this->resultsPath);
    392393    }
    393394
Note: See TracChangeset for help on using the changeset viewer.