Changeset 33799
- Timestamp:
- Apr 18, 2012, 9:48:08 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/Ohana/src/relphot
- Files:
-
- 2 edited
-
include/relphot.h (modified) (1 diff)
-
src/MosaicOps.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h
r33797 r33799 32 32 float ubercalDist; 33 33 unsigned int flags; 34 char skipCal; // if TRUE, this mosaic is incomplete and should not be calibrated 34 35 Coords coords; 35 36 } Mosaic; -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/MosaicOps.c
r33798 r33799 208 208 MARKTIME("create subset array of mosaic obstimes: %f sec\n", dtime); 209 209 210 int Nskip, Nmiss, Nmark;211 Nskip = Nmiss = Nmark = 0;212 // find any start times which match unselected images213 for (i = 0; i < Nimage; i++) {214 if (inSubset[i]) {215 Nskip ++;216 continue;217 }218 219 /* select valid mosaic images by photcode */220 pname = GetPhotcodeNamebyCode (image[i].photcode);221 if (!pname) continue;222 status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME));223 if (status) continue;224 225 /* set image time range */226 start = image[i].tzero;227 stop = image[i].tzero + MAX(1.01*image[i].trate*image[i].NY, 1);228 229 /* find a matching mosaic */230 j = findMosaic(startTimesMosaic, Nmosaic, start);231 if (j == -1) {232 // no matching mosaic233 Nmiss ++;234 } else {235 // mark this mosaic as bad236 Nmark ++;237 }238 }239 fprintf (stderr, "%d images, %d skip, %d miss, %d mark\n", (int) Nimage, (int) Nskip, (int) Nmiss, (int) Nmark);240 MARKTIME("find unselected images matching selected mosaics: %f sec\n", dtime);241 242 210 // now I have a list of uniq start times, and they are in order 243 211 // create the mosaic arrays for these times … … 259 227 mosaic[i].secz = NAN; 260 228 mosaic[i].photcode = 0; 229 mosaic[i].skipCal = FALSE; 261 230 262 231 MosaicN_IMAGE[i] = 10; … … 266 235 } 267 236 237 int Nskip, Nmark; 238 Nskip = Nmark = 0; 239 // find any mosaics (startTimesMosaic) which match unselected images 240 for (i = 0; i < Nimage; i++) { 241 if (inSubset[i]) { 242 Nskip ++; 243 continue; 244 } 245 246 /* select valid mosaic images by photcode */ 247 pname = GetPhotcodeNamebyCode (image[i].photcode); 248 if (!pname) continue; 249 status = strncmp (pname, MOSAICNAME, strlen (MOSAICNAME)); 250 if (status) continue; 251 252 /* set image time range */ 253 start = image[i].tzero; 254 stop = image[i].tzero + MAX(1.01*image[i].trate*image[i].NY, 1); 255 256 /* find a matching mosaic */ 257 j = findMosaic(startTimesMosaic, Nmosaic, start); 258 if (j != -1) { 259 // mark this mosaic as bad 260 mosaic[i].skipCal = TRUE; 261 Nmark ++; 262 } 263 } 264 fprintf (stderr, "%d total images, %d overlap skyregion, %d do not overlap, but match overlapping mosaics\n", (int) Nimage, (int) Nskip, (int) Nmark); 265 MARKTIME("find unselected images matching selected mosaics: %f sec\n", dtime); 266 268 267 ALLOCATE (ImageToMosaic, off_t, Nsubset); // mosaic to which image belongs 269 268 … … 277 276 if (status) continue; 278 277 279 /* set image time range */280 // start = subset[i].tzero - MAX(0.01*subset[i].trate*subset[i].NY, 1);281 // stop = subset[i].tzero + MAX(1.01*subset[i].trate*subset[i].NY, 1);282 283 278 start = subset[i].tzero; 284 279 stop = subset[i].tzero + MAX(1.01*subset[i].trate*subset[i].NY, 1); … … 286 281 j = findMosaic(startTimesMosaic, Nmosaic, start); 287 282 if (j == -1) { 288 fprintf (stderr, " error?\n");283 fprintf (stderr, "programming error? all subset images should belong to a mosaic\n"); 289 284 abort(); 290 285 } … … 448 443 } 449 444 445 // XXX : what about mosaics with skipCal == TRUE? 450 446 void setMcalFinal () { 451 447 … … 630 626 int Nrel; 631 627 int Nsys; 628 int Nskip; 632 629 off_t Nmax; 633 630 int PoorImages; … … 659 656 info->Nrel = 0; 660 657 info->Ngrid = 0; 658 info->Nskip = 0; 661 659 info->Nsys = 0; 662 660 … … 686 684 summary->Nrel += results->Nrel ; 687 685 summary->Ngrid += results->Ngrid; 686 summary->Nskip += results->Nskip; 688 687 } 689 688 … … 710 709 } 711 710 711 # if (0) 712 712 int setMmos_old (Catalog *catalog, int PoorImages, FlatCorrectionTable *flatcorr) { 713 713 … … 765 765 if (KEEP_UBERCAL) continue; 766 766 } 767 768 // do not modify the calibration for mosaics with partial images loaded (skipCal TRUE) 769 if (mosaic[i].skipCal) continue; 767 770 768 771 int minUbercalDist = 1000; … … 936 939 return (TRUE); 937 940 } 941 # endif 938 942 939 943 int setMmos (Catalog *catalog, int PoorImages, FlatCorrectionTable *flatcorr) { … … 1017 1021 1018 1022 int minUbercalDist = 1000; 1023 1024 // do not modify the calibration for mosaics with partial images loaded (skipCal TRUE) 1025 if (mosaic[0].skipCal) { 1026 info->Nskip ++; 1027 return TRUE; 1028 } 1019 1029 1020 1030 int testImage = FALSE; … … 1235 1245 // report stats & summary from the threads 1236 1246 for (i = 0; i < NTHREADS; i++) { 1237 fprintf (stderr, "setMmos thread %d : %d mosaics marked having too few measurements (Nbad: %d, Ncal: %d, Ngrid: %d, Nrel: %d, Nsys: %d) \n",1247 fprintf (stderr, "setMmos thread %d : %d mosaics marked having too few measurements (Nbad: %d, Ncal: %d, Ngrid: %d, Nrel: %d, Nsys: %d), %d partials skipped\n", 1238 1248 i, 1239 1249 threadinfo[i].info.Nfew, … … 1242 1252 threadinfo[i].info.Ngrid, 1243 1253 threadinfo[i].info.Nrel, 1244 threadinfo[i].info.Nsys); 1254 threadinfo[i].info.Nsys, 1255 threadinfo[i].info.Nskip); 1245 1256 SetMmosInfoAccum (&summary, &threadinfo[i].info); 1246 1257 } 1247 fprintf (stderr, "total : %d mosaics marked having too few measurements (Nbad: %d, Ncal: %d, Ngrid: %d, Nrel: %d, Nsys: %d) \n",1258 fprintf (stderr, "total : %d mosaics marked having too few measurements (Nbad: %d, Ncal: %d, Ngrid: %d, Nrel: %d, Nsys: %d), %d partials skipped\n", 1248 1259 summary.Nfew, 1249 1260 summary.Nbad, … … 1251 1262 summary.Ngrid, 1252 1263 summary.Nrel, 1253 summary.Nsys); 1264 summary.Nsys, 1265 summary.Nskip); 1254 1266 free (threadinfo); 1255 1267
Note:
See TracChangeset
for help on using the changeset viewer.
