IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35578


Ignore:
Timestamp:
May 10, 2013, 5:52:32 PM (13 years ago)
Author:
eugene
Message:

add photcode to the dvoDetection table

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

Legend:

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

    r35207 r35578  
    1313  uint64_t ippObjID;
    1414  uint64_t objID;
     15  int      photcode;
    1516  unsigned int flags;
    1617  float zp;
  • trunk/Ohana/src/dvopsps/src/DetectionOps.c

    r35098 r35578  
    5454  GET_COLUMN(ippObjID    , "ippObjID",    int64_t);
    5555  GET_COLUMN(objID       , "objID",       int64_t);
     56  GET_COLUMN(photcode    , "photcode",    int);
    5657  GET_COLUMN(flags       , "flags",       int);
    5758  GET_COLUMN(zp          , "zp",          float);
     
    7374    detections[i].ippObjID     = ippObjID[i];   
    7475    detections[i].objID        = objID[i];     
     76    detections[i].photcode     = photcode[i];     
    7577    detections[i].flags        = flags[i];     
    7678    detections[i].zp           = zp[i];         
     
    9092  free (ippObjID   );
    9193  free (objID      );
     94  free (photcode   );
    9295  free (flags      );
    9396  free (zp         );
     
    154157  // gfits_define_bintable_column (&theader, "K", "ippObjID",    NULL, NULL, 1.0, BZERO_INT64);
    155158  // gfits_define_bintable_column (&theader, "K", "objID",       NULL, NULL, 1.0, BZERO_INT64);
     159  gfits_define_bintable_column (&theader, "J", "photcode",    NULL, NULL, 1.0, 0.0);
    156160  gfits_define_bintable_column (&theader, "J", "flags",       NULL, NULL, 1.0, BZERO_INT32);
    157161  gfits_define_bintable_column (&theader, "E", "zp",          NULL, NULL, 1.0, 0.0);
     
    173177  uint64_t   *ippObjID    ; ALLOCATE (ippObjID    ,  uint64_t, Ndetections);
    174178  uint64_t   *objID       ; ALLOCATE (objID       ,  uint64_t, Ndetections);
     179  int        *photcode    ; ALLOCATE (photcode    ,  int,      Ndetections);
    175180  uint32_t   *flags       ; ALLOCATE (flags       ,  uint32_t, Ndetections);
    176181  float      *zp          ; ALLOCATE (zp          ,  float,    Ndetections);
     
    190195    ippObjID[i]    = detections[i].ippObjID    ;
    191196    objID[i]       = detections[i].objID       ;
     197    photcode[i]    = detections[i].photcode    ;
    192198    flags[i]       = detections[i].flags       ;
    193199    zp[i]          = detections[i].zp          ;
     
    207213  gfits_set_bintable_column (&theader, &ftable, "ippObjID",    ippObjID    , Ndetections);
    208214  gfits_set_bintable_column (&theader, &ftable, "objID",       objID       , Ndetections);
     215  gfits_set_bintable_column (&theader, &ftable, "photcode",    photcode    , Ndetections);
    209216  gfits_set_bintable_column (&theader, &ftable, "flags",       flags       , Ndetections);
    210217  gfits_set_bintable_column (&theader, &ftable, "zp",          zp          , Ndetections);
     
    222229  free (ippObjID    );
    223230  free (objID       );
     231  free (photcode    );
    224232  free (flags       );
    225233  free (zp          );
  • trunk/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c

    r35416 r35578  
    4949      // detections[Ndetections]. ((uint64_t)average->catID << 32) + (uint64_t)average->objID; // ippObjID
    5050      detections[Ndetections].objID        = average->extID;   // objID
     51      detections[Ndetections].photcode     = measure->photcode;   // photcode
    5152      detections[Ndetections].flags        = measure->dbFlags;  // flags
    5253      detections[Ndetections].zp           = code->C * 0.001 + code->K * (measure->airmass - 1) - measure->Mcal;   // zp
     
    168169  }
    169170
    170   PrintIOBuffer (buffer, "INSERT INTO dvoDetectionFull (imageID, ippDetectID, detectID, ippObjID, objID, flags, zp, zpErr, airMass, expTime, ra, dec_, raErr, decErr) VALUES \n");
     171  PrintIOBuffer (buffer, "INSERT INTO dvoDetectionFull (imageID, ippDetectID, detectID, ippObjID, objID, photcode, flags, zp, zpErr, airMass, expTime, ra, dec_, raErr, decErr) VALUES \n");
    171172
    172173  return TRUE;
     
    179180int insert_detections_mysql_value (IOBuffer *buffer, Average *average, Measure *measure) {
    180181
    181   // XXX I am changing the def of ippObjID if I use the code below
    182182  PhotCode *code = GetPhotcodebyCode(measure->photcode);
    183   // PrintIOBuffer (buffer, "    (%d, %u, %lu, %lu, %lu, %u, %f, %f, %f, %f, %lf, %lf, %f, %f),\n",
    184   //             measure->imageID,    // imageID
    185   //             measure->detID,   // ippDetectID
    186   //             measure->extID,   // detectID
    187   //             ((uint64_t)average->catID * 1000000000) + (uint64_t)average->objID, // ippObjID
    188   //             // NOTE: this is better, but the above is the current ippToPsps value
    189   //             // ((uint64_t)average->catID << 32) + (uint64_t)average->objID, // ippObjID
    190   //             average->extID,   // objID
    191   //             measure->dbFlags,  // flags
    192   //             code->C * 0.001 + code->K * (measure->airmass - 1) - measure->Mcal,   // zp
    193   //             measure->dMcal,    // zpErr
    194   //             measure->airmass,
    195   //             pow(10.0, 0.4 * measure->dt),    // expTime
    196   //             average->R - measure->dR / 3600.,    // ra
    197   //             average->D - measure->dR / 3600.,    // dec
    198   //             measure->dXccd * 0.01 * fabs(measure->pltscale), // estimate of raErr
    199   //             measure->dYccd * 0.01 * fabs(measure->pltscale) // estimate of decErr
    200   //   );
    201  
    202183  PrintIOBuffer (buffer, "(%d, ", measure->imageID);      // imageID
    203184  PrintIOBuffer (buffer, "%u, ", measure->detID); // ippDetectID
     
    207188  // ((uint64_t)average->catID << 32) + (uint64_t)average->objID, // ippObjID
    208189  PrintIOBuffer (buffer, "%lu, ", average->extID);        // objID
     190  PrintIOBuffer (buffer, "%d, ", measure->photcode);      // photcode
    209191  PrintIOBuffer (buffer, "%u, ", measure->dbFlags);       // flags
    210192
Note: See TracChangeset for help on using the changeset viewer.