Changeset 35102
- Timestamp:
- Feb 6, 2013, 3:22:03 PM (13 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 10 edited
-
include/dvo.h (modified) (2 diffs)
-
include/dvodb.h (modified) (2 diffs)
-
src/HostTable.c (modified) (5 diffs)
-
src/dbExtractImages.c (modified) (1 diff)
-
src/dbExtractMeasures.c (modified) (1 diff)
-
src/dbFields.c (modified) (2 diffs)
-
src/dvo_catalog.c (modified) (1 diff)
-
src/dvo_convert_PS1_V4.c (modified) (2 diffs)
-
src/dvo_tiny_values.c (modified) (1 diff)
-
src/skyregion_ops.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r34844 r35102 367 367 float Xccd; 368 368 float Yccd; 369 float Xfix; 370 float Yfix; 369 371 float dt; 370 372 int t; … … 658 660 SkyTable *SkyTableLoadOptimal PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE)); 659 661 int SkyTableSetDepth PROTO((SkyTable *sky, int depth)); 662 SkyList *SkyRegionByCPT PROTO((SkyTable *table, char *filename)); 660 663 SkyList *SkyRegionByPoint PROTO((SkyTable *table, int depth, double ra, double dec)); 661 664 SkyList *SkyListByPoint PROTO((SkyTable *table, double ra, double dec)); -
trunk/Ohana/src/libdvo/include/dvodb.h
r34749 r35102 122 122 MEAS_XCCD_ERR, 123 123 MEAS_YCCD_ERR, 124 MEAS_X OFF,125 MEAS_Y OFF,124 MEAS_XFIX, 125 MEAS_YFIX, 126 126 MEAS_POS_SYS_ERR, 127 127 MEAS_XMOSAIC, … … 250 250 IMAGE_Y_ERR_SYS, 251 251 IMAGE_MAG_ERR_SYS, 252 IMAGE_UBERCAL_DIST, 252 253 IMAGE_NFIT_PHOTOM, 253 254 IMAGE_NFIT_ASTROM, -
trunk/Ohana/src/libdvo/src/HostTable.c
r33963 r35102 243 243 Nmax ++; 244 244 245 // need the list of connected hosts for exit test below 246 int Nrunning = 0; 247 for (i = 0; i < table->Nhosts; i++) { 248 if (!table->hosts[i].pid) continue; // any unconnected hosts should be skipped 249 Nrunning ++; 250 } 251 245 252 int Nfound = 0; 246 253 … … 262 269 // we have some sockets to check, check sockets for all hosts 263 270 for (i = 0; (status > 0) && (i < table->Nhosts); i++) { 271 if (!table->hosts[i].pid) continue; // any unconnected hosts should be skipped 272 264 273 if (FALSE && FD_ISSET (table->hosts[i].stdio[HOST_STDIN], &wtSet)) { 265 274 // this host is waiting for input : this is an error, so exit … … 268 277 } 269 278 270 if ( FD_ISSET (table->hosts[i].stdio[HOST_STDOUT], &rdSet)) {279 if ((table->hosts[i].stdio[HOST_STDOUT] > 0) && FD_ISSET (table->hosts[i].stdio[HOST_STDOUT], &rdSet)) { 271 280 // this host has waiting output : read to buffer, and dump if necessary 272 281 ReadtoIOBuffer (&table->hosts[i].stdout, table->hosts[i].stdio[HOST_STDOUT]); … … 282 291 } 283 292 284 if ( FD_ISSET (table->hosts[i].stdio[HOST_STDERR], &rdSet)) {293 if ((table->hosts[i].stdio[HOST_STDERR] > 0) && FD_ISSET (table->hosts[i].stdio[HOST_STDERR], &rdSet)) { 285 294 // this host has waiting output : read to buffer, and dump if necessary 286 295 ReadtoIOBuffer (&table->hosts[i].stderr, table->hosts[i].stdio[HOST_STDERR]); … … 361 370 } 362 371 Nfound ++; 363 if (Nfound == table->Nhosts) goto escape; // we've harvested all jobs372 if (Nfound == Nrunning) goto escape; // we've harvested all jobs 364 373 } 365 374 } -
trunk/Ohana/src/libdvo/src/dbExtractImages.c
r31635 r35102 328 328 break; 329 329 330 case IMAGE_UBERCAL_DIST: 331 value.Int = image[N].ubercalDist; 332 break; 333 330 334 case IMAGE_NFIT_PHOTOM: 331 335 value.Int = image[N].nFitPhotom; -
trunk/Ohana/src/libdvo/src/dbExtractMeasures.c
r34749 r35102 443 443 # endif 444 444 break; 445 case MEAS_X OFF: /* OK */446 value.Flt = measure[0].X off;447 break; 448 case MEAS_Y OFF: /* OK */449 value.Flt = measure[0].Y off;445 case MEAS_XFIX: /* OK */ 446 value.Flt = measure[0].Xfix; 447 break; 448 case MEAS_YFIX: /* OK */ 449 value.Flt = measure[0].Yfix; 450 450 break; 451 451 case MEAS_XCCD_ERR: /* OK */ -
trunk/Ohana/src/libdvo/src/dbFields.c
r34749 r35102 217 217 if (!strcasecmp (fieldName, "XCCD:ERR")) ESCAPE (MEAS_XCCD_ERR, MAG_NONE, OPIHI_FLT); 218 218 if (!strcasecmp (fieldName, "YCCD:ERR")) ESCAPE (MEAS_YCCD_ERR, MAG_NONE, OPIHI_FLT); 219 if (!strcasecmp (fieldName, "X OFF")) ESCAPE (MEAS_XOFF, MAG_NONE, OPIHI_FLT);220 if (!strcasecmp (fieldName, "Y OFF")) ESCAPE (MEAS_YOFF, MAG_NONE, OPIHI_FLT);219 if (!strcasecmp (fieldName, "XFIX")) ESCAPE (MEAS_XFIX, MAG_NONE, OPIHI_FLT); 220 if (!strcasecmp (fieldName, "YFIX")) ESCAPE (MEAS_YFIX, MAG_NONE, OPIHI_FLT); 221 221 if (!strcasecmp (fieldName, "POS_SYS_ERR")) ESCAPE (MEAS_POS_SYS_ERR, MAG_NONE, OPIHI_FLT); 222 222 if (!strcasecmp (fieldName, "XMOSAIC")) ESCAPE (MEAS_XMOSAIC, MAG_NONE, OPIHI_FLT); … … 473 473 if (!strcasecmp (fieldName, "dY_SYS" )) ESCAPE (IMAGE_Y_ERR_SYS, MAG_NONE, OPIHI_FLT); 474 474 if (!strcasecmp (fieldName, "dM_SYS" )) ESCAPE (IMAGE_MAG_ERR_SYS,MAG_NONE, OPIHI_FLT); 475 476 if (!strcasecmp (fieldName, "UBERCAL_DIST")) ESCAPE (IMAGE_UBERCAL_DIST,MAG_NONE, OPIHI_INT); 477 if (!strcasecmp (fieldName, "UCDIST")) ESCAPE (IMAGE_UBERCAL_DIST,MAG_NONE, OPIHI_INT); 478 475 479 if (!strcasecmp (fieldName, "NFIT_PHOTOM")) ESCAPE (IMAGE_NFIT_PHOTOM,MAG_NONE, OPIHI_INT); 476 480 if (!strcasecmp (fieldName, "NFIT_ASTROM")) ESCAPE (IMAGE_NFIT_ASTROM,MAG_NONE, OPIHI_INT); -
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r34749 r35102 161 161 measure->Xccd = NAN; 162 162 measure->Yccd = NAN; 163 measure->X off = 0.0;164 measure->Y off = 0.0;163 measure->Xfix = NAN; 164 measure->Yfix = NAN; 165 165 166 166 measure->Sky = NAN; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
r34749 r35102 31 31 out[i].Xccd = in[i].Xccd; 32 32 out[i].Yccd = in[i].Yccd; 33 out[i].X off = in[i].Xoff;34 out[i].Y off = in[i].Yoff;33 out[i].Xfix = in[i].Xfix; 34 out[i].Yfix = in[i].Yfix; 35 35 out[i].Sky = in[i].Sky; 36 36 out[i].dSky = in[i].dSky; … … 94 94 out[i].Xccd = in[i].Xccd; 95 95 out[i].Yccd = in[i].Yccd; 96 out[i].Xfix = in[i].Xfix; 97 out[i].Yfix = in[i].Yfix; 96 98 out[i].Sky = in[i].Sky; 97 99 out[i].dSky = in[i].dSky; -
trunk/Ohana/src/libdvo/src/dvo_tiny_values.c
r34088 r35102 20 20 measureT[0].Xccd = measure[0].Xccd; 21 21 measureT[0].Yccd = measure[0].Yccd; 22 measureT[0].Xfix = measure[0].Xfix; 23 measureT[0].Yfix = measure[0].Yfix; 22 24 measureT[0].t = measure[0].t; 23 25 measureT[0].dt = measure[0].dt; -
trunk/Ohana/src/libdvo/src/skyregion_ops.c
r33649 r35102 7 7 If the region at the given depth is populated with an image table, then 'image' is TRUE. 8 8 I have defined no accelerators other than the table hierarchy */ 9 10 /* given /path/file.ext return pointer to file.ext */ 11 char *filebasename_ptr (char *name) { 12 13 char *c; 14 15 c = strrchr (name, '/'); 16 if (c) return (c+1); 17 return name; 18 } 19 20 /* find region which matches the named file */ 21 SkyList *SkyRegionByCPT (SkyTable *table, char *filename) { 22 23 int i; 24 SkyList *list; 25 26 ALLOCATE (list, SkyList, 1); 27 ALLOCATE (list[0].regions, SkyRegion *, 1); 28 ALLOCATE (list[0].filename, char *, 1); 29 list[0].Nregions = 0; 30 list[0].ownElements = FALSE; // this list is only holding a view to the elements 31 strcpy (list[0].hosts, table[0].hosts); 32 33 // i'd like to select the region from the given cpt filename, but 34 // in a parallel environment, the filename does not match the canonical name 35 // i select the basename to match 36 37 // we might have been given foo.cpt or just foo: 38 char *tgtbase = filebasename_ptr (filename); 39 int Ntgtbase = strlen(tgtbase); 40 if ((Ntgtbase > 4) && (!strcmp (&tgtbase[Ntgtbase - 4], ".cpt"))) { 41 Ntgtbase -= 4; 42 } 43 44 for (i = 0; i < table[0].Nregions; i++) { 45 char *regbase = filebasename_ptr (table[0].regions[i].name); 46 if (strncmp (regbase, tgtbase, Ntgtbase)) continue; 47 48 list[0].regions[0] = &table[0].regions[i]; 49 list[0].filename[0] = table[0].filename[i]; 50 list[0].Nregions = 1; 51 return (list); 52 } 53 54 free (list[0].regions); 55 free (list[0].filename); 56 free (list); 57 return NULL; 58 } 9 59 10 60 /* find region which overlaps c at given depth (-1 : populated ) */
Note:
See TracChangeset
for help on using the changeset viewer.
