IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33799


Ignore:
Timestamp:
Apr 18, 2012, 9:48:08 AM (14 years ago)
Author:
eugene
Message:

skip mosaics with only partial image load

Location:
branches/eam_branches/ipp-20120405/Ohana/src/relphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h

    r33797 r33799  
    3232  float ubercalDist;
    3333  unsigned int flags;
     34  char skipCal;               // if TRUE, this mosaic is incomplete and should not be calibrated
    3435  Coords coords;
    3536} Mosaic;
  • branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/MosaicOps.c

    r33798 r33799  
    208208  MARKTIME("create subset array of mosaic obstimes: %f sec\n", dtime);
    209209
    210   int Nskip, Nmiss, Nmark;
    211   Nskip = Nmiss = Nmark = 0;
    212   // find any start times which match unselected images
    213   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 mosaic
    233       Nmiss ++;
    234     } else {
    235       // mark this mosaic as bad
    236       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 
    242210  // now I have a list of uniq start times, and they are in order
    243211  // create the mosaic arrays for these times
     
    259227    mosaic[i].secz  = NAN;
    260228    mosaic[i].photcode = 0;
     229    mosaic[i].skipCal = FALSE;
    261230
    262231    MosaicN_IMAGE[i] = 10;
     
    266235  }
    267236
     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
    268267  ALLOCATE (ImageToMosaic, off_t, Nsubset); // mosaic to which image belongs
    269268
     
    277276    if (status) continue;
    278277
    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 
    283278    start = subset[i].tzero;
    284279    stop  = subset[i].tzero + MAX(1.01*subset[i].trate*subset[i].NY, 1);
     
    286281    j = findMosaic(startTimesMosaic, Nmosaic, start);
    287282    if (j == -1) {
    288       fprintf (stderr, "error?\n");
     283      fprintf (stderr, "programming error? all subset images should belong to a mosaic\n");
    289284      abort();
    290285    }
     
    448443}
    449444
     445// XXX : what about mosaics with skipCal == TRUE?
    450446void setMcalFinal () {
    451447
     
    630626  int Nrel;
    631627  int Nsys;
     628  int Nskip;
    632629  off_t Nmax;
    633630  int PoorImages;
     
    659656  info->Nrel = 0;
    660657  info->Ngrid = 0;
     658  info->Nskip = 0;
    661659  info->Nsys = 0;
    662660
     
    686684  summary->Nrel  += results->Nrel ;
    687685  summary->Ngrid += results->Ngrid;
     686  summary->Nskip += results->Nskip;
    688687}
    689688
     
    710709}
    711710
     711# if (0)
    712712int setMmos_old (Catalog *catalog, int PoorImages, FlatCorrectionTable *flatcorr) {
    713713
     
    765765      if (KEEP_UBERCAL) continue;
    766766    }
     767
     768    // do not modify the calibration for mosaics with partial images loaded (skipCal TRUE)
     769    if (mosaic[i].skipCal) continue;
    767770
    768771    int minUbercalDist = 1000;
     
    936939  return (TRUE);
    937940}
     941# endif
    938942 
    939943int setMmos (Catalog *catalog, int PoorImages, FlatCorrectionTable *flatcorr) {
     
    10171021
    10181022  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  }
    10191029
    10201030  int testImage = FALSE;
     
    12351245  // report stats & summary from the threads
    12361246  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",
    12381248             i,
    12391249             threadinfo[i].info.Nfew,
     
    12421252             threadinfo[i].info.Ngrid,
    12431253             threadinfo[i].info.Nrel,
    1244              threadinfo[i].info.Nsys);
     1254             threadinfo[i].info.Nsys,
     1255             threadinfo[i].info.Nskip);
    12451256    SetMmosInfoAccum (&summary, &threadinfo[i].info);
    12461257  }
    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",
    12481259           summary.Nfew,
    12491260           summary.Nbad,
     
    12511262           summary.Ngrid,
    12521263           summary.Nrel,
    1253            summary.Nsys);
     1264           summary.Nsys,
     1265           summary.Nskip);
    12541266  free (threadinfo);
    12551267
Note: See TracChangeset for help on using the changeset viewer.