IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38038


Ignore:
Timestamp:
Mar 28, 2015, 7:16:10 AM (11 years ago)
Author:
eugene
Message:

replace assert with psAssert in cases where the value is otherwise unused; do not raise an error when looking for classID in detloc which is not found; add galaxy shape error propagation failure flags to pmModelStatus; read EXT_WIDTH_MAJ_ERR et al back into dPAR[SXX,etc] (careful: this only works if not real errors); read SKY_EXT in PAR[SKY]; use header for FWHM_MAJ if not found on readout->analysis

Location:
trunk/psModules/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config

    • Property svn:ignore
      •  

        old new  
        88pmErrorCodes.h
        99pmVersionDefinitions.h
         10pmVersionDefinitions.h.tmp
  • trunk/psModules/src/config/Makefile.am

    r26682 r38038  
    11noinst_LTLIBRARIES = libpsmodulesconfig.la
    2 
    3 if HAVE_SVNVERSION
    4 PSMODULES_VERSION=`$(SVNVERSION) ../..`
    5 else
    6 PSMODULES_VERSION="UNKNOWN"
    7 endif
    8 
    9 if HAVE_SVN
    10 PSMODULES_BRANCH=`$(SVN) info ../.. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
    11 PSMODULES_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
    12 else
    13 PSMODULES_BRANCH="UNKNOWN"
    14 PSMODULES_SOURCE="UNKNOWN"
    15 endif
    162
    173# Force recompilation of pmVersion.c, since it gets the version information
    184pmVersion.c: pmVersionDefinitions.h
    195pmVersionDefinitions.h: pmVersionDefinitions.h.in FORCE
    20         -$(RM) pmVersionDefinitions.h
    21         $(SED) -e "s|@PSMODULES_VERSION@|\"$(PSMODULES_VERSION)\"|" -e "s|@PSMODULES_BRANCH@|\"$(PSMODULES_BRANCH)\"|" -e "s|@PSMODULES_SOURCE@|\"$(PSMODULES_SOURCE)\"|" pmVersionDefinitions.h.in > pmVersionDefinitions.h
     6        pslib-setsvnversion.pl PSMODULES pmVersionDefinitions.h.in pmVersionDefinitions.h
    227FORCE: ;
    238
  • trunk/psModules/src/config/pmConfigRecipes.c

    r23688 r38038  
    228228        }
    229229        psFree (words);
    230         assert (valid);  // flag may be: -D, -Df, -Di, -Db
     230        psAssert (valid, "invalid flag: may be: -D, -Df, -Di, -Db\n");
    231231
    232232        psArgumentRemove (argNum, argc, argv);
  • trunk/psModules/src/detrend/pmDetrendDB.c

    r37837 r38038  
    356356    psTrace("psModules.detrend", 5, "detrend file: %s\n", result);
    357357
     358    // XXX: A somewhat hacked bit of code to force the analysis to use a specific version of the detrend file
    358359    char *is_nebulous = strstr(result,"neb://");
    359360    if (is_nebulous) { // This file matches the nebulous string
    360361      psString truncated = psStringCopy(is_nebulous + 6);
    361362      //      printf("A: %s %s\n",result,truncated);
     363
    362364      psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes,"PPIMAGE");
    363       psMetadata *detloc = psMetadataLookupMetadata(NULL, recipe, "DETREND.LOCATIONS");
     365      psMetadata *detloc = psMetadataLookupMetadata(&status, recipe, "DETREND.LOCATIONS");
     366
    364367      if (detloc) { // This exists, so we have the information.
    365         psString location = psMetadataLookupStr(NULL, detloc,classID);
     368        psString location = psMetadataLookupStr(&status, detloc, classID);
    366369        //      printf("B: %s %s\n", classID,location);
    367370        if (location) { // Found a location
  • trunk/psModules/src/objects

  • trunk/psModules/src/objects/pmFootprintAssignPeaks.c

    r31332 r38038  
    5656        const int y = peak->y - row0;
    5757       
    58         if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);}
     58        if (ids) { psAssert (x >= 0 && x < numCols && y >= 0 && y < numRows, "out of range");}
    5959        int id = ids ? ids->data.S32[y][x] : 0;
    6060
  • trunk/psModules/src/objects/pmModelFuncs.h

    r36860 r38038  
    3636
    3737typedef enum {
    38     PM_MODEL_STATUS_NONE           = 0x000, ///< model fit not yet attempted, no other info
    39     PM_MODEL_STATUS_FITTED         = 0x001, ///< model fit completed
    40     PM_MODEL_STATUS_NONCONVERGE    = 0x002, ///< model fit did not converge
    41     PM_MODEL_STATUS_OFFIMAGE       = 0x004, ///< model fit drove out of range
    42     PM_MODEL_STATUS_BADARGS        = 0x008, ///< model fit called with invalid args
    43     PM_MODEL_STATUS_LIMITS         = 0x010, ///< model parameters hit limits
    44     PM_MODEL_STATUS_WEAK_FIT       = 0x020, ///< model fit met loose tolerance, but not tight tolerance
    45     PM_MODEL_STATUS_NAN_CHISQ      = 0x040, ///< model fit failed with a NAN chisq
    46     PM_MODEL_SERSIC_PCM_FAIL_GUESS = 0x080, ///< sersic model fit failed on the initial moments-based guess
    47     PM_MODEL_SERSIC_PCM_FAIL_GRID  = 0x100, ///< sersic model fit failed on the grid search
    48     PM_MODEL_PCM_FAIL_GUESS        = 0x200, ///< non-sersic model fit failed on the initial moments-based guess
    49     PM_MODEL_BEST_FIT              = 0x400, ///< this model was the best fit and was subtracted
     38    PM_MODEL_STATUS_NONE           = 0x0000, ///< model fit not yet attempted, no other info
     39    PM_MODEL_STATUS_FITTED         = 0x0001, ///< model fit completed
     40    PM_MODEL_STATUS_NONCONVERGE    = 0x0002, ///< model fit did not converge
     41    PM_MODEL_STATUS_OFFIMAGE       = 0x0004, ///< model fit drove out of range
     42    PM_MODEL_STATUS_BADARGS        = 0x0008, ///< model fit called with invalid args
     43    PM_MODEL_STATUS_LIMITS         = 0x0010, ///< model parameters hit limits
     44    PM_MODEL_STATUS_WEAK_FIT       = 0x0020, ///< model fit met loose tolerance, but not tight tolerance
     45    PM_MODEL_STATUS_NAN_CHISQ      = 0x0040, ///< model fit failed with a NAN chisq
     46    PM_MODEL_SERSIC_PCM_FAIL_GUESS = 0x0080, ///< sersic model fit failed on the initial moments-based guess
     47    PM_MODEL_SERSIC_PCM_FAIL_GRID  = 0x0100, ///< sersic model fit failed on the grid search
     48    PM_MODEL_PCM_FAIL_GUESS        = 0x0200, ///< non-sersic model fit failed on the initial moments-based guess
     49    PM_MODEL_BEST_FIT              = 0x0400, ///< this model was the best fit and was subtracted
     50    PM_MODEL_STATUS_NAN_SHAPE      = 0x0800, ///< model ellipse parameters do not transform to valid ellipse
     51    PM_MODEL_STATUS_NAN_SHAPE_ERR  = 0x1000, ///< model ellipse parameters errors do not transform to valid ellipse
     52    PM_MODEL_STATUS_FAIL_SHAPE_ERR = 0x2000, ///< could not find an MC solution for ellipse parameter errors
    5053} pmModelStatus;
    5154
  • trunk/psModules/src/objects/pmSourceIO_CMF.c.in

    r37964 r38038  
    12521252        }
    12531253
    1254         // XXX : make this depend on what is in the cmf
    1255         if (0) {
     1254        // NOTE: we no longer write out the covariance matrix
     1255        if (false) {
    12561256            // read the covariance matrix
    12571257            int nparams = model->params->n;
     
    12661266            model->covar = covar;
    12671267        }
     1268
     1269        // we are only saving the values stored in dPAR[SXX,etc]
     1270        dPAR[PM_PAR_SXX] = psMetadataLookupF32(&status, row, "EXT_WIDTH_MAJ_ERR");
     1271        dPAR[PM_PAR_SYY] = psMetadataLookupF32(&status, row, "EXT_WIDTH_MIN_ERR");
     1272        dPAR[PM_PAR_SXY] = psMetadataLookupF32(&status, row, "EXT_THETA_ERR");
     1273
     1274        // other parameters that we need to read
     1275        PAR[PM_PAR_SKY] = psMetadataLookupF32(&status, row, "SKY_EXT");
    12681276
    12691277        if (modelType == extModelType) {
  • trunk/psModules/src/objects/pmSourceIO_PS1_CAL_0.c

    r36866 r38038  
    376376    psVector *radialBinsLower = psMetadataLookupPtr (&status, recipe, "RADIAL.ANNULAR.BINS.LOWER");
    377377    psVector *radialBinsUpper = psMetadataLookupPtr (&status, recipe, "RADIAL.ANNULAR.BINS.UPPER");
    378     assert (radialBinsLower->n == radialBinsUpper->n);
     378    psAssert (radialBinsLower->n == radialBinsUpper->n, "upper and lower bins must match");
    379379
    380380    // we write out all sources, regardless of quality.  the source flags tell us the state
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c

    r36866 r38038  
    322322    psVector *radialBinsLower = psMetadataLookupPtr (&status, recipe, "RADIAL.ANNULAR.BINS.LOWER");
    323323    psVector *radialBinsUpper = psMetadataLookupPtr (&status, recipe, "RADIAL.ANNULAR.BINS.UPPER");
    324     assert (radialBinsLower->n == radialBinsUpper->n);
     324    psAssert (radialBinsLower->n == radialBinsUpper->n, "upper and lower bins must match");
    325325
    326326    // we write out all sources, regardless of quality.  the source flags tell us the state
  • trunk/psModules/src/objects/pmSourceOutputs.c

    r36860 r38038  
    6060    // we need a measure of the image quality (FWHM) for this image, in order to get the positional errors
    6161    *fwhmMajor = psMetadataLookupF32(&status1, readout->analysis, "FWHM_MAJ");
    62     if (!status1) {
    63         *fwhmMajor = psMetadataLookupF32(&status1, readout->analysis, "IQ_FW1");
    64         if (!status1) {
    65             *fwhmMajor = 5.0; // XXX just a guess!
    66         }
    67     }
     62    if (status1) goto got_major;
     63
     64    *fwhmMajor = psMetadataLookupF32(&status1, header, "FWHM_MAJ");
     65    if (status1) goto got_major;
     66
     67    *fwhmMajor = psMetadataLookupF32(&status1, readout->analysis, "IQ_FW1");
     68    if (status1) goto got_major;
     69
     70    *fwhmMajor = psMetadataLookupF32(&status1, header, "IQ_FW1");
     71    if (status1) goto got_major;
     72
     73    *fwhmMajor = 5.0; // XXX just a guess!
     74
     75    got_major:
     76
    6877    *fwhmMinor = psMetadataLookupF32(&status1, readout->analysis, "FWHM_MIN");
    69     if (!status1) {
    70         *fwhmMinor = psMetadataLookupF32(&status1, readout->analysis, "IQ_FW2");
    71         if (!status1) {
    72             *fwhmMinor = 5.0; // XXX just a guess!
    73         }
    74     }
    75 
     78    if (status1) goto got_minor;
     79    *fwhmMinor = psMetadataLookupF32(&status1, header, "FWHM_MIN");
     80    if (status1) goto got_minor;
     81
     82    *fwhmMinor = psMetadataLookupF32(&status1, readout->analysis, "IQ_FW2");
     83    if (status1) goto got_minor;
     84    *fwhmMinor = psMetadataLookupF32(&status1, header, "IQ_FW2");
     85    if (status1) goto got_minor;
     86
     87    *fwhmMinor = 5.0; // XXX just a guess!
     88
     89    got_minor:
    7690    return true;
    7791
Note: See TracChangeset for help on using the changeset viewer.