Changeset 35763
- Timestamp:
- Jul 3, 2013, 2:21:52 PM (13 years ago)
- Location:
- trunk/Ohana/src/relastro
- Files:
-
- 15 edited
-
include/relastro.h (modified) (3 diffs)
-
src (modified) (1 prop)
-
src/ImageOps.c (modified) (12 diffs)
-
src/UpdateMeasures.c (modified) (3 diffs)
-
src/UpdateObjectOffsets.c (modified) (4 diffs)
-
src/UpdateObjects.c (modified) (9 diffs)
-
src/args.c (modified) (4 diffs)
-
src/high_speed_catalogs.c (modified) (4 diffs)
-
src/hpm_catalogs.c (modified) (4 diffs)
-
src/load_images.c (modified) (3 diffs)
-
src/relastro.c (modified) (1 diff)
-
src/relastro_client.c (modified) (1 diff)
-
src/relastro_images.c (modified) (1 diff)
-
src/relastro_objects.c (modified) (2 diffs)
-
src/select_images.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/include/relastro.h
r35416 r35763 161 161 162 162 int RESET; 163 int RESET_BAD_IMAGES; 163 164 int NLOOP; 164 165 int NTHREADS; … … 194 195 195 196 int PhotFlagSelect, PhotFlagPoor, PhotFlagBad; 197 198 float MinBadQF; 199 float MaxMeanOffset; 196 200 197 201 int TimeSelect; … … 275 279 int liststats_pos PROTO((double *value, double *dvalue, int N, StatType *stats, int XVERB)); 276 280 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog, int subselect, int hostID, char *hostpath)); 277 int load_images PROTO((FITS_DB *db, SkyList *skylist ));278 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage ));281 int load_images PROTO((FITS_DB *db, SkyList *skylist, int UseFullOverlap)); 282 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap)); 279 283 280 284 void check_permissions (char *basefile); -
trunk/Ohana/src/relastro/src
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130509/Ohana/src/relastro/src (added) merged: 35594,35606,35665,35669,35671,35749
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relastro/src/ImageOps.c
r35105 r35763 222 222 223 223 ID = measure[0].imageID; 224 225 if (catalog[cat].measure) { 226 Measure *measureBig = &catalog[cat].measure[meas]; 227 int TESTPT = FALSE; 228 TESTPT |= (measureBig->imageID == CAT_ID_SRC) && (measureBig->detID == OBJ_ID_SRC); 229 TESTPT |= (measureBig->imageID == CAT_ID_DST) && (measureBig->detID == OBJ_ID_DST); 230 if (TESTPT) { 231 fprintf (stderr, "got test det\n"); 232 } 233 } 234 224 235 idx = getImageByID (ID); 225 236 if (idx == -1) { … … 379 390 } 380 391 392 static int NcatTotal = 0; 393 381 394 // return StarData values for detections in the specified image, converting coordinates from the 382 395 // chip positions: X,Y -> L,M -> P,Q -> R,D … … 445 458 446 459 Measure *measure = &catalog[c].measure[m]; 460 MeasureTiny *measureT = &catalog[c].measureT[m]; 461 462 int TESTPT = FALSE; 463 464 TESTPT |= (measure->imageID == CAT_ID_SRC) && (measure->detID == OBJ_ID_SRC); 465 TESTPT |= (measure->imageID == CAT_ID_DST) && (measure->detID == OBJ_ID_DST); 466 if (TESTPT) { 467 fprintf (stderr, "got test det\n"); 468 } 447 469 448 470 if (USE_FIXED_PIXCOORDS) { … … 454 476 } 455 477 n = measure[0].averef; 478 Average *average = &catalog[c].average[n]; 456 479 457 480 if (moscoords == NULL) { … … 467 490 468 491 // new dR, dD : test 469 dR = 3600.0*(catalog[c].average[n].R - R); 470 dD = 3600.0*(catalog[c].average[n].D - D); 492 dR = 3600.0*(average[0].R - R); 493 dD = 3600.0*(average[0].D - D); 494 495 // make sure detection is on the same side of the 0,360 boundary as the average 496 // this will give some funny results withing ~1 arcsec of the pol 497 if (dR > +180.0*3600.0) { 498 // average on high end of boundary, move star up 499 R += 360.0; 500 dR = 3600.0*(average[0].R - R); 501 } 502 if (dR < -180.0*3600.0) { 503 // average on low end of boundary, move star down 504 R -= 360.0; 505 dR = 3600.0*(average[0].R - R); 506 } 507 508 float csdec = cos(average[0].D * RAD_DEG); 471 509 472 510 // complain if the new location is far from the average location 473 511 // NOTE: This should never happen, or our StarMap tests are not working 474 if (fabs(dR ) > 3.0*ADDSTAR_RADIUS) {512 if (fabs(dR*csdec) > 3.0*ADDSTAR_RADIUS) { 475 513 NoffRAave ++; 476 514 if (VERBOSE2) { 477 fprintf (stderr, "measurement is far from average location (R): %f %f (%f %f )\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);478 dump_measures (& catalog[c].average[n], catalog[c].measure);515 fprintf (stderr, "measurement is far from average location (R): %f %f (%f %f %f)\n", average[0].R, average[0].D, dR, dR*csdec, dD); 516 dump_measures (&average[0], catalog[c].measure); 479 517 } 480 518 // abort (); … … 483 521 NoffDECave ++; 484 522 if (VERBOSE2) { 485 fprintf (stderr, "measurement is far from average location (D): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);486 dump_measures (& catalog[c].average[n], catalog[c].measure);523 fprintf (stderr, "measurement is far from average location (D): %f %f (%f %f)\n", average[0].R, average[0].D, dR, dD); 524 dump_measures (&average[0], catalog[c].measure); 487 525 } 488 526 // abort (); … … 490 528 491 529 // complain if the new location is far from the old location 492 if (fabs(c atalog[c].measureT[m].dR - dR) > DPOS_MAX_ASEC) {530 if (fabs(csdec*(measure[0].dR - dR)) > DPOS_MAX_ASEC) { 493 531 NoffRAori ++; 494 532 if (VERBOSE2) { 495 fprintf (stderr, "measurement is far from original location (R): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);496 dump_measures (& catalog[c].average[n], catalog[c].measure);533 fprintf (stderr, "measurement moves far from original location (R): %f %f (%f %f %f %f)\n", average[0].R, average[0].D, measure[0].dR, dR, csdec*(measure[0].dR - dR), dD); 534 dump_measures (&average[0], catalog[c].measure); 497 535 } 498 536 // abort(); … … 501 539 NoffDECori ++; 502 540 if (VERBOSE2) { 503 fprintf (stderr, "measurement is far from original location (D): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);504 dump_measures (& catalog[c].average[n], catalog[c].measure);541 fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f %f)\n", average[0].R, average[0].D, dR, measure[0].dD, dD); 542 dump_measures (&average[0], catalog[c].measure); 505 543 } // abort(); 506 544 } … … 511 549 measure[0].dR = dR; 512 550 measure[0].dD = dD; 551 measureT[0].dR = dR; 552 measureT[0].dD = dD; 513 553 514 if (measure[0].dR > +180.0*3600.0) {515 // average on high end of boundary, move star up516 R += 360.0;517 measure[0].dR = 3600.0*(catalog[c].average[n].R - R);518 }519 if (measure[0].dR < -180.0*3600.0) {520 // average on low end of boundary, move star down521 R -= 360.0;522 measure[0].dR = 3600.0*(catalog[c].average[n].R - R);523 }524 525 554 // set the systematic error for this image: 526 555 measure[0].dRsys = ToShortPixels(dPosSys); 527 } 556 measureT[0].dRsys = ToShortPixels(dPosSys); 557 } 558 559 NcatTotal += nPos; 528 560 529 561 int Noff = NoffRAave + NoffDECave + NoffRAori + NoffDECori; … … 531 563 saveOffsets (dPos, nPos, im); 532 564 533 // XXX this function should probably update the average positions as well.534 535 565 return; 566 } 567 568 void printNcatTotal () { 569 fprintf (stderr, "NcatTotal: %d\n", NcatTotal); 536 570 } 537 571 … … 1013 1047 } 1014 1048 1049 // if (MinBadQF > 0.0) { 1050 // if (measure[0].psfQF < MinBadQF) return FALSE; 1051 // } 1052 1015 1053 /* select measurements by time */ 1016 1054 if (TimeSelect) { … … 1075 1113 } 1076 1114 1115 if (MinBadQF > 0.0) { 1116 if (measure[0].psfQF < MinBadQF) return FALSE; 1117 } 1118 1077 1119 /* select measurements by time */ 1078 1120 if (TimeSelect) { -
trunk/Ohana/src/relastro/src/UpdateMeasures.c
r33652 r35763 1 1 # include "relastro.h" 2 3 void printNcatTotal (); 2 4 3 5 // this function operates on Measure, not MeasureTiny … … 13 15 ID_IMAGE_ASTROM_SKIP | 14 16 ID_IMAGE_ASTROM_FEW; 17 18 if (RESET_BAD_IMAGES) badImage = 0; 15 19 16 20 image = getimages (&Nimage, NULL); … … 28 32 } 29 33 34 printNcatTotal (); 35 30 36 return (TRUE); 31 37 } -
trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c
r35494 r35763 65 65 freeImageBins (1); 66 66 67 if (!UPDATE) { 68 dvo_catalog_unlock (&catalog); 69 dvo_catalog_free (&catalog); 70 continue; 71 } 72 67 73 // write the updated detections to disk 68 74 save_catalogs (&catalog, 1); … … 85 91 } 86 92 87 int i ;93 int i, j; 88 94 for (i = 0; i < table->Nhosts; i++) { 95 96 if (sky->Nregions < table->Nhosts) { 97 // do any of the regions want this host? 98 int wantThisHost = FALSE; 99 for (j = 0; j < sky->Nregions; j++) { 100 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) { 101 wantThisHost = TRUE; 102 break; 103 } 104 } 105 if (!wantThisHost) { 106 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname); 107 continue; 108 } 109 } 89 110 90 111 // ensure that the paths are absolute path names … … 113 134 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 114 135 if (RESET) { snprintf (tmpline, 1024, "%s -reset", command); strcpy (command, tmpline); } 136 if (UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); } 137 138 if (RESET_BAD_IMAGES) { snprintf (tmpline, 1024, "%s -reset-bad-images", command); strcpy (command, tmpline); } 139 115 140 if (ImagSelect) { snprintf (tmpline, 1024, "%s -instmag %f %f", command, ImagMin, ImagMax); strcpy (command, tmpline); } 116 141 if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue); strcpy (command, tmpline); } … … 127 152 if (PhotFlagPoor) { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor); strcpy (command, tmpline); } 128 153 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 154 155 if (MinBadQF > 0.0) { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f", command, MinBadQF); strcpy (command, tmpline); } 156 if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset %f", command, MaxMeanOffset); strcpy (command, tmpline); } 129 157 130 158 if (TimeSelect) { -
trunk/Ohana/src/relastro/src/UpdateObjects.c
r35416 r35763 48 48 PMFit fitAve, fitPM, fitPAR, fit; 49 49 time_t T2000; 50 off_t Nave, Npm, Npar, Nskip ;51 off_t NaveSum, NpmSum, NparSum, NskipSum ;50 off_t Nave, Npm, Npar, Nskip, Noffset; 51 off_t NaveSum, NpmSum, NparSum, NskipSum, NoffSum; 52 52 double Tmin, Tmax, Tmean, Trange; 53 53 … … 80 80 } 81 81 82 NaveSum = NparSum = NpmSum = N skipSum = 0;82 NaveSum = NparSum = NpmSum = NoffSum = NskipSum = 0; 83 83 for (i = 0; i < Ncatalog; i++) { 84 84 85 85 if (VERBOSE2) fprintf (stderr, "astrometrize catalog %d : "OFF_T_FMT" ave, "OFF_T_FMT" meas\n", i, catalog[i].Naverage, catalog[i].Nmeasure); 86 86 87 Nave = Npar = Npm = Nskip = 0;87 Nave = Npar = Npm = Nskip = Noffset = 0; 88 88 for (j = 0; j < catalog[i].Naverage; j++) { 89 89 /* calculate the average value of R,D for a single star */ 90 90 91 91 XVERB = FALSE; 92 fitAve.chisq = NAN; 93 fitPM.chisq = NAN; 94 fitPAR.chisq = NAN; 92 95 93 96 if (catalog[i].average[j].Nmeasure == 0) { … … 118 121 119 122 // does the measurement pass the supplied filtering constraints? 120 if (!MeasFilterTestTiny(&measure[k], FALSE)) { 123 // MeasFilterTestTiny does not test psfQF 124 int keepMeasure = measureBig ? MeasFilterTest(&measureBig[k], FALSE) : MeasFilterTestTiny(&measure[k], FALSE); 125 if (!keepMeasure) { 121 126 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ; 122 127 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; } … … 198 203 Trange = Tmax - Tmin; 199 204 if (Trange < PM_DT_MIN) mode = FIT_AVERAGE; 200 if (( mode == FIT_PM_ONLY) && (N <PM_TOOFEW)) mode = FIT_AVERAGE;205 if (((mode == FIT_PM_ONLY) || (mode == FIT_PM_AND_PAR)) && (N <= PM_TOOFEW)) mode = FIT_AVERAGE; 201 206 202 207 if (FIT_TARGET == TARGET_HIGH_SPEED) { … … 265 270 float parRange = hypot (dXRange, dYRange); 266 271 267 if (parRange >= PAR_FACTOR_MIN) { 272 # define PAR_TOOFEW 5 273 if ((parRange >= PAR_FACTOR_MIN) && (N > PAR_TOOFEW)) { 268 274 FitPMandPar (&fitPAR, X, dX, Y, dY, T, pX, pY, N, XVERB); 275 if (XVERB) fprintf (stderr, "fitted PM+PAR: %f - %f : %f %f : %f %f : %f %f : %f vs %f vs %f\n", Tmin, Tmax, fitPAR.Ro, fitPAR.Do, fitPAR.uR, fitPAR.uD, fitPAR.p, fitPAR.dp, fitPAR.chisq, fitPM.chisq, fitAve.chisq); 276 269 277 XY_to_RD (&fitPAR.Ro, &fitPAR.Do, fitPAR.Ro, fitPAR.Do, &coords); 270 278 catalog[i].average[j].flags |= ID_STAR_FIT_PAR; … … 315 323 break; 316 324 } 317 if (XVERB) fprintf (stderr, "%f %f -> %f %f (%f,%f) pm=(%f %f) \n",325 if (XVERB) fprintf (stderr, "%f %f -> %f %f (%f,%f) pm=(%f %f) plx=(%f +/- %f)\n", 318 326 catalog[i].average[j].R, 319 327 catalog[i].average[j].D, … … 321 329 3600*(catalog[i].average[j].R - fit.Ro), 322 330 3600*(catalog[i].average[j].D - fit.Do), 323 fit.uR, 324 fit.uD); 331 fit.uR, fit.uD, fit.p, fit.dp); 325 332 326 333 // make sure that the fit succeeded … … 340 347 continue; 341 348 } 349 350 // what is the offset relative to the mean fit position? 351 coords.crval1 = catalog[i].average[j].R; 352 coords.crval2 = catalog[i].average[j].D; 353 354 double dXoff, dYoff; 355 RD_to_XY (&dXoff, &dYoff, fit.Ro, fit.Do, &coords); 356 float dPos = hypot (dXoff, dYoff); 357 if (dPos > MaxMeanOffset) { 358 if (Noffset < 100) { 359 fprintf (stderr, "(%f,%f) -> (%f,%f) (%f,%f)\n", coords.crval1, coords.crval2, fit.Ro, fit.Do, dXoff, dYoff); 360 } 361 Noffset ++; 362 continue; 363 } 364 342 365 343 366 // the measure fields must be updated before the average fields … … 385 408 NparSum += Npar; 386 409 NskipSum += Nskip; 387 if (VERBOSE) fprintf (stderr, "catalog %d : "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT"\n", i, Nave, Npm, Npar, Nskip); 410 NoffSum += Noffset; 411 if (VERBOSE) fprintf (stderr, "catalog %d : "OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par : Nskip "OFF_T_FMT", Noffset "OFF_T_FMT"\n", i, Nave, Npm, Npar, Nskip, Noffset); 388 412 } 389 413 390 if (VERBOSE) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT" \n", (NaveSum + NpmSum + NparSum), NaveSum, NpmSum, NparSum, NskipSum);414 if (VERBOSE) fprintf (stderr, "fitted "OFF_T_FMT" objects ("OFF_T_FMT" ave, "OFF_T_FMT" pm, "OFF_T_FMT" par), skipped "OFF_T_FMT", "OFF_T_FMT" have too large an offset\n", (NaveSum + NpmSum + NparSum), NaveSum, NpmSum, NparSum, NskipSum, NoffSum); 391 415 return (TRUE); 392 416 } -
trunk/Ohana/src/relastro/src/args.c
r35416 r35763 315 315 } 316 316 317 RESET_BAD_IMAGES = FALSE; 318 if ((N = get_argument (argc, argv, "-reset-bad-images"))) { 319 remove_argument (N, &argc, argv); 320 RESET_BAD_IMAGES = TRUE; 321 } 322 317 323 UPDATE = FALSE; 318 324 if ((N = get_argument (argc, argv, "-update"))) { … … 379 385 remove_argument (N, &argc, argv); 380 386 PhotFlagPoor = atoi (argv[N]); 387 remove_argument (N, &argc, argv); 388 } 389 390 MinBadQF = 0.0; 391 if ((N = get_argument (argc, argv, "-min-bad-psfqf"))) { 392 remove_argument (N, &argc, argv); 393 MinBadQF = atof (argv[N]); 394 remove_argument (N, &argc, argv); 395 } 396 397 MaxMeanOffset = 10.0; 398 if ((N = get_argument (argc, argv, "-max-mean-offset"))) { 399 remove_argument (N, &argc, argv); 400 MaxMeanOffset = atof (argv[N]); 381 401 remove_argument (N, &argc, argv); 382 402 } … … 626 646 } 627 647 648 RESET_BAD_IMAGES = FALSE; 649 if ((N = get_argument (argc, argv, "-reset-bad-images"))) { 650 remove_argument (N, &argc, argv); 651 RESET_BAD_IMAGES = TRUE; 652 } 653 628 654 UPDATE = FALSE; 629 655 if ((N = get_argument (argc, argv, "-update"))) { 630 656 remove_argument (N, &argc, argv); 631 657 UPDATE = TRUE; 632 }633 634 // do not hold the lock on the Image table for relastro_client -update-offsets635 if (FIT_TARGET == TARGET_UPDATE_OFFSETS) {636 UPDATE = FALSE;637 658 } 638 659 … … 675 696 remove_argument (N, &argc, argv); 676 697 PhotFlagPoor = atoi (argv[N]); 698 remove_argument (N, &argc, argv); 699 } 700 701 MinBadQF = 0.0; 702 if ((N = get_argument (argc, argv, "-min-bad-psfqf"))) { 703 remove_argument (N, &argc, argv); 704 MinBadQF = atof (argv[N]); 705 remove_argument (N, &argc, argv); 706 } 707 708 MaxMeanOffset = 10.0; 709 if ((N = get_argument (argc, argv, "-max-mean-offset"))) { 710 remove_argument (N, &argc, argv); 711 MaxMeanOffset = atof (argv[N]); 677 712 remove_argument (N, &argc, argv); 678 713 } -
trunk/Ohana/src/relastro/src/high_speed_catalogs.c
r35105 r35763 80 80 // CATDIR is supplied globally 81 81 # define DEBUG 1 82 int high_speed_catalogs_parallel (SkyList *sky list) {82 int high_speed_catalogs_parallel (SkyList *sky) { 83 83 84 84 // launch the setphot_client jobs to the parallel hosts 85 85 86 86 // load the list of hosts 87 HostTable *table = HostTableLoad (CATDIR, sky list->hosts);87 HostTable *table = HostTableLoad (CATDIR, sky->hosts); 88 88 if (!table) { 89 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky list->hosts, CATDIR);89 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 90 90 exit (1); 91 91 } … … 98 98 if (PARALLEL_OUTPUT) { 99 99 // load the list of hosts 100 tableOut = HostTableLoad (HIGH_SPEED_DIR, sky list->hosts);100 tableOut = HostTableLoad (HIGH_SPEED_DIR, sky->hosts); 101 101 if (!tableOut) { 102 fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", sky list->hosts, HIGH_SPEED_DIR);102 fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", sky->hosts, HIGH_SPEED_DIR); 103 103 exit (1); 104 104 } … … 109 109 } 110 110 111 int i ;111 int i, j; 112 112 for (i = 0; i < table->Nhosts; i++) { 113 114 if (sky->Nregions < table->Nhosts) { 115 // do any of the regions want this host? 116 int wantThisHost = FALSE; 117 for (j = 0; j < sky->Nregions; j++) { 118 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) { 119 wantThisHost = TRUE; 120 break; 121 } 122 } 123 if (!wantThisHost) { 124 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname); 125 continue; 126 } 127 } 113 128 114 129 // ensure that the paths are absolute path names … … 163 178 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 164 179 180 if (MinBadQF > 0.0) { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f", command, MinBadQF); strcpy (command, tmpline); } 181 if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset %f", command, MaxMeanOffset); strcpy (command, tmpline); } 182 165 183 if (WHERE_A[0]) { snprintf (tmpline, 1024, "%s -D WHERE_A \"%s\"", command, WHERE_A); strcpy (command, tmpline); } 166 184 if (WHERE_B[0]) { snprintf (tmpline, 1024, "%s -D WHERE_B \"%s\"", command, WHERE_B); strcpy (command, tmpline); } -
trunk/Ohana/src/relastro/src/hpm_catalogs.c
r35416 r35763 78 78 // CATDIR is supplied globally 79 79 # define DEBUG 1 80 int hpm_catalogs_parallel (SkyList *sky list) {80 int hpm_catalogs_parallel (SkyList *sky) { 81 81 82 82 // launch the setphot_client jobs to the parallel hosts 83 83 84 84 // load the list of hosts 85 HostTable *table = HostTableLoad (CATDIR, sky list->hosts);85 HostTable *table = HostTableLoad (CATDIR, sky->hosts); 86 86 if (!table) { 87 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky list->hosts, CATDIR);87 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 88 88 exit (1); 89 89 } … … 96 96 if (PARALLEL_OUTPUT) { 97 97 // load the list of hosts 98 tableOut = HostTableLoad (HIGH_SPEED_DIR, sky list->hosts);98 tableOut = HostTableLoad (HIGH_SPEED_DIR, sky->hosts); 99 99 if (!tableOut) { 100 fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", sky list->hosts, HIGH_SPEED_DIR);100 fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", sky->hosts, HIGH_SPEED_DIR); 101 101 exit (1); 102 102 } … … 107 107 } 108 108 109 int i ;109 int i, j; 110 110 for (i = 0; i < table->Nhosts; i++) { 111 112 if (sky->Nregions < table->Nhosts) { 113 // do any of the regions want this host? 114 int wantThisHost = FALSE; 115 for (j = 0; j < sky->Nregions; j++) { 116 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) { 117 wantThisHost = TRUE; 118 break; 119 } 120 } 121 if (!wantThisHost) { 122 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname); 123 continue; 124 } 125 } 111 126 112 127 // ensure that the paths are absolute path names … … 161 176 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 162 177 178 if (MinBadQF > 0.0) { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f", command, MinBadQF); strcpy (command, tmpline); } 179 if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset %f", command, MaxMeanOffset); strcpy (command, tmpline); } 180 163 181 if (TimeSelect) { 164 182 char *tstart = ohana_sec_to_date (TSTART); -
trunk/Ohana/src/relastro/src/load_images.c
r33652 r35763 7 7 fprintf (stderr, MSG, __VA_ARGS__); } 8 8 9 int load_images (FITS_DB *db, SkyList *skylist ) {9 int load_images (FITS_DB *db, SkyList *skylist, int UseFullOverlap) { 10 10 11 11 Image *image, *subset; … … 25 25 26 26 // select the images which overlap the selected sky regions 27 subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset );27 subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset, UseFullOverlap); 28 28 MARKTIME(" select images: %f sec\n", dtime); 29 29 … … 35 35 36 36 /* unlock, if we can (else, unlocked below) */ 37 if (!UPDATE) dvo_image_unlock (db); 37 int unlockImages = !UPDATE || (FIT_TARGET == TARGET_UPDATE_OFFSETS); 38 if (unlockImages) dvo_image_unlock (db); 38 39 39 40 return TRUE; -
trunk/Ohana/src/relastro/src/relastro.c
r35416 r35763 39 39 // iterate over catalogs to make detection coordinates consistant 40 40 UpdateObjectOffsets (skylist, 0, NULL); 41 exit (0); 41 42 42 43 default: -
trunk/Ohana/src/relastro/src/relastro_client.c
r35416 r35763 77 77 78 78 /* load regions and images based on specified sky patch (default depth) */ 79 load_images (&db, skylist );79 load_images (&db, skylist, FALSE); 80 80 81 81 // // load the image subset table from the specified location -
trunk/Ohana/src/relastro/src/relastro_images.c
r33652 r35763 20 20 MARKTIME("load image data: %f sec\n", dtime); 21 21 22 /* load regions and images based on specified sky patch (default depth) */23 load_images (&db, skylist );22 /* load regions and images based on specified sky patch (default depth) (require full overlap) */ 23 load_images (&db, skylist, TRUE); 24 24 MARKTIME("load images: %f sec\n", dtime); 25 25 -
trunk/Ohana/src/relastro/src/relastro_objects.c
r35105 r35763 110 110 } 111 111 112 int i ;112 int i, j; 113 113 for (i = 0; i < table->Nhosts; i++) { 114 115 if (sky->Nregions < table->Nhosts) { 116 // do any of the regions want this host? 117 int wantThisHost = FALSE; 118 for (j = 0; j < sky->Nregions; j++) { 119 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) { 120 wantThisHost = TRUE; 121 break; 122 } 123 } 124 if (!wantThisHost) { 125 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname); 126 continue; 127 } 128 } 114 129 115 130 // ensure that the paths are absolute path names … … 154 169 if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); } 155 170 if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); } 156 if (PhotFlagSelect) { snprintf (tmpline, 1024, "%s +photflags", command); strcpy (command, tmpline); }157 if (PhotFlagBad) { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad); strcpy (command, tmpline); }158 if (PhotFlagPoor) { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor); strcpy (command, tmpline); }171 if (PhotFlagSelect) { snprintf (tmpline, 1024, "%s +photflags", command); strcpy (command, tmpline); } 172 if (PhotFlagBad) { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad); strcpy (command, tmpline); } 173 if (PhotFlagPoor) { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor); strcpy (command, tmpline); } 159 174 // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values 175 176 if (MinBadQF > 0.0) { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f", command, MinBadQF); strcpy (command, tmpline); } 177 if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset %f", command, MaxMeanOffset); strcpy (command, tmpline); } 160 178 161 179 if (TimeSelect) { -
trunk/Ohana/src/relastro/src/select_images.c
r34088 r35763 22 22 fprintf (stderr, MSG, __VA_ARGS__); } 23 23 24 Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage ) {24 Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap) { 25 25 26 26 Image *image; … … 122 122 for (i = 0; i < Ntimage; i++) { 123 123 124 if (FALSE && !strncmp(timage[i].name, "o5479g0238o", 10)) { 125 fprintf (stderr, "test image 1\n"); 126 } 127 if (FALSE && !strncmp(timage[i].name, "o6227g0311o", 10)) { 128 fprintf (stderr, "test image 2\n"); 129 } 130 124 131 /* select images by photcode, or equiv photcode, if specified */ 125 132 if (NphotcodesKeep > 0) { 126 133 found = FALSE; 134 // XXX this bit of code excludes DIS mosaics and should be fixed 127 135 for (k = 0; (k < NphotcodesKeep) && !found; k++) { 128 136 if (photcodesKeep[k][0].code == timage[i].photcode) found = TRUE; … … 196 204 if (RmaxImage < RminSkyRegion) continue; 197 205 198 if ( !strncmp(timage[i].name, "o5903g0638o", 10) && (timage[i].photcode == 10355)) {206 if (FALSE && !strncmp(timage[i].name, "o5903g0638o", 10) && (timage[i].photcode == 10355)) { 199 207 fprintf (stderr, "test image\n"); 200 208 } … … 203 211 // images) XXX : if we calibrate the mosaic, require that the full mosaic be inside 204 212 // the region and all of its chips.. 205 # define FULL_OVERLAP 1 206 if (FULL_OVERLAP && strcmp(&timage[i].coords.ctype[4], "-DIS")) { 213 if (UseFullOverlap && strcmp(&timage[i].coords.ctype[4], "-DIS")) { 207 214 if (RmaxImage > UserPatch.Rmax) continue; 208 215 if (RminImage < UserPatch.Rmin) continue;
Note:
See TracChangeset
for help on using the changeset viewer.
