Changeset 35578
- Timestamp:
- May 10, 2013, 5:52:32 PM (13 years ago)
- Location:
- trunk/Ohana/src/dvopsps
- Files:
-
- 3 edited
-
include/dvopsps.h (modified) (1 diff)
-
src/DetectionOps.c (modified) (8 diffs)
-
src/insert_detections_dvopsps_catalog.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvopsps/include/dvopsps.h
r35207 r35578 13 13 uint64_t ippObjID; 14 14 uint64_t objID; 15 int photcode; 15 16 unsigned int flags; 16 17 float zp; -
trunk/Ohana/src/dvopsps/src/DetectionOps.c
r35098 r35578 54 54 GET_COLUMN(ippObjID , "ippObjID", int64_t); 55 55 GET_COLUMN(objID , "objID", int64_t); 56 GET_COLUMN(photcode , "photcode", int); 56 57 GET_COLUMN(flags , "flags", int); 57 58 GET_COLUMN(zp , "zp", float); … … 73 74 detections[i].ippObjID = ippObjID[i]; 74 75 detections[i].objID = objID[i]; 76 detections[i].photcode = photcode[i]; 75 77 detections[i].flags = flags[i]; 76 78 detections[i].zp = zp[i]; … … 90 92 free (ippObjID ); 91 93 free (objID ); 94 free (photcode ); 92 95 free (flags ); 93 96 free (zp ); … … 154 157 // gfits_define_bintable_column (&theader, "K", "ippObjID", NULL, NULL, 1.0, BZERO_INT64); 155 158 // 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); 156 160 gfits_define_bintable_column (&theader, "J", "flags", NULL, NULL, 1.0, BZERO_INT32); 157 161 gfits_define_bintable_column (&theader, "E", "zp", NULL, NULL, 1.0, 0.0); … … 173 177 uint64_t *ippObjID ; ALLOCATE (ippObjID , uint64_t, Ndetections); 174 178 uint64_t *objID ; ALLOCATE (objID , uint64_t, Ndetections); 179 int *photcode ; ALLOCATE (photcode , int, Ndetections); 175 180 uint32_t *flags ; ALLOCATE (flags , uint32_t, Ndetections); 176 181 float *zp ; ALLOCATE (zp , float, Ndetections); … … 190 195 ippObjID[i] = detections[i].ippObjID ; 191 196 objID[i] = detections[i].objID ; 197 photcode[i] = detections[i].photcode ; 192 198 flags[i] = detections[i].flags ; 193 199 zp[i] = detections[i].zp ; … … 207 213 gfits_set_bintable_column (&theader, &ftable, "ippObjID", ippObjID , Ndetections); 208 214 gfits_set_bintable_column (&theader, &ftable, "objID", objID , Ndetections); 215 gfits_set_bintable_column (&theader, &ftable, "photcode", photcode , Ndetections); 209 216 gfits_set_bintable_column (&theader, &ftable, "flags", flags , Ndetections); 210 217 gfits_set_bintable_column (&theader, &ftable, "zp", zp , Ndetections); … … 222 229 free (ippObjID ); 223 230 free (objID ); 231 free (photcode ); 224 232 free (flags ); 225 233 free (zp ); -
trunk/Ohana/src/dvopsps/src/insert_detections_dvopsps_catalog.c
r35416 r35578 49 49 // detections[Ndetections]. ((uint64_t)average->catID << 32) + (uint64_t)average->objID; // ippObjID 50 50 detections[Ndetections].objID = average->extID; // objID 51 detections[Ndetections].photcode = measure->photcode; // photcode 51 52 detections[Ndetections].flags = measure->dbFlags; // flags 52 53 detections[Ndetections].zp = code->C * 0.001 + code->K * (measure->airmass - 1) - measure->Mcal; // zp … … 168 169 } 169 170 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"); 171 172 172 173 return TRUE; … … 179 180 int insert_detections_mysql_value (IOBuffer *buffer, Average *average, Measure *measure) { 180 181 181 // XXX I am changing the def of ippObjID if I use the code below182 182 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, // imageID185 // measure->detID, // ippDetectID186 // measure->extID, // detectID187 // ((uint64_t)average->catID * 1000000000) + (uint64_t)average->objID, // ippObjID188 // // NOTE: this is better, but the above is the current ippToPsps value189 // // ((uint64_t)average->catID << 32) + (uint64_t)average->objID, // ippObjID190 // average->extID, // objID191 // measure->dbFlags, // flags192 // code->C * 0.001 + code->K * (measure->airmass - 1) - measure->Mcal, // zp193 // measure->dMcal, // zpErr194 // measure->airmass,195 // pow(10.0, 0.4 * measure->dt), // expTime196 // average->R - measure->dR / 3600., // ra197 // average->D - measure->dR / 3600., // dec198 // measure->dXccd * 0.01 * fabs(measure->pltscale), // estimate of raErr199 // measure->dYccd * 0.01 * fabs(measure->pltscale) // estimate of decErr200 // );201 202 183 PrintIOBuffer (buffer, "(%d, ", measure->imageID); // imageID 203 184 PrintIOBuffer (buffer, "%u, ", measure->detID); // ippDetectID … … 207 188 // ((uint64_t)average->catID << 32) + (uint64_t)average->objID, // ippObjID 208 189 PrintIOBuffer (buffer, "%lu, ", average->extID); // objID 190 PrintIOBuffer (buffer, "%d, ", measure->photcode); // photcode 209 191 PrintIOBuffer (buffer, "%u, ", measure->dbFlags); // flags 210 192
Note:
See TracChangeset
for help on using the changeset viewer.
