IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33483


Ignore:
Timestamp:
Mar 12, 2012, 8:37:16 PM (14 years ago)
Author:
eugene
Message:

do not include stars with too few meas in all secfilt; free unneeded memory in relphot; pass error messages up

Location:
branches/eam_branches/ipp-20111122/Ohana/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c

    r33482 r33483  
    211211  // XXX can I set the fd_sets once, since I am not actually closing the fd's?
    212212
     213  int globalStatus = TRUE;
     214
    213215  int i;
    214216  int Nmax = 0;
     
    318320          if (host->status) {
    319321            fprintf (stdout, "job failed on %s\n", host->hostname);
     322            globalStatus = FALSE;
    320323          }
    321324        } else {
    322325          host->status = -1;
    323326          fprintf (stdout, "job exited abnormally on %s\n", host->hostname);
     327          globalStatus = FALSE;
    324328          continue;
    325329        }
     
    335339
    336340escape:
    337   return TRUE;
    338 }
     341  return globalStatus;
     342}
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/BrightCatalog.c

    r33461 r33483  
    102102      measure[i].photcode  = photcode[i];
    103103    }
    104     // fprintf (stderr, "loaded data for %lld measures\n", (long long) Nrow);
     104    fprintf (stderr, "loaded data for %lld measure\n", (long long) Nrow);
    105105
    106106    free (dR      );
     
    154154      average[i].catID          = catID[i];
    155155    }
    156     fprintf (stderr, "loaded data for %lld averages\n", (long long) Nrow);
     156    fprintf (stderr, "loaded data for %lld average\n", (long long) Nrow);
    157157
    158158    free (R             );
     
    200200      secfilt[i].M_80  = M_80[i];
    201201    }
    202     fprintf (stderr, "loaded data for %lld averages\n", (long long) Nrow);
     202    fprintf (stderr, "loaded data for %lld secfilt\n", (long long) Nrow);
    203203
    204204    free (M    );
     
    557557    dvo_catalog_init (&catalogs->catalog[i], TRUE);
    558558    catalogs->catIDs[i] = 0;
    559     catalogs->NAVERAGE[i] = 100;
    560     catalogs->NMEASURE[i] = 100;
     559    catalogs->NAVERAGE[i] = 256;
     560    catalogs->NMEASURE[i] = 256;
    561561    catalogs->catalog[i].Naverage = 0;
    562562    catalogs->catalog[i].Nmeasure = 0;
     
    591591
    592592  int i;
     593
     594  int D_NCATALOG = 16;
    593595
    594596  int Nsecfilt = catalogs->Nsecfilt;
     
    632634
    633635    if (catalogs->Ncatalog >= catalogs->NCATALOG) {
    634       catalogs->NCATALOG += 16;
     636      catalogs->NCATALOG += D_NCATALOG;
     637      D_NCATALOG = MAX(2000, 2*D_NCATALOG);
     638
    635639      // fprintf (stderr, "realloc catalogs->catalog: old: %llx  ", (long long) catalogs->catalog);
    636640      REALLOCATE (catalogs->catalog, Catalog, catalogs->NCATALOG);
     
    651655        dvo_catalog_init (&catalogs->catalog[j], TRUE);
    652656        catalogs->catIDs[j] = 0;
    653         catalogs->NAVERAGE[j] = 100;
    654         catalogs->NMEASURE[j] = 100;
     657        catalogs->NAVERAGE[j] = 256;
     658        catalogs->NMEASURE[j] = 256;
    655659        catalogs->catalog[j].Naverage = 0;
    656660        catalogs->catalog[j].Nmeasure = 0;
     
    684688    catalogs->catalog[Nc].Naverage ++;
    685689    if (catalogs->catalog[Nc].Naverage >= catalogs->NAVERAGE[Nc]) {
    686       catalogs->NAVERAGE[Nc] += 100;
     690      catalogs->NAVERAGE[Nc] += MAX(catalogs->NAVERAGE[Nc], 1024);
    687691      REALLOCATE (catalogs->catalog[Nc].averageT, AverageTiny, catalogs->NAVERAGE[Nc]);
    688692      REALLOCATE (catalogs->catalog[Nc].secfilt,  SecFilt,     catalogs->NAVERAGE[Nc]*Nsecfilt);
     
    701705    catalogs->catalog[Nc].Nmeasure ++;
    702706    if (catalogs->catalog[Nc].Nmeasure >= catalogs->NMEASURE[Nc]) {
    703       catalogs->NMEASURE[Nc] += 100;
     707      catalogs->NMEASURE[Nc] += MAX(catalogs->NMEASURE[Nc], 4096);
    704708      REALLOCATE (catalogs->catalog[Nc].measureT, MeasureTiny, catalogs->NMEASURE[Nc]);
    705709    }         
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c

    r33452 r33483  
    44 
    55  off_t i, j, offset;
    6   int found, Ns;
     6  int found, Ns, *Nvalid;
    77  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
    88  float mag;
     
    2727  subcatalog[0].filename = catalog[0].filename;
    2828
     29  // array to count measures with photcodes->equiv to each of the secfilts
     30  ALLOCATE (Nvalid, int, Nsecfilt);
     31
    2932  // flags used by the photometry analysis (excluding UBERCAL)
    3033  unsigned int PHOTOM_FLAGS =
     
    4447    for (j = 0; j < Nsecfilt; j++) {
    4548      subcatalog[0].secfilt[Nsecfilt*Naverage+j] = catalog[0].secfilt[Nsecfilt*i+j];
     49      Nvalid[j] = 0; // reset the Nvalid array for this star
    4650    }
    4751
     
    8690      if (!code) continue;
    8791      found = FALSE;
     92      int Nsec = -1; // Nsec equivalent for the measurement
    8893      for (Ns = 0; !found && (Ns < Nphotcodes); Ns++) {
    89         if (code->equiv == photcodes[Ns][0].code) found = TRUE;
     94        if (code->equiv != photcodes[Ns][0].code) continue;
     95        found = TRUE;
     96        Nsec = GetPhotcodeNsec(code->equiv);
    9097      }
    9198      if (!found) {
     
    134141        if (mag < ImagMin) { Nimag ++; continue; }
    135142        if (mag > ImagMax) { Nimag ++; continue; }
     143      }
     144
     145      // count this measurement as valid for this secfilt entry
     146      if (Nsec > -1) {
     147        assert (Nsec < Nsecfilt);
     148        Nvalid[Nsec] ++;
    136149      }
    137150
     
    162175
    163176    // XXXX test : what checks do I need to make elsewhere to avoid problems here?
    164     if (Nm <= STAR_TOOFEW) { /* enough measurements in band? */
     177    if (Nm <= STAR_TOOFEW) { /* enough measurements total? */
    165178      Nmeasure -= Nm;
    166179      Nfew ++;
    167180      continue;
    168181    }
     182    int anySecfiltGood = FALSE;
     183    for (Ns = 0; Ns < Nsecfilt; Ns++) { /* enough measurements in at least one band? */
     184      if (Nvalid[Ns] <= STAR_TOOFEW) continue;
     185      anySecfiltGood = TRUE;
     186    }
     187    if (!anySecfiltGood) {
     188      Nmeasure -= Nm;
     189      Nfew ++;
     190      continue;
     191    }
     192
    169193    subcatalog[0].averageT[Naverage].Nmeasure = Nm;
    170194    Naverage ++;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/select_images.c

    r33481 r33483  
    267267  REALLOCATE (line_number, off_t, MAX (nimage, 1));
    268268  free (skycoords);
     269  free (RmaxSky);
     270  free (index);
    269271
    270272  *Nimage  = nimage;
  • branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/setphot.c

    r33471 r33483  
    4343
    4444  if (!IMAGES_ONLY) {
    45     update_dvo_setphot (image, Nimage, &flatcorrTable);
     45    status = update_dvo_setphot (image, Nimage, &flatcorrTable);
    4646  }
    4747
    48   // write image table
     48  // write image table (even if some remote clients failed)
    4949  if (UPDATE) {
    5050    dvo_image_save (&db, VERBOSE);
    5151  }
    5252
     53  if (!status) exit (1);
    5354  exit (0);
    5455}
  • branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_dvo_setphot.c

    r33480 r33483  
    147147  }
    148148  if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
    149     HostTableWaitJobsGetIO (table, __FILE__, __LINE__);
     149    int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__);
     150    if (!status) return FALSE;
    150151  }
    151152
Note: See TracChangeset for help on using the changeset viewer.