IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 10, 2008, 10:54:53 AM (18 years ago)
Author:
Paul Price
Message:

Turn off convolution if PSFs not provided.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCamera.c

    r17257 r17426  
    7272{
    7373    bool haveWeights = false;           // Do we have weight maps?
     74    bool havePSF = false;               // Do we have PSFs?
    7475
    7576    psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info
     
    169170        // Add the psf file
    170171        if (!psf || strlen(psf) == 0) {
    171             psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSF %d", i);
    172             return false;
     172            if (havePSFs) {
     173                psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSF %d", i);
     174                return false;
     175            }
    173176        } else {
    174             psArray *psfFiles = psArrayAlloc(1); // Array of filenames for this FPA
    175             psfFiles->data[0] = psMemIncrRefCounter(psf);
    176             psMetadataAddArray(config->arguments, PS_LIST_TAIL, "PSF.FILENAMES", PS_META_REPLACE,
    177                                "Filenames of PSF files", psfFiles);
    178             psFree(psfFiles);
    179 
    180             bool status;
    181             pmFPAfile *psfFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPSTACK.INPUT.PSF",
    182                                                        "PSF.FILENAMES");
    183             if (!status) {
    184                 psError(PS_ERR_UNKNOWN, false, "Unable to define file from psf %d (%s)", i, psf);
    185                 return false;
    186             }
    187             if (psfFile->type != PM_FPA_FILE_PSF) {
    188                 psError(PS_ERR_IO, true, "PPSTACK.INPUT.PSF is not of type PSF");
    189                 return false;
     177            if (!havePSFs && i != 0) {
     178                psWarning("PSF not provided for all inputs --- ignoring.");
     179            } else {
     180                psArray *psfFiles = psArrayAlloc(1); // Array of filenames for this FPA
     181                psfFiles->data[0] = psMemIncrRefCounter(psf);
     182                psMetadataAddArray(config->arguments, PS_LIST_TAIL, "PSF.FILENAMES", PS_META_REPLACE,
     183                                   "Filenames of PSF files", psfFiles);
     184                psFree(psfFiles);
     185
     186                bool status;
     187                pmFPAfile *psfFile = pmFPAfileBindFromArgs(&status, imageFile, config, "PPSTACK.INPUT.PSF",
     188                                                           "PSF.FILENAMES");
     189                if (!status) {
     190                    psError(PS_ERR_UNKNOWN, false, "Unable to define file from psf %d (%s)", i, psf);
     191                    return false;
     192                }
     193                if (psfFile->type != PM_FPA_FILE_PSF) {
     194                    psError(PS_ERR_IO, true, "PPSTACK.INPUT.PSF is not of type PSF");
     195                    return false;
     196                }
     197                havePSFs = true;
    190198            }
    191199        }
     
    233241
    234242    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", i);
     243    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.PSF", 0, "Have PSFs available?", havePSFs);
    235244
    236245    // Output image
Note: See TracChangeset for help on using the changeset viewer.