IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 16, 2012, 2:38:37 PM (14 years ago)
Author:
bills
Message:

Several changes to psphot and psphotStack

  1. Add function to compute the memory used by all of the sources
  2. Add function to log memory stats in psphotStack
  3. Don't load or psf match the convolved images into psphotStack unless they are needed.

This saves a lot of time if RADIAL_APERTURES are not enabled and we are measuring on the raw images

  1. Several improvements to the error handling in the Kron measurements. In particular the Mrf value

was being treated as positive when both the numerator and denomiator were negative. This is the cause
of many of the very large kron radius measurements. Set Mrf to NAN in these cases.

  1. Skip kron measurments for source if the previous Mrf measurement was NAN earlier in the process.

This saves memory by not expanding the source images when the kron measurements were actually going
to be skipped

  1. Remove the hack cut on fwhmMaj. Managing the kron radius measurements better fixes the memory explosion

that that helped to reduce.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotStackImageLoop.c

    r34258 r34317  
    2121    psMemDump("startloop");
    2222
     23    pmFPAview *view = pmFPAviewAlloc (0);
    2324    pmFPAfile *inputRaw = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.RAW");
    2425    pmFPAfile *inputCnv = psMetadataLookupPtr (&status, config->files, "PSPHOT.STACK.INPUT.CNV");
     
    3738    }
    3839
    39     pmFPAview *view = pmFPAviewAlloc (0);
    40 
    41 
    42     // XXX for now, just load the full set of images up front except for EXPNUM which we defer
     40    bool radial_apertures = psMetadataLookupBool(NULL, recipe, "RADIAL_APERTURES");
     41    bool match_psfs = radial_apertures;
     42    bool needConvolved = radial_apertures || !useRaw;
     43    if (!needConvolved) {
     44        pmFPAfileActivate (config->files, false, "PSPHOT.STACK.INPUT.CNV");
     45    }
     46
     47    // just load the full set of images up front except for EXPNUM which we defer
    4348    pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.RAW");
    4449    pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.CNV");
     
    6368                psMemDump("load");
    6469
    65                 // Generate the 1st PSF-matched image set (larger target PSFs are generated by smoothing this image)
    66                 if (!psphotStackMatchPSFs (config, view)) {
    67                     psError(psErrorCodeLast(), false, "failure in psphotStackMatchPSFs for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    68                     psFree (view);
    69                     return false;
    70                 }
     70                if (match_psfs) {
     71                    // Generate the 1st PSF-matched image set (larger target PSFs are generated by smoothing this image)
     72                    if (!psphotStackMatchPSFs (config, view)) {
     73                        psError(psErrorCodeLast(), false, "failure in psphotStackMatchPSFs for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     74                        psFree (view);
     75                        return false;
     76                    }
     77                } else {
     78                    if (!psphotStackAllocateOutput (config, view, recipe)) {
     79                        psError(psErrorCodeLast(), false, "failure in psphotStackAllocateOutput for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     80                        psFree (view);
     81                        return false;
     82                    }
     83                }
    7184                psMemDump("stackmatch");
    7285
Note: See TracChangeset for help on using the changeset viewer.