IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 4, 2013, 3:29:19 PM (13 years ago)
Author:
bills
Message:

Set source->modelEXT to the model fit indicated by the EXT_MODEL_TYPE column so that
model is available when writing out the xfit extension. Otherwise we don't know what
to set EXT_MODEL_TYPE to in for example psastro

File:
1 edited

Legend:

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

    r36264 r36266  
    10621062        model->nDOF = psMetadataLookupF32(&status, row, "EXT_NDOF");
    10631063
    1064         // XXX: We don't have place to put this. Needs to go in psf extension:
    1065         // psMetadataLookupS32(&status, row, "EXT_MODEL_TYPE");
     1064        // EXT_MODEL_TYPE gives the model chosen by psphot as the best.
     1065        // 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
     1067        // in the psf table.
     1068        psS32 extModelType = psMetadataLookupS32(&status, row, "EXT_MODEL_TYPE");
    10661069
    10671070        psEllipseAxes axes;
     
    10941097        psArrayAdd(source->modelFits, 1, model);
    10951098        psFree(model);
     1099
     1100        if (modelType == extModelType) {
     1101            // The software that created this source picked this model as the best of the fits.
     1102            // Set the extModel to point to it.
     1103            psFree(source->modelEXT);
     1104            source->modelEXT = psMemIncrRefCounter(model);
     1105            if (0) {
     1106                // since FLAGS were read we shouldn't need to do this.
     1107                source->type = PM_SOURCE_TYPE_EXTENDED;
     1108                source->mode |= PM_SOURCE_MODE_EXTMODEL;
     1109                source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;   // XXX: Is this safe?
     1110            }
     1111        }
    10961112
    10971113        psFree(row);
Note: See TracChangeset for help on using the changeset viewer.