Changeset 35671
- Timestamp:
- Jun 18, 2013, 12:41:02 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130509/Ohana/src/relastro
- Files:
-
- 14 edited
-
include/relastro.h (modified) (2 diffs)
-
src/ImageOps.c (modified) (6 diffs)
-
src/UpdateMeasures.c (modified) (3 diffs)
-
src/UpdateObjectOffsets.c (modified) (3 diffs)
-
src/UpdateObjects.c (modified) (1 diff)
-
src/args.c (modified) (2 diffs)
-
src/high_speed_catalogs.c (modified) (3 diffs)
-
src/hpm_catalogs.c (modified) (3 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) (1 diff)
-
src/select_images.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/relastro/include/relastro.h
r35669 r35671 161 161 162 162 int RESET; 163 int RESET_BAD_IMAGES; 163 164 int NLOOP; 164 165 int NTHREADS; … … 278 279 int liststats_pos PROTO((double *value, double *dvalue, int N, StatType *stats, int XVERB)); 279 280 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog, int subselect, int hostID, char *hostpath)); 280 int load_images PROTO((FITS_DB *db, SkyList *skylist ));281 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)); 282 283 283 284 void check_permissions (char *basefile); -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/ImageOps.c
r35669 r35671 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) { … … 517 539 NoffDECori ++; 518 540 if (VERBOSE2) { 519 fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f )\n", average[0].R, average[0].D, dR, measure[0].dD, dD);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); 520 542 dump_measures (&average[0], catalog[c].measure); 521 543 } // abort(); … … 535 557 } 536 558 559 NcatTotal += nPos; 560 537 561 int Noff = NoffRAave + NoffDECave + NoffRAori + NoffDECori; 538 562 if (VERBOSE && (Noff > 0)) fprintf (stderr, "Noff ave RA %d, Noff ave DEC %d, Noff ori RA %d, Noff ori DEC %d\n", NoffRAave, NoffDECave, NoffRAori, NoffDECori); … … 540 564 541 565 return; 566 } 567 568 void printNcatTotal () { 569 fprintf (stderr, "NcatTotal: %d\n", NcatTotal); 542 570 } 543 571 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateMeasures.c
r33652 r35671 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 } -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateObjectOffsets.c
r35669 r35671 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); } -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/UpdateObjects.c
r35669 r35671 356 356 float dPos = hypot (dXoff, dYoff); 357 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 } 358 361 Noffset ++; 359 362 continue; -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/args.c
r35669 r35671 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"))) { … … 640 646 } 641 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 642 654 UPDATE = FALSE; 643 655 if ((N = get_argument (argc, argv, "-update"))) { 644 656 remove_argument (N, &argc, argv); 645 657 UPDATE = TRUE; 646 }647 648 // do not hold the lock on the Image table for relastro_client -update-offsets649 if (FIT_TARGET == TARGET_UPDATE_OFFSETS) {650 UPDATE = FALSE;651 658 } 652 659 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/high_speed_catalogs.c
r35669 r35671 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 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/hpm_catalogs.c
r35669 r35671 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 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/load_images.c
r33652 r35671 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; -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro.c
r35416 r35671 39 39 // iterate over catalogs to make detection coordinates consistant 40 40 UpdateObjectOffsets (skylist, 0, NULL); 41 exit (0); 41 42 42 43 default: -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_client.c
r35416 r35671 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 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_images.c
r33652 r35671 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 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/relastro_objects.c
r35669 r35671 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 -
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/select_images.c
r34088 r35671 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.
