Changeset 33887 for branches/eam_branches/ipp-20120405/Ohana
- Timestamp:
- May 17, 2012, 11:14:15 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/Ohana/src/relphot
- Files:
-
- 3 edited
-
include/relphot.h (modified) (1 diff)
-
src/StarOps.c (modified) (3 diffs)
-
src/relphot_client.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h
r33886 r33887 336 336 int ImageSubsetSave(char *filename, ImageSubset *image, off_t Nimage); 337 337 ImageSubset *ImageSubsetLoad(char *filename, off_t *nimage); 338 339 int client_logger_init (); 340 int client_logger_message (char *format,...); 341 -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/StarOps.c
r33886 r33887 354 354 int Next = 0; 355 355 int haveSynth = FALSE; 356 357 int forceSynth = FALSE; 358 int forceSynthEntry = -1; 359 356 360 int haveUbercal = FALSE; 357 361 … … 425 429 } 426 430 } 427 // ignore SYNTH photocdes until PASS == 4 (where we also accept saturated stars) 431 432 // Blindly accepth the SYNTH mags if we are above saturation, otherwise, 433 // ignore SYNTH photcodes until PASS == 4 (where we also accept saturated stars) 428 434 if ((catalog[Nc].measure[m].photcode >= 3001) && (catalog[Nc].measure[m].photcode <= 3005)) { 429 if (pass < 4) { 430 SKIP_THIS_MEAS(Nbad); 431 continue; 435 // something of a hack: force object to use synth values if synth mags >> 436 // saturation (3pi instrumental mags < -15) 437 float MaxMagForceSynth = NAN; 438 switch (catalog[Nc].measure[m].photcode) { 439 case 3001: 440 MaxMagForceSynth = 13.64; 441 break; 442 case 3002: 443 MaxMagForceSynth = 13.76; 444 break; 445 case 3003: 446 MaxMagForceSynth = 13.74; 447 break; 448 case 3004: 449 MaxMagForceSynth = 12.94; 450 break; 451 case 3005: 452 MaxMagForceSynth = 12.01; 453 break; 432 454 } 433 haveSynth = TRUE; 455 if (catalog[Nc].measureT[m].M < MaxMagForceSynth) { 456 forceSynth = TRUE; 457 forceSynthEntry = N; 458 } else { 459 if (pass < 4) { 460 SKIP_THIS_MEAS(Nbad); 461 continue; 462 } 463 haveSynth = TRUE; 464 } 434 465 } 435 466 } … … 476 507 } 477 508 509 if (forceSynth) { 510 // use the single SYNTH value instead of the other mags here 511 myAssert ((forceSynthEntry < N) && (forceSynthEntry >= 0), "programming error"); 512 list[0] = list[forceSynthEntry]; 513 dlist[0] = dlist[forceSynthEntry]; 514 wlist[0] = wlist[forceSynthEntry]; 515 N = 1; 516 } 478 517 liststats (list, dlist, wlist, N, &stats); 479 518 -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/relphot_client.c
r33651 r33887 19 19 // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc) 20 20 initialize_client (argc, argv); 21 client_logger_init (); 21 22 22 23 // load the current sky table (layout of all SkyRegions) … … 33 34 exit (2); 34 35 } 36 client_logger_message ("loaded sky table and defined patch\n"); 35 37 36 38 switch (MODE) { … … 42 44 exit (2); 43 45 } 46 client_logger_message ("loaded catalogs\n"); 47 44 48 BrightCatalog *bcatalog = BrightCatalogMerge (catalog, Ncatalog); 49 client_logger_message ("generated subset data\n"); 50 45 51 if (!BrightCatalogSave (BCATALOG, bcatalog)) { 46 52 fprintf (stderr, "ERROR saving bright catalog from %s\n", CATDIR); 47 53 exit (2); 48 54 } 55 client_logger_message ("generated subset table\n"); 49 56 break; 50 57 } … … 58 65 exit (2); 59 66 } 67 client_logger_message ("loaded image subset data\n"); 60 68 61 69 // save the available image information in the static array in ImageOps.c … … 66 74 snprintf (flatcorrFile, 1024, "%s/flatcorr.fits", CATDIR); 67 75 FlatCorrectionTable *flatcorr = FlatCorrectionLoad (flatcorrFile, VERBOSE); 76 client_logger_message ("loaded flat-field correction data\n"); 68 77 69 78 reload_catalogs (skylist, flatcorr, HOST_ID, HOSTDIR); 79 client_logger_message ("updated catalogs\n"); 70 80 break; 71 81 } … … 73 83 case MODE_UPDATE_OBJECTS: { 74 84 relphot_objects (HOST_ID, HOSTDIR); 85 client_logger_message ("updated objects\n"); 75 86 break; 76 87 } … … 80 91 abort(); 81 92 } 93 client_logger_message ("done with relphot_client\n"); 82 94 83 95 exit (0); 84 96 } 97 98 // I'm getting unlogged errors and failures. I need a log ouput that the clients can 99 // write independent of the master 100 101 static FILE *logfile = NULL; 102 int client_logger_init () { 103 104 char filename[DVO_MAX_PATH]; 105 106 snprintf (filename, DVO_MAX_PATH, "%s/relphot.client.XXXXXX.log", HOSTDIR); 107 108 int fd = mkstemp (filename); 109 if (fd == -1) { 110 fprintf (stderr, "failed to open client logger, exiting\n"); 111 exit (50); 112 } 113 114 logfile = fdopen (fd, "w"); 115 if (!logfile) { 116 fprintf (stderr, "failed to fdopen client logger, exiting\n"); 117 exit (51); 118 } 119 return TRUE; 120 } 121 122 int client_logger_message (char *format,...) { 123 124 va_list argp; 125 126 va_start (argp, format); 127 vfprintf (logfile, format, argp); 128 va_end (argp); 129 return TRUE; 130 }
Note:
See TracChangeset
for help on using the changeset viewer.
