IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39346 for trunk


Ignore:
Timestamp:
Feb 12, 2016, 9:23:13 AM (10 years ago)
Author:
eugene
Message:

allow addstar with average->Nmeasure = 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/build_links.c

    r37807 r39346  
    3434
    3535  ALLOCATE (next_meas, off_t, Nmeasure);
    36   for (i = 0; i < Naverage; i++, N++) {
     36  for (i = 0; i < Naverage; i++) {
     37    if (!average[i].Nmeasure) continue;
    3738    for (j = 0; j < average[i].Nmeasure - 1; j++, N++) {
    3839      next_meas[N] = N + 1;
     
    4546      fprintf (stderr, "WARNING: N out of bounds (2)\n");
    4647    }
    47 
    4848    if (N >= Nmeasure) {
    4949      myAbort ("overflow in init_measure_links\n");
    5050    }
     51    N++;
    5152  }
    5253  return (next_meas);
     
    168169  ALLOCATE (next_miss, off_t, Nmissing);
    169170  for (i = 0; i < Naverage; i++) {
     171    if (!average[i].Nmissing) continue;
    170172    for (j = 0; j < average[i].Nmissing - 1; j++, N++) {
    171173      next_miss[N] = N + 1;
    172174    }
    173     if (average[i].Nmissing > 0) {
    174       next_miss[N] = -1;
    175       if (N >= Nmissing) {
    176         myAbort ("overflow in init_missing_links");
    177       }
    178       N++;
    179     }
    180 
     175    next_miss[N] = -1;
     176    if (N >= Nmissing) {
     177      myAbort ("overflow in init_missing_links");
     178    }
     179    N++;
    181180  }
    182181  return (next_miss);
     
    249248      fprintf (stderr, "WARNING: N out of bounds (2)\n");
    250249    }
    251 
    252250    if (N >= Nlensing) {
    253251      myAbort ("overflow in init_lensing_links\n");
Note: See TracChangeset for help on using the changeset viewer.