IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 19, 2007, 4:21:10 PM (19 years ago)
Author:
eugene
Message:

convert ppSimLoop to use pmReadout, loading psf model, add sources based on psf model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070817/ppSim/src/ppSimLoop.c

    r14531 r14547  
    3131    // load any needed files (eg, input image, PSF)
    3232    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    33         psError(PSPHOT_ERR_DATA, false, "failed IO for fpa in ppSim\n");
     33        psError(PS_ERR_UNKNOWN, false, "failed IO for fpa in ppSim\n");
    3434        psFree(view);
    3535        return false;
     
    4343        // load any needed files (eg, input image, PSF)
    4444        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
    45             psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d in ppSim\n", view->chip);
     45            psError(PS_ERR_UNKNOWN, false, "failed IO for chip %d in ppSim\n", view->chip);
    4646            psFree (view);
    4747            return false;
    4848        }
    4949
    50         pmPSF *psf = NULL;
     50        // XXX check for a supplied PSF, otherwise generate a basic one
    5151        if (type == PPSIM_TYPE_OBJECT) {
    52             psf = ppSimSetPSF (config);
     52            // XXX TBD : ppSimSetPSF (chip, config);
    5353        }
    5454
     
    7474
    7575                // TO DO: Decide if cell is to be windowed, reduce numCols, numRows appropriately
    76                 psImage *signal = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Signal in pixels
    77                 psImage *variance = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Noise in pixels
     76                readout->image = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Signal in pixels
     77                readout->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Noise in pixels
    7878
    7979                psImage *expCorr = NULL; // Exposure correction per pixel, for adding objects
     
    8282                }
    8383
    84                 psVector *biasRows = ppSimMakeBias (signal, variance, cell, config, rng);
     84                psVector *biasRows = ppSimMakeBias (readout, config, rng);
    8585                if (type == PPSIM_TYPE_BIAS) goto done;
    8686               
    87                 ppSimMakeDark (signal, variance, config);
     87                ppSimMakeDark (readout, config);
    8888                if (type == PPSIM_TYPE_DARK) goto done;
    8989
    90                 ppSimMakeSky (signal, variance, expCorr, type, config, fpa, chip, cell);
     90                ppSimMakeSky (readout, expCorr, type, config);
    9191                if (type == PPSIM_TYPE_FLAT) goto done;
    9292
     93                // if (type == PPSIM_TYPE_OBJECT) {
     94                // ppSimInsertStars (readout, expCorr, stars, config, chip, cell);
     95                // }
     96
    9397                if (type == PPSIM_TYPE_OBJECT) {
    94                     ppSimInsertStars (signal, variance, expCorr, stars, config, chip, cell);
     98                    ppSimInsertSources (readout, expCorr, stars, config);
    9599                }
    96100
    97101            done:
    98                 ppSimAddNoise(signal, variance, config, cell, rng);
    99                 ppSimSaturate(signal, config, cell);
    100 
    101                 readout->image = signal;
    102                 psFree(variance);
    103                 psFree(expCorr);
     102                ppSimAddNoise(readout->image, readout->weight, cell, config, rng);
     103                ppSimSaturate(readout, config);
    104104
    105105                ppSimAddOverscan (readout, config, biasCols, biasRows, rng);
Note: See TracChangeset for help on using the changeset viewer.