IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36244


Ignore:
Timestamp:
Oct 28, 2013, 11:22:13 AM (13 years ago)
Author:
bills
Message:

Include galaxy model type for each object in the cff format..
Assert that each row have X and Y (should check more and fail not assert)
Mrf = 0.4 * kronRadius
convert theta from degrees to radians
Since INDEX is defined as sersic index, set PAR[PM_PAR_7] = 0.5 / INDEX

File:
1 edited

Legend:

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

    r36209 r36244  
    7171    assert (modelType > -1);
    7272
    73     // how to deal with this?
    74     int galaxyModelType = pmModelClassGetType ("PS_MODEL_EXP");
    75 
    7673    // We get the size of the table, and allocate the array of sources first because the table
    7774    // is large and ephemeral --- when the table gets blown away, whatever is allocated after
     
    9390        unsigned int ID  = psMetadataLookupU32 (&status, row, "ID");
    9491        float X          = psMetadataLookupF32 (&status, row, "X");
     92        assert(status);
    9593        float Y          = psMetadataLookupF32 (&status, row, "Y");
     94        assert(status);
    9695        float flux       = psMetadataLookupF32 (&status, row, "FLUX"); // guess at the instrumental flux
    9796
     
    105104        float Rminor     = psMetadataLookupF32 (&status, row, "R_MINOR");
    106105        float theta      = psMetadataLookupF32 (&status, row, "THETA");
    107         float Sindex     = psMetadataLookupF32 (&status, row, "INDEX");
     106
     107        // XXX: we need to put a lookup table in the cff header to define the correspondence of the
     108        // model type values in the cff with our models. (We want to use an interger for efficiency
     109        // but the values depend on the array in pmModelClass.c
     110        int   galaxyModelType = psMetadataLookupS32(&status, row, "MODEL_TYPE");
     111        float Sindex     = psMetadataLookupF32 (&status, row, "INDEX"); // Should this be PAR_07 not sersic index
    108112
    109113        pmSource *source = pmSourceAlloc ();
     
    160164        source->moments->Mx = X;
    161165        source->moments->My = Y;
    162         source->moments->Mrf = kronRadius;
     166        source->moments->Mrf = kronRadius * 0.4; // kronRadius is 2.5 * first radial moment
    163167        source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED;
    164168        // XXX does the above cause a problem with pmSourceMoments (do we run it?)
     
    182186            galaxyAxes.major = Rmajor;
    183187            galaxyAxes.minor = Rminor;
    184             galaxyAxes.theta = theta; // XXX degrees or radians?
     188            galaxyAxes.theta = theta * PS_RAD_DEG;
    185189
    186190            pmPSF_AxesToModel (xPAR, galaxyAxes, galaxyModelType);
    187191            if (model->params->n > 7) {
    188               xPAR[PM_PAR_7] = Sindex;
     192                xPAR[PM_PAR_7] = 0.5 / Sindex;
    189193            }
    190194
    191195            psArrayAdd (source->modelFits, 1, model);
    192196            psFree (model);
    193            
    194197        }
    195198
Note: See TracChangeset for help on using the changeset viewer.