IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2013, 10:40:05 AM (13 years ago)
Author:
bills
Message:

handle some error conditions with regard to handling of EXT_MODEL_TYPE when reading an XFIT extension

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmSourceIO_CMF.c.in

    r36266 r36269  
    10641064        // EXT_MODEL_TYPE gives the model chosen by psphot as the best.
    10651065        // Putting this into the XFIT table makes 3 copies of it (one for each model)
    1066         // but since we have fewer XFIT rows than psf rows that is cheaper than putting it
     1066        // but since we have many fewer XFIT rows than psf rows that is cheaper than putting it
    10671067        // in the psf table.
    10681068        psS32 extModelType = psMetadataLookupS32(&status, row, "EXT_MODEL_TYPE");
     1069        if (!status) {
     1070            // older cmfs don't have this column
     1071            extModelType = -1;
     1072        }
    10691073
    10701074        psEllipseAxes axes;
     
    10951099        model->covar = covar;
    10961100
    1097         psArrayAdd(source->modelFits, 1, model);
    1098         psFree(model);
    1099 
    11001101        if (modelType == extModelType) {
    11011102            // The software that created this source picked this model as the best of the fits.
    11021103            // Set the extModel to point to it.
     1104            // This is important for programs like psastro (skycal) so that its output cmfs
     1105            // will have valid EXT_MODEL_TYPE
    11031106            psFree(source->modelEXT);
    11041107            source->modelEXT = psMemIncrRefCounter(model);
     1108            source->type = PM_SOURCE_TYPE_EXTENDED;
    11051109            if (0) {
    1106                 // since FLAGS were read we shouldn't need to do this.
    1107                 source->type = PM_SOURCE_TYPE_EXTENDED;
     1110                // since FLAGS were read we don't need to do this
    11081111                source->mode |= PM_SOURCE_MODE_EXTMODEL;
    1109                 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;   // XXX: Is this safe?
     1112                source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    11101113            }
    11111114        }
    11121115
     1116        psArrayAdd(source->modelFits, 1, model);
     1117        psFree(model);
    11131118        psFree(row);
    11141119    }
Note: See TracChangeset for help on using the changeset viewer.