IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35081 for trunk/ppImage


Ignore:
Timestamp:
Feb 1, 2013, 5:01:08 PM (13 years ago)
Author:
watersc1
Message:

Merging changes that implement FPA level background continuity.

Location:
trunk/ppImage/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/Makefile.am

    r33590 r35081  
    4444        ppImageRebinReadout.c \
    4545        ppImageMosaic.c \
     46        ppImageMosaicBackground.c \
    4647        ppImageMaskStats.c \
    4748        ppImagePhotom.c \
  • trunk/ppImage/src/ppImage.h

    r33848 r35081  
    4141    bool doPatternCell;                 // Cell pattern correction
    4242    bool doPatternContinuity;           // Cell continuity correction
     43    bool doBackgroundContinuity;        // Do mosaic continuity correction
    4344    bool doFringe;                      // Fringe subtraction
    4445    bool doPhotom;                      // Source identification and photometry
     
    5051    bool checkNoise;                    // measure cell-level variance
    5152    bool applyParity;                   // Apply Cell parities
    52 
    53   bool doMaskStats;                      // Calculate mask statistics
     53    bool doMaskStats;                   // Calculate mask statistics
    5454 
    5555    bool doCrosstalkMeasure;            // measure crosstalk signal
     
    183183bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options);
    184184
     185// Do background continuity step
     186bool ppImageMosaicBackground(pmConfig *config, const ppImageOptions *options);
     187
    185188// Record which detrend file was used for the detrending
    186189bool ppImageDetrendRecord(
  • trunk/ppImage/src/ppImageLoop.c

    r33590 r35081  
    4141        ESCAPE("load failure for FPA");
    4242    }
    43 
     43   
    4444    pmChip *chip;                       // Chip from FPA
    4545    while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) {
     
    233233            ESCAPE("Unable to bin chip (level 2).");
    234234        }
    235 
     235        if (options->doBackgroundContinuity) {
     236          pmFPAfile *out = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.BACKMDL");
     237          pmFPAfileCopyView(out->fpa,out->src,view);
     238        }
    236239        // Close cells (XXX shouldn't pmFPAfileClose iterate down as needed?)
    237240        view->cell = -1;
     
    251254    }
    252255
     256    // Do background model continuity updates
     257    if (!ppImageMosaicBackground(config, options )) {
     258      ESCAPE("failure in Background Mosaic");
     259    }
     260   
    253261    // generate the full-scale FPA mosaic
    254262    if (!ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1")) {
  • trunk/ppImage/src/ppImageOptions.c

    r33848 r35081  
    3535    options->doPatternCell   = false;   // Cell pattern correction
    3636    options->doPatternContinuity = false; // Cell continuity correction
     37    options->doBackgroundContinuity = false; // Chip level background continuity correction
    3738    options->doFringe        = false;   // Fringe subtraction
    3839    options->doPhotom        = false;   // Source identification and photometry
     
    429430    }
    430431
     432    // Option to enable the background continuity
     433    options->doBackgroundContinuity = psMetadataLookupBool(NULL, recipe, "BACKGROUND.CONTINUITY");
     434
    431435
    432436    // Remnance options
  • trunk/ppImage/src/ppImageParseCamera.c

    r33848 r35081  
    303303    }
    304304
     305
    305306    // chipImage    -> psphotInput  (pmFPAfileDefineFromFile)       : fpa is constructed
    306307    // psphotInput  -> psphotOutput (pmFPAfileDefineOutputFromFile) : fpa is equated
     
    387388    // the input data is the same as the outImage data : force the free levels to match
    388389    input->freeLevel = PS_MIN(outImage->freeLevel, input->freeLevel);
     390
     391    // define the continuity corrected background model files
     392    if (options->doBackgroundContinuity) {
     393      pmFPAfile *bkgMosaicModel = pmFPAfileDefineFromFPA(config,input->fpa, 1, 1,  "PPIMAGE.BACKMDL");
     394      if (!bkgMosaicModel) {
     395        psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BACKMDL"));
     396        psFree(options);
     397        return NULL;
     398      }
     399      if (bkgMosaicModel->type != PM_FPA_FILE_IMAGE) {
     400        psError(PS_ERR_IO, true, "PPIMAGE.BACKMDL is not of type IMAGE");
     401        psFree(options);
     402        return NULL;
     403
     404      }
     405      bkgMosaicModel->save = options->doBackgroundContinuity;
     406      //      bkgMosaicModel->freeLevel = PS_MIN(bkgMosaicModel->freeLevel, PM_FPA_LEVEL_FPA);
     407      bkgMosaicModel->freeLevel = PM_FPA_LEVEL_FPA;
     408      bkgMosaicModel->dataLevel = bkgMosaicModel->dataLevel;
     409      bkgMosaicModel->fileLevel = PS_MIN(bkgMosaicModel->fileLevel, bkgMosaicModel->dataLevel);
     410    }
    389411
    390412    // define the binned target files (which may just be carriers for some camera configurations)
     
    497519        chipVariance->save = false;
    498520    }
    499 
     521   
    500522    if (psTraceGetLevel("ppImage.config") > 0) {
    501523        // Get a look inside all the files.
Note: See TracChangeset for help on using the changeset viewer.