IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 11, 2012, 2:04:31 PM (13 years ago)
Author:
watersc1
Message:

Merge from my branch including background restoration and stack stage projection cell binned images.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ppStack/src/ppStackCamera.c

    r30620 r34800  
    156156            psString psf = psMetadataLookupStr(&mdok, input, "PSF"); // Name of PSF
    157157            psString sources = psMetadataLookupStr(&mdok, input, "SOURCES"); // Name of sources
    158 
     158            psString bkgmodel = psMetadataLookupStr(&mdok, input, "BKGMODEL"); // Name of warped background model
     159           
    159160            pmFPAfile *imageFile = defineFile(config, NULL, "PPSTACK.INPUT",
    160161                                              image, PM_FPA_FILE_IMAGE); // File for image
     
    215216            }
    216217
     218            // Grab bkgmodel information here
     219            if (!bkgmodel ||  strlen(bkgmodel) == 0) {
     220              // We have no background models.
     221            }
     222            else {
     223              pmFPAfile *inputBKG = defineFile(config,NULL,"PPSTACK.INPUT.BKGMODEL",bkgmodel,
     224                                               PM_FPA_FILE_IMAGE);
     225              if (!inputBKG) {
     226                psError(psErrorCodeLast(), false,
     227                        "Unable to define file from bkgmodel %d (%s)",i,bkgmodel);
     228                return(false);
     229              }
     230            }// End bkgmodel
     231
     232
     233           
     234           
    217235            i++;
    218236        }
     
    460478    jpeg2->save = true;
    461479
     480    // Output background
     481    pmFPAfile *outBkg = pmFPAfileDefineOutput(config,NULL,"PPSTACK.OUTPUT.BKGMODEL");
     482    if (!outBkg) {
     483      psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.BKGMODEL"));
     484      return(false);
     485    }
     486    if (outBkg->type != PM_FPA_FILE_IMAGE) {
     487      psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.BKGMODEL is not of type IMAGE");
     488      return(false);
     489    }
     490    outBkg->save = true;
     491    pmFPAfile *outBkgRest = pmFPAfileDefineOutput(config,NULL,"PPSTACK.OUTPUT.BKGREST");
     492    if (!outBkgRest) {
     493      psError(psErrorCodeLast(), false, _("Unable to generate output file from PPSTACK.OUTPUT.BKGREST"));
     494      return(false);
     495    }
     496    if (outBkgRest->type != PM_FPA_FILE_IMAGE) {
     497      psError(PPSTACK_ERR_CONFIG, true, "PPSTACK.OUTPUT.BKGREST is not of type IMAGE");
     498      return(false);
     499    }
     500   
    462501    // For photometry, we operate on the chip-mosaicked image
    463502    // we create a copy of the mosaicked image for psphot so we can write out a clean image
     
    496535    }
    497536
     537    // Define output file here.
     538   
    498539    return true;
    499540}
Note: See TracChangeset for help on using the changeset viewer.