IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39515 for trunk


Ignore:
Timestamp:
Apr 6, 2016, 3:05:19 PM (10 years ago)
Author:
eugene
Message:

save numerical values for DEV and EXP model fits; test for INDEX, use DEV and EXP index values if INDEX is missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/loadgalphot_readstars.c

    r39330 r39515  
    6161  // in xfit, we have strings.  these are listed with their numerical
    6262  // match in the PHU.  I need to read the list of names and set up a string hash
     63
     64  int ModelTypeDev = -1;
     65  int ModelTypeExp = -1;
    6366
    6467  int ModelTypeN;
     
    98101    if (!gfits_scan (&header_xfit, name, "%d", 1, &tmpnumber)) { myAbort ("fail"); }
    99102    ModelTypeNum[i] = tmpnumber;
     103    if (!strcasecmp (ModelTypeName[i], "PS_MODEL_EXP")) {
     104      ModelTypeExp = ModelTypeNum[i];
     105    }
     106    if (!strcasecmp (ModelTypeName[i], "PS_MODEL_DEV")) {
     107      ModelTypeDev = ModelTypeNum[i];
     108    }
    100109  }
    101110
     
    117126  GET_COLUMN (xfit, INDEX,          "EXT_PAR_07",    float);
    118127  int Nfit = Nrow;
     128
     129  float DEV_INDEX_VALUE = 0.5 / 4.0;
     130  float EXP_INDEX_VALUE = 0.5 / 1.0;
     131
     132  // note that INDEX here is defined as 1.0 / (2 \nu), where \nu is the traditional sersic
     133  // expression.
    119134
    120135  myAssert (NcharModel < 256, "max model type name is very long: %d", NcharModel);
     
    247262    stars[i].galphot.theta     = EXT_THETA[ifit];
    248263    stars[i].galphot.thetaErr  = EXT_THETA_ERR[ifit];
    249     stars[i].galphot.index     = INDEX[ifit];
    250264    stars[i].galphot.Npix      = NPIX[i];
    251265    stars[i].galphot.modelType = MODEL_TYPE_gal[i];
     266    if (INDEX) {
     267      stars[i].galphot.index     = INDEX[ifit];
     268    } else {
     269      if (MODEL_TYPE_gal[i] == ModelTypeDev) { stars[i].galphot.index = DEV_INDEX_VALUE; }
     270      if (MODEL_TYPE_gal[i] == ModelTypeExp) { stars[i].galphot.index = EXP_INDEX_VALUE; }
     271    }
    252272    stars[i].galphot.detID     = ID_gal[i];
    253273    stars[i].galphot.photcode  = options->photcode;
Note: See TracChangeset for help on using the changeset viewer.