# include "relastro.h"

int markObjects (Catalog *catalog, int Ncatalog) {

  int i, n;
  off_t j;

  // How strongly do I own this object?
  for (i = 0; i < Ncatalog; i++) {
    ALLOCATE (catalog[i].nOwn, int, catalog[i].Naverage);
    memset (catalog[i].nOwn, 0, catalog[i].Naverage*sizeof(int));
    for (j = 0; j < catalog[i].Naverage; j++) {
      int nOwn = 0;
      int m = catalog[i].average[j].measureOffset;
      for (n = 0; n < catalog[i].average[j].Nmeasure; n++) {
	if (!catalog[i].measureT[m+n].myDet) continue;
	nOwn ++;
      }
      catalog[i].nOwn[j] = nOwn;
    }
  }
  return TRUE;
}

