IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 9, 2020, 11:51:42 AM (6 years ago)
Author:
eugene
Message:

consolidate sky flux calculation and report in output cmf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimInsertStars.c

    r36868 r41331  
    4141    }
    4242
    43     float skyRate = psMetadataLookupF32(NULL, recipe, "SKY.RATE"); // Sky rate
    44     if (isnan(skyRate)) {
    45         float zp      = psMetadataLookupF32(&mdok, recipe, "ZEROPOINT"); assert (mdok);
    46         float scale   = psMetadataLookupF32(&mdok, recipe, "PIXEL.SCALE");     assert (mdok);
    47         float skyMags = psMetadataLookupF32(&mdok, recipe, "SKY.MAGS");  assert (mdok);
    48         skyRate = scale * scale * ppSimMagToFlux (skyMags, zp);
    49     }
     43    float skyRate = ppSimGetSkyRate (recipe);
    5044
    5145    // Rough noise estimate, appropriate for entire cell (use for source radius?)
    5246    float roughNoise = sqrtf(PS_SQR(readnoise) + (darkRate + skyRate) * expTime);
     47    float skyFlux = skyRate*expTime;
    5348
    5449    int x0Chip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0");
     
    165160        fprintf (outfile, "%8.3f %8.3f %10.5f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f  :  %f %f\n", star->x, star->y, starFlux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8, model->params->data.F32[PM_PAR_I0], radius);
    166161
     162        // save the approx sky (exact if sky is flat) for external comparisons
     163        source->sky = skyFlux;
     164
    167165        // add the sources to the source array
    168166        psArrayAdd (sources, 100,source);
Note: See TracChangeset for help on using the changeset viewer.