Changeset 36611
- Timestamp:
- Mar 21, 2014, 10:46:28 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140206/Ohana/src
- Files:
-
- 8 edited
-
relastro/src/assign_images.c (modified) (3 diffs)
-
relastro/src/launch_region_hosts.c (modified) (3 diffs)
-
relphot/src/MosaicOps.c (modified) (3 diffs)
-
relphot/src/assign_images.c (modified) (3 diffs)
-
relphot/src/client_logger.c (modified) (2 diffs)
-
relphot/src/launch_region_hosts.c (modified) (2 diffs)
-
relphot/src/relphot_client.c (modified) (1 diff)
-
relphot/src/relphot_parallel_images.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/assign_images.c
r36574 r36611 95 95 } 96 96 97 // Exclude images with crazy astrometry 98 // XXX NOTE : this is gpc1-specific 99 { 100 double dP1 = hypot(image[j].coords.pc1_1, image[j].coords.pc1_2); 101 double dP2 = hypot(image[j].coords.pc2_1, image[j].coords.pc2_2); 102 if (fabs(dP1 - 1.0) > 0.02) continue; 103 if (fabs(dP2 - 1.0) > 0.02) continue; 104 105 double X00, Y00, X10, Y10, X01, Y01; 106 XY_to_LM (&X00, &Y00, 0.0, 0.0, &image[j].coords); 107 XY_to_LM (&X10, &Y10, image[j].NX, 0.0, &image[j].coords); 108 XY_to_LM (&X01, &Y01, 0.0, image[j].NY, &image[j].coords); 109 double dS0 = hypot ((X00 - X10), (Y00 - Y10)); 110 double dS1 = hypot ((X00 - X01), (Y00 - Y01)); 111 if (dS0 > 6000) continue; 112 if (dS1 > 6500) continue; 113 } 114 97 115 // use a reference coordinate for each image to assign to hosts 98 116 // define image center - note the DIS images (mosaic phu) are special … … 104 122 XY_to_RD (&Rc, &Dc, Xc, Yc, &image[j].coords); 105 123 Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0); 124 image[j].RAo = Rc; 125 image[j].DECo = Dc; 106 126 107 127 i = find_host_for_coords (regionHosts, Rc, Dc); … … 241 261 int i; 242 262 263 if (isnan(Rc)) return -1; 264 if (isnan(Dc)) return -1; 265 243 266 for (i = 0; i < regionHosts->Nhosts; i++) { 244 267 -
branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/launch_region_hosts.c
r36591 r36611 55 55 56 56 char command[1024]; 57 snprintf (command, 1024, "relastro -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -minerror %f", 58 filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, MIN_ERROR); 57 snprintf (command, 1024, "relastro -parallel-images %s", filename); 58 strextend (command, "-region-hosts %s", REGION_FILE); 59 strextend (command, "-region-hostID %d", host->hostID); 60 strextend (command, "-D CATDIR %s", CATDIR); 61 strextend (command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat); 62 strextend (command, "-statmode %s", STATMODE); 63 strextend (command, "-minerror %f", MIN_ERROR); 64 strextend (command, "-nloop %d", NLOOP); 65 strextend (command, "-threads %d", NTHREADS); 59 66 60 67 switch (FIT_TARGET) { … … 82 89 if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST); 83 90 91 if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue); 92 if (ImagSelect) strextend (command, "-instmag %f %f", ImagMin, ImagMax); 93 if (PhotFlagSelect) strextend (command, "+photflags"); 94 if (PhotFlagBad) strextend (command, "+photflagbad %d", PhotFlagBad); 95 if (PhotFlagPoor) strextend (command, "+photflagpoor %d", PhotFlagPoor); 96 97 if (MinBadQF > 0.0) strextend (command, "-min-bad-psfqf %f", MinBadQF); 98 if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset %f", MaxMeanOffset); 99 100 if (TimeSelect) { 101 char *tstart = ohana_sec_to_date (TSTART); 102 char *tstop = ohana_sec_to_date (TSTOP); 103 strextend (command, "-time %s %s", tstart, tstop); 104 free (tstart); 105 free (tstop); 106 } 107 84 108 fprintf (stderr, "command: %s\n", command); 85 109 … … 102 126 // remove client is done, go ahead with next client 103 127 check_sync_file (syncfile, 1); 104 clear_sync_file (syncfile);105 128 free (syncfile); 106 129 } -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/MosaicOps.c
r36558 r36611 511 511 /* send results to initGridBins */ 512 512 513 off_t i, j, m, NX, NY ;513 off_t i, j, m, NX, NY, NC, Nc; 514 514 double R, D, Rmid, Dmid; 515 515 double Mcal, dMcal, Xm; 516 517 for (i = 0; i < Nmosaic; i++) { 518 Rmid = Dmid = 0.0; 516 double *Rc, *Dc; 517 518 NC = 100; 519 ALLOCATE (Rc, double, NC); 520 ALLOCATE (Dc, double, NC); 521 522 for (i = 0; i < Nmosaic; i++) { 523 Nc = 0; 524 Rmid = Dmid = NAN; 519 525 Mcal = dMcal = Xm = 0; 520 526 for (j = 0; j < MosaicN_Image[i]; j++) { … … 529 535 NY = image[m].NY; 530 536 XY_to_RD (&R, &D, 0.5*NX, 0.5*NY, &image[m].coords); 531 532 Rmid += R; 533 Dmid += D; 537 R = ohana_normalize_angle_to_midpoint (R, 180.0); 538 539 // Exclude images with crazy astrometry 540 // XXX NOTE : this is gpc1-specific 541 { 542 double dP1 = hypot(image[m].coords.pc1_1, image[m].coords.pc1_2); 543 double dP2 = hypot(image[m].coords.pc2_1, image[m].coords.pc2_2); 544 if (fabs(dP1 - 1.0) > 0.02) continue; 545 if (fabs(dP2 - 1.0) > 0.02) continue; 546 547 double X00, Y00, X10, Y10, X01, Y01; 548 XY_to_LM (&X00, &Y00, 0.0, 0.0, &image[m].coords); 549 XY_to_LM (&X10, &Y10, image[m].NX, 0.0, &image[m].coords); 550 XY_to_LM (&X01, &Y01, 0.0, image[m].NY, &image[m].coords); 551 double dS0 = hypot ((X00 - X10), (Y00 - Y10)); 552 double dS1 = hypot ((X00 - X01), (Y00 - Y01)); 553 if (dS0 > 6000) continue; 554 if (dS1 > 6500) continue; 555 } 556 557 Rc[Nc] = R; 558 Dc[Nc] = D; 559 Nc ++; 560 if (Nc >= NC) { 561 NC += 100; 562 REALLOCATE (Rc, double, NC); 563 REALLOCATE (Dc, double, NC); 564 } 534 565 535 566 Mcal += image[m].Mcal; … … 544 575 image[m].Xm = NAN_S_SHORT; 545 576 } 546 Rmid = Rmid / MosaicN_Image[i]; 547 Dmid = Dmid / MosaicN_Image[i]; 577 if (Nc > 0) { 578 dsort (Rc, Nc); 579 dsort (Dc, Nc); 580 Rmid = Rc[(int)(0.5*Nc)]; 581 Dmid = Dc[(int)(0.5*Nc)]; 582 } 548 583 549 584 strcpy (mosaic[i].coords.ctype, "DEC--TAN"); -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c
r36558 r36611 88 88 } 89 89 90 // Exclude images with crazy astrometry 91 // XXX NOTE : this is gpc1-specific 92 { 93 double dP1 = hypot(image[j].coords.pc1_1, image[j].coords.pc1_2); 94 double dP2 = hypot(image[j].coords.pc2_1, image[j].coords.pc2_2); 95 if (fabs(dP1 - 1.0) > 0.02) continue; 96 if (fabs(dP2 - 1.0) > 0.02) continue; 97 98 double X00, Y00, X10, Y10, X01, Y01; 99 XY_to_LM (&X00, &Y00, 0.0, 0.0, &image[j].coords); 100 XY_to_LM (&X10, &Y10, image[j].NX, 0.0, &image[j].coords); 101 XY_to_LM (&X01, &Y01, 0.0, image[j].NY, &image[j].coords); 102 double dS0 = hypot ((X00 - X10), (Y00 - Y10)); 103 double dS1 = hypot ((X00 - X01), (Y00 - Y01)); 104 if (dS0 > 6000) continue; 105 if (dS1 > 6500) continue; 106 } 107 90 108 // use a reference coordinate for each image to assign to hosts 109 // define image center - note the DIS images (mosaic phu) are special, but we have 110 // already excluded them above. we also save the image centers for reference 111 double Xc, Yc; 91 112 double Rc, Dc; 113 114 Xc = 0.5*image[j].NX; 115 Yc = 0.5*image[j].NY; 116 117 XY_to_RD (&Rc, &Dc, Xc, Yc, &image[j].coords); 118 Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0); 119 image[j].RAo = Rc; 120 image[j].DECo = Dc; 121 92 122 if (MOSAIC_ZEROPT) { 93 123 // use the coords of the associated mosaic to select … … 95 125 Rc = mosaic->coords.crval1; 96 126 Dc = mosaic->coords.crval2; 97 } else {98 99 // define image center - note the DIS images (mosaic phu) are special100 double Xc, Yc;101 Xc = 0.5*image[j].NX;102 Yc = 0.5*image[j].NY;103 104 XY_to_RD (&Rc, &Dc, Xc, Yc, &image[j].coords);105 127 Rc = ohana_normalize_angle_to_midpoint (Rc, 180.0); 106 128 } … … 242 264 int i; 243 265 266 if (isnan(Rc)) return -1; 267 if (isnan(Dc)) return -1; 268 244 269 for (i = 0; i < regionHosts->Nhosts; i++) { 245 270 -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/client_logger.c
r36562 r36611 5 5 6 6 static FILE *logfile = NULL; 7 int client_logger_init ( ) {7 int client_logger_init (char *dirname) { 8 8 9 9 char filename[DVO_MAX_PATH]; 10 10 11 snprintf (filename, DVO_MAX_PATH, "%s/log.rlpc.XXXXXX", HOSTDIR);11 snprintf (filename, DVO_MAX_PATH, "%s/log.rlpc.XXXXXX", dirname); 12 12 13 13 int fd = mkstemp (filename); … … 32 32 vfprintf (logfile, format, argp); 33 33 va_end (argp); 34 35 fflush (logfile); 34 36 return TRUE; 35 37 } -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/launch_region_hosts.c
r36591 r36611 58 58 PhotcodeList, filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR); 59 59 60 if (VERBOSE) strextend (command, "-v"); 61 if (VERBOSE2) strextend (command, "-vv"); 62 if (RESET) strextend (command, "-reset"); 63 if (RESET_ZEROPTS) strextend (command, "-reset-zpts"); 64 if (UPDATE) strextend (command, "-update"); 65 if (MOSAIC_ZEROPT) strextend (command, "-mosaic"); 66 if (FREEZE_IMAGES) strextend (command, "-imfreeze"); 67 if (FREEZE_MOSAICS) strextend (command, "-mosfreeze"); 68 if (!KEEP_UBERCAL) strextend (command, "-reset-ubercal"); 69 if (PARALLEL) strextend (command, "-parallel"); 70 if (PARALLEL_MANUAL) strextend (command, "-parallel-manual"); 71 if (PARALLEL_SERIAL) strextend (command, "-parallel-serial"); 60 if (VERBOSE) strextend (command, "-v"); 61 if (VERBOSE2) strextend (command, "-vv"); 62 if (RESET) strextend (command, "-reset"); 63 if (RESET_ZEROPTS) strextend (command, "-reset-zpts"); 64 if (!KEEP_UBERCAL) strextend (command, "-reset-ubercal"); 65 if (DophotSelect) strextend (command, "-dophot %d", DophotValue); 66 if (ImagSelect) strextend (command, "-instmag %f %f", ImagMin, ImagMax); 67 if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue); 68 if (SyntheticPhotometry) strextend (command, "-synthphot"); 69 70 if (UPDATE) strextend (command, "-update"); 71 if (MOSAIC_ZEROPT) strextend (command, "-mosaic"); 72 if (FREEZE_IMAGES) strextend (command, "-imfreeze"); 73 if (FREEZE_MOSAICS) strextend (command, "-mosfreeze"); 74 if (PARALLEL) strextend (command, "-parallel"); 75 if (PARALLEL_MANUAL) strextend (command, "-parallel-manual"); 76 if (PARALLEL_SERIAL) strextend (command, "-parallel-serial"); 72 77 73 78 // XXX deprecate this if we are happy with the new version … … 94 99 // remote client is done, go ahead with next client 95 100 check_sync_file (syncfile, 1); 96 clear_sync_file (syncfile);97 101 free (syncfile); 98 102 } -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_client.c
r33963 r36611 19 19 // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc) 20 20 initialize_client (argc, argv); 21 client_logger_init ( );21 client_logger_init (HOSTDIR); 22 22 23 23 // load the current sky table (layout of all SkyRegions) -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_images.c
r36590 r36611 19 19 INITTIME; 20 20 21 client_logger_init (CATDIR); 22 21 23 // load the RegionTable (UserRegion should not be used at this level) 22 24 RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE); 23 25 int myHost = regionHosts->index[REGION_HOST_ID]; 24 26 RegionHostFindNeighbors (regionHosts, myHost); 27 client_logger_message ("started parallel images on %s\n", regionHosts->hosts[myHost].hostname); 25 28 26 29 // load the subset images belonging to this host … … 52 55 catalog = load_catalogs (skylist, &Ncatalog, 0, NULL); 53 56 MARKTIME("-- load catalog data: %f sec\n", dtime); 57 client_logger_message ("loaded catalog data\n"); 54 58 55 59 // NOTE: if I let all hosts load blindly, I saturate the data clients with too many … … 61 65 // generate tables go from catID,objID -> catSeq,objSeq 62 66 indexCatalogs (catalog, Ncatalog); 67 client_logger_message ("indexed Catalogs\n"); 63 68 64 69 /* match measurements with images, mosaics */ … … 75 80 MARKTIME("-- set up mosaic indexes: %f sec\n", dtime); 76 81 82 client_logger_message ("done setting up indexes\n"); 83 77 84 // dumpObjects ("test.obj.dat", catalog, Ncatalog); 78 79 85 markObjects (catalog, Ncatalog); 80 86 … … 94 100 95 101 /* determine fit values */ 102 client_logger_message ("starting the loops : %d \n", NLOOP); 96 103 for (i = 0; i < NLOOP; i++) { 97 104 … … 101 108 // share mean mags for objects at the boundary (number of unowned meas > 0) 102 109 share_mean_mags (catalog, Ncatalog, regionHosts, i); 110 client_logger_message ("shared mean mag data : loop %d \n", i); 103 111 104 112 // load mean mags from other region hosts 105 113 slurp_mean_mags (catalog, Ncatalog, regionHosts, i); 114 client_logger_message ("slurped mean mag data : loop %d \n", i); 106 115 107 116 // set the image (Mcal) and mosaic (Mmos) zero point offsets given the mean mags and measurements … … 112 121 // share image mags for images with non-zero unowned detections 113 122 share_image_mags (regionHosts, i); 123 client_logger_message ("shared image data : loop %d \n", i); 114 124 115 125 slurp_image_mags (regionHosts, i); 126 client_logger_message ("slurped image data : loop %d \n", i); 116 127 117 128 if ((i > 8) && (i % 8 == 2)) clean_measures (catalog, Ncatalog, FALSE, flatcorr); … … 123 134 MARKTIME("-- finished loop %d: %f sec\n", i, dtime); 124 135 } 136 client_logger_message ("done with loops\n"); 125 137 126 138 // this is a checkpoint to make sure all hosts have finished the loop above … … 135 147 free (loopsync); 136 148 } 149 client_logger_message ("all hosts are done the loops\n"); 137 150 138 151 /* set Mcal & Mmos for bad images */ … … 144 157 145 158 share_image_mags (regionHosts, -1); 159 client_logger_message ("done with parallel images\n"); 146 160 147 161 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
