IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 1, 2010, 2:09:14 PM (16 years ago)
Author:
rhenders
Message:

Fixed bug reporting no input files incorrectly; put getFlux function here for general use

File:
1 edited

Legend:

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

    r29198 r29294  
    2424extern int ippToPsps_batchDifference(IppToPsps *data);
    2525
     26// Gets uncalibrated instrumental flux from magnitude
     27__inline bool ippToPsps_getFlux(const float exposureTime, const float magnitude, float* flux, const float magnitudeErr, float* fluxErr) {
     28
     29    *flux = powf(10.0, -0.4*magnitude) / exposureTime;
     30    if (!isfinite(*flux) || *flux < 0.000001) return false;
     31    if (fluxErr) *fluxErr = fabsf((magnitudeErr * *flux)/1.085736);
     32      if (fluxErr)    printf("Mag = %03.03f, Flux = %03.03f, Mag err = %03.03f, Flux Err = %03.03f\n", magnitude, *flux, magnitudeErr, *fluxErr);
     33
     34    return true;
     35}
     36
    2637// Destructor
    2738static void ippToPsps_Destructor(IppToPsps* this) {
     
    5566    // save XML document for results
    5667    if (this->resultsXmlDoc) {
    57    
     68
    5869        xmlSaveFormatFileEnc(this->resultsPath, this->resultsXmlDoc, "UTF-8", 1);
    5970
     
    215226            this->batchType == BATCH_STACK ||
    216227            this->batchType == BATCH_DIFFERENCE ) {
    217    
    218         if (this->numOfInputFiles < 1) this->exitCode = PS_EXIT_DATA_ERROR;
    219         psError(PS_ERR_UNKNOWN, false, "No input files for this batch");
     228
     229        if (this->numOfInputFiles < 1) {
     230
     231            this->exitCode = PS_EXIT_DATA_ERROR;
     232            psError(PS_ERR_UNKNOWN, false, "No input files for this batch");
     233        }
    220234
    221235    }
Note: See TracChangeset for help on using the changeset viewer.