IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36161


Ignore:
Timestamp:
Sep 30, 2013, 5:41:48 AM (13 years ago)
Author:
eugene
Message:

getting psphotFullForce to run (not quite there)

Location:
branches/eam_branches/ipp-20130904/psphot/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psphot/src/psphotArguments.c

    r36153 r36161  
    217217    pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf",      "-psflist");
    218218    pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC",        "-src",      "-srclist");
    219     pmConfigFileSetsMD (config->arguments, &argc, argv, "FORCE",      "-force",    "-forcelist");
     219    // XXX allow this format? pmConfigFileSetsMD (config->arguments, &argc, argv, "FORCE",      "-force",    "-forcelist");
    220220    pmConfigFileSetsMD (config->arguments, &argc, argv, "EXPNUM",     "-expnum",   "-expnumlist");
    221221
  • branches/eam_branches/ipp-20130904/psphot/src/psphotFullForce.c

    r36146 r36161  
    2020
    2121    // call psphot for each readout
    22     if (!psphotImageLoop (config, PSPHOT_FORCED)) {
     22    if (!psphotImageLoop (config, PSPHOT_FULL_FORCE)) {
    2323        psErrorStackPrint(stderr, "Error in the psphot image loop\n");
    2424        exit (psphotGetExitStatus());
  • branches/eam_branches/ipp-20130904/psphot/src/psphotFullForceArguments.c

    r36146 r36161  
    77
    88    int N;
    9     bool status, status1, status2;
     9    bool status, status1, status2, status3;
    1010
    1111    // load config data from default locations
     
    7373    pmConfigFileSetsMD (config->arguments, &argc, argv, "VARIANCE",   "-variance", "-variancelist");
    7474
    75     // XXX make psf model optional?
    76     status = pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf",      "-psflist");
    77     if (!status) {
    78         psError(PSPHOT_ERR_ARGUMENTS, true, "No psf model is supplied (use -psf)");
    79         usage(argv[0], config->arguments, config, PS_EXIT_CONFIG_ERROR);
    80     }
    81 
    82     status1 = pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC", "-src", "-srclist");
     75    pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf",      "-psflist");
     76
     77    status1 = pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC",     "-src",     "-srclist");
    8378    status2 = pmConfigFileSetsMD (config->arguments, &argc, argv, "SRCTEXT", "-srctext", "-srctextlist");
     79    status3 = pmConfigFileSetsMD (config->arguments, &argc, argv, "FORCE",   "-force",   "-forcelist");
    8480   
    85     if (!status1 && !status2) {
    86         psError(PSPHOT_ERR_ARGUMENTS, true, "No source list is supplied (use one of -src, -srctext, -srclist, or -srctextlist)");
     81    if (!(status1 || status2 || status3)) {
     82      // XXX require -force version?
     83        psError(PSPHOT_ERR_ARGUMENTS, true, "No source list is supplied (use one of -force, -forcelist, -src, -srctext, -srclist, or -srctextlist)");
    8784        usage(argv[0], config->arguments, config, PS_EXIT_CONFIG_ERROR);
    8885    }
  • branches/eam_branches/ipp-20130904/psphot/src/psphotFullForceReadout.c

    r36148 r36161  
    5656    psphotMergeSources (config, view, filerule);
    5757
     58    // construct sources and measure moments and other basic stats (saved on detections->newSources)
     59    // all sources use the auto-scaled window appropriate to a PSF, except for the saturated
     60    // stars : these use a larger window (3x the basic window)
     61    if (!psphotSourceStats (config, view, filerule, true)) { // pass 1
     62        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
     63        return psphotReadoutCleanup (config, view, filerule);
     64    }
     65
    5866    // generate a psf model for any readouts which need one
    5967    // psphotFullForcePSF (config, view, filerule);
     
    6169    // sources; we should mark with a flag bit the ones we actually want to use as PSF
    6270    // stars (this means we need to supply this info in the load).
    63     psphotChoosePSF (config, view, filerule, true);
     71    psphotChoosePSF (config, view, filerule, false);
    6472
    6573    // Construct an initial model for each object, set the radius to fitRadius, set circular
  • branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c

    r36156 r36161  
    1111    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    1212    psAssert (recipe, "missing recipe?");
     13
     14    // perform full non-linear fits / extended source analysis?
     15    // XXX for this to be true for psphotFullForce??
     16    if (!psMetadataLookupBool (&status, recipe, "GALAXY_SHAPES")) {
     17        psLogMsg ("psphot", PS_LOG_INFO, "skipping galaxy shape measurements\n");
     18        return true;
     19    }
    1320
    1421    int num = psphotFileruleCount(config, filerule);
     
    7885    assert (status);
    7986
    80     // source fitting parameters for extended source fits
    81     int fitIter = psMetadataLookupS32(&status, recipe, "EXT_FIT_ITER"); // Max number of fit iterations
    82     assert (status && fitIter > 0);
    83 
    84     float fitMinTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MIN_TOL"); // Fit tolerance
    85     if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) {
    86         fitMinTol = psMetadataLookupF32 (&status, recipe, "PSF_FIT_TOL"); // Fit tolerance
    87         if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) {
    88             psAbort("PSF_FIT_MIN_TOL (and PSF_FIT_TOL) not defined or positive");
    89         }
    90     }
    91 
    92     float fitMaxTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MAX_TOL"); // Fit tolerance
    93     if (!status || !isfinite(fitMaxTol) || fitMaxTol <= 0) {
    94         fitMaxTol = 1.0;
    95     }
    96 
    97     bool chisqConvergence = psMetadataLookupBool (&status, recipe, "LMM_FIT_CHISQ_CONVERGENCE"); // Fit tolerance
    98     if (!status) {
    99         // default to the old method (chisqConvergence)
    100         chisqConvergence = true;
    101     }
    102 
    103     int gainFactorMode = psMetadataLookupS32 (&status, recipe, "LMM_FIT_GAIN_FACTOR_MODE"); // Fit tolerance
    104     if (!status) {
    105         // default to the old method (chisqConvergence)
    106         gainFactorMode = 0;
    107     }
    108 
    109     // perform full extended source non-linear fits?
    110     bool isInteractive = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_INTERACTIVE");
    111     if (!status) isInteractive = false;
    112 
    11387    // Define source fitting parameters for extended source fits
     88    // we are not doing LMM fitting, so most options are irrelevant
    11489    pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc();
    11590    fitOptions->mode           = PM_SOURCE_FIT_EXT_AND_SKY;
    116     fitOptions->saveCovariance = true;  // XXX make this a user option?
    11791    fitOptions->covarFactor    = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix
    118     fitOptions->nIter          = fitIter;
    119     fitOptions->minTol         = fitMinTol;
    120     fitOptions->maxTol         = fitMaxTol;
    121 
    122     fitOptions->gainFactorMode   = gainFactorMode;
    123     fitOptions->chisqConvergence = chisqConvergence;
    124     fitOptions->isInteractive    = isInteractive;
    12592
    12693    // source analysis is done in S/N order (brightest first)
  • branches/eam_branches/ipp-20130904/psphot/src/psphotMergeSources.c

    r36156 r36161  
    188188    psFree (detections);
    189189
    190     if (!extCMF && !extSourcesTXT) {
     190    if (!(extCMF || extCFF || extSourcesTXT)) {
    191191        psLogMsg ("psphot", 3, "no external sources for this readout");
    192192        return true;
     
    194194
    195195    int nCMF = extCMF        ? extCMF->allSources->n        : 0;
    196     int nTXT = extSourcesTXT ? extSourcesTXT->n : 0;
    197 
    198     psLogMsg ("psphot", 3, "%d external sources (%d cmf, %d text) merged to yield %ld total sources",
    199               nCMF + nTXT, nCMF, nTXT, sources->n);
     196    int nCFF = extCFF        ? extCFF->allSources->n        : 0;
     197    int nTXT = extSourcesTXT ? extSourcesTXT->n             : 0;
     198
     199    psLogMsg ("psphot", 3, "%d external sources (%d cmf, %d cff, %d text) merged to yield %ld total sources",
     200              nCMF + nCFF + nTXT, nCMF, nCFF, nTXT, sources->n);
    200201    return true;
    201202}
Note: See TracChangeset for help on using the changeset viewer.