IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2008, 2:48:45 PM (18 years ago)
Author:
Paul Price
Message:

Using new function psphotReadoutFindPSF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r19874 r20115  
    77// Lists must end with a NULL
    88static char *detectorFiles[] = { "PSWARP.INPUT", "PSWARP.MASK", "PSWARP.WEIGHT", NULL };
    9 static char *skycellFiles[] = { "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.WEIGHT",
    10                                 "PSPHOT.OUTPUT", "PSPHOT.RESID", "PSPHOT.BACKMDL", "PSPHOT.BACKMDL.STDEV",
    11                                 "PSPHOT.BACKGND", "PSPHOT.BACKSUB", "PSPHOT.PSF.SAVE", "SOURCE.PLOT.MOMENTS",
    12                                 "SOURCE.PLOT.PSFMODEL", "SOURCE.PLOT.APRESID", NULL };
     9static char *skycellFiles[] = { "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.WEIGHT", NULL };
     10static char *photFiles[] = { "PSPHOT.INPUT", "PSPHOT.OUTPUT", "PSPHOT.INPUT.CMF", "PSPHOT.RESID",
     11                             "PSPHOT.BACKMDL", "PSPHOT.BACKMDL.STDEV", "PSPHOT.BACKGND", "PSPHOT.BACKSUB",
     12                             "PSPHOT.PSF.SAVE", "SOURCE.PLOT.MOMENTS", "SOURCE.PLOT.PSFMODEL",
     13                             "SOURCE.PLOT.APRESID", NULL };
    1314static char *independentFiles[] = { "PSWARP.ASTROM", // Read independently from the input pixels
    1415                                    "PSWARP.SKYCELL", // Don't care about the skycell once we have its WCS
    15                                     "PSPHOT.INPUT", // This is just a pointer to PSWARP.OUTPUT
    1616                                    "PSWARP.OUTPUT.SOURCES", // Save these independently so we can do the PSF
    1717                                    NULL };
     
    127127    {
    128128        fileActivation(config, detectorFiles, false);
     129        fileActivation(config, photFiles, false);
    129130        fileActivation(config, independentFiles, false);
    130131        fileActivation(config, skycellFiles, true);
     
    326327    fileActivation(config, detectorFiles, false);
    327328    fileActivation(config, independentFiles, false);
    328     fileActivation(config, skycellFiles, true);
    329329
    330330    // We need a new PSF model for the warped frame
     
    334334    // scratch.
    335335    if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) {
     336        fileActivation(config, photFiles, true);
     337        ioChecksBefore(config);
     338
     339        // Tweak recipe
    336340        psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes,
    337341                                                       PSPHOT_RECIPE); // Recipe for psphot
     
    346350                          "Don't allow psphot to fit a fake PSF!", false);
    347351
     352#if 0
    348353        // Get rid of the transformed sources so that we can measure the PSF
    349354        psMetadataRemoveKey(output->analysis, "PSPHOT.SOURCES");
    350 
    351 #if 0
     355#endif
     356
    352357        pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
    353358        pmFPACopy(photFile->fpa, outFPA);
    354 #endif
    355359
    356360        pmFPAview *view = pmFPAviewAlloc(0); // View into skycell
    357361        view->chip = view->cell = view->readout = 0;
    358         if (!psphotReadout(config, view)) {
     362        if (!psphotReadoutFindPSF(config, view)) {
    359363            psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image.");
    360364            return false;
    361365        }
    362366        psFree(view);
    363 
    364         pmFPAfileActivate(config->files, true, "PSPHOT.INPUT");
    365         pmFPAfileActivate(config->files, true, "PSPHOT.PSF.SAVE");
    366     }
     367    }
     368
     369    fileActivation(config, skycellFiles, true);
    367370
    368371    // Perform statistics on the output image
Note: See TracChangeset for help on using the changeset viewer.