IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39112 for trunk


Ignore:
Timestamp:
Nov 12, 2015, 10:03:20 AM (11 years ago)
Author:
eugene
Message:

add objflags, set theta to degrees, set index for DeV and Exp to 4 and 1 respectively

Location:
trunk/Ohana/src/dvopsps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvopsps/include/dvopsps.h

    r39019 r39112  
    3333
    3434  unsigned int flags;
     35  unsigned int objflags;
    3536} Detections;
    3637
  • trunk/Ohana/src/dvopsps/src/insert_FGshape_dvopsps_catalog.c

    r39074 r39112  
    226226    PrintIOBuffer (gal_buffer, "%hd, ", galphot->modelType);         
    227227
    228     PRINT_FLOAT(gal_buffer, galphot->mag,          "%.6e, ");
    229     PRINT_FLOAT(gal_buffer, galphot->magErr,       "%.6e, ");
    230     PRINT_FLOAT(gal_buffer, galphot->majorAxis,    "%.6e, ");
    231     PRINT_FLOAT(gal_buffer, galphot->minorAxis,    "%.6e, ");
    232     PRINT_FLOAT(gal_buffer, galphot->majorAxisErr, "%.6e, ");
    233     PRINT_FLOAT(gal_buffer, galphot->minorAxisErr, "%.6e, ");
    234     PRINT_FLOAT(gal_buffer, galphot->theta,        "%.6e, ");
    235     PRINT_FLOAT(gal_buffer, galphot->thetaErr,     "%.6e, ");
    236     PRINT_FLOAT(gal_buffer, galphot->index,        "%.6e, ");
    237     PRINT_FLOAT(gal_buffer, galphot->chisq,        "%.6e, ");
     228    float sersic_index = galphot->index;
     229    if (galphot->modelType == 6) sersic_index = 1.0;
     230    if (galphot->modelType == 7) sersic_index = 4.0;
     231
     232    PRINT_FLOAT(gal_buffer, galphot->mag,              "%.6e, ");
     233    PRINT_FLOAT(gal_buffer, galphot->magErr,           "%.6e, ");
     234    PRINT_FLOAT(gal_buffer, galphot->majorAxis,        "%.6e, ");
     235    PRINT_FLOAT(gal_buffer, galphot->minorAxis,        "%.6e, ");
     236    PRINT_FLOAT(gal_buffer, galphot->majorAxisErr,     "%.6e, ");
     237    PRINT_FLOAT(gal_buffer, galphot->minorAxisErr,     "%.6e, ");
     238    PRINT_FLOAT(gal_buffer, DEG_RAD*galphot->theta,    "%.6e, ");
     239    PRINT_FLOAT(gal_buffer, DEG_RAD*galphot->thetaErr, "%.6e, ");
     240    PRINT_FLOAT(gal_buffer, sersic_index,              "%.6e, ");
     241    PRINT_FLOAT(gal_buffer, galphot->chisq,            "%.6e, ");
    238242
    239243    PrintIOBuffer (gal_buffer, "%d ", (int) galphot->Npix); // NOTE: PRINT_FLOAT always adds a trailing comma -- need to use a different method on the last entry         
  • trunk/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c

    r38986 r39112  
    184184  PrintIOBuffer (buffer, "INSERT INTO dvoDetectionFull (objID, detectID, ippObjID, ippDetectID, imageID, catID, ");
    185185  PrintIOBuffer (buffer, "ra, dec_, raErr, decErr, zp, zpFactor, telluricExt, airmass, expTime, ");
    186   PrintIOBuffer (buffer, "Mpsf, dMpsf, Mkron, dMkron, Map, dMap, flags) VALUES \n");
     186  PrintIOBuffer (buffer, "Mpsf, dMpsf, Mkron, dMkron, Map, dMap, flags, objflags) VALUES \n");
    187187
    188188  return TRUE;
     
    234234int insert_detections_mysql_detvalue (IOBuffer *buffer, Detections *detection) {
    235235
     236# if (0)
    236237  if (detection->detectID == 164458937060000101) {
    237238    fprintf (stderr, "isfinite: %d\n", isfinite(detection->dMpsf));
     
    239240    fprintf (stderr, "isinf: %d\n", isinf(detection->dMpsf));
    240241  }
     242# endif
    241243
    242244  // XXX I needed OFF_T_FMT on my 32bit ubuntu laptop; ok on 64bit?
     
    265267  PRINT_FLOAT(buffer, detection->dMap,        "%.6f, ");
    266268
    267   PrintIOBuffer (buffer, "%u),\n", detection->flags);     // flags
     269  PrintIOBuffer (buffer, "%u, ", detection->flags);      // measure.flags
     270  PrintIOBuffer (buffer, "%u),\n", detection->objflags); // average.flags
    268271  return TRUE;
    269272}
     
    341344  detection->dMap   = getdMagFromValueOrFlux (measure->FluxAp,   measure->dFluxAp,   measure->dMap);
    342345
    343   detection->flags  = measure->dbFlags;  // flags
    344 
    345   return TRUE;
    346 }
    347 
     346  detection->flags     = measure->dbFlags; // flags
     347  detection->objflags  = average->flags;   // flags
     348
     349  return TRUE;
     350}
     351
Note: See TracChangeset for help on using the changeset viewer.