IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37009


Ignore:
Timestamp:
Jul 13, 2014, 11:22:26 AM (12 years ago)
Author:
eugene
Message:

catalog.found is now freed by dvo_catalog_free

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140610/Ohana/src/dvomerge/src/merge_catalogs_old.c

    r36995 r37009  
    3131  ALLOCATE (Y1, double, input[0].Naverage);
    3232  ALLOCATE (N1, off_t,  input[0].Naverage);
    33   ALLOCATE (input[0].found, off_t, input[0].Naverage);
     33  if (!input[0].found_t) {
     34    ALLOCATE (input[0].found_t, off_t, input[0].Naverage);
     35  } else {
     36    REALLOCATE (input[0].found_t, off_t, input[0].Naverage);
     37  }
    3438
    3539  /** allocate local arrays (catalog) **/
     
    3842  ALLOCATE (Y2, double, NAVE);
    3943  ALLOCATE (N2, off_t,    NAVE);
    40   ALLOCATE (output[0].found, off_t, NAVE);
     44  if (!output[0].found_t) {
     45    ALLOCATE (output[0].found_t, off_t, NAVE);
     46  } else {
     47    REALLOCATE (output[0].found_t, off_t, NAVE);
     48  }
    4149  /* for secfilt j and star i, secfilt[i*Nsecfilt+j] */
    4250
     
    7886    N1[Nstars] = i;
    7987    Nstars ++;
    80     input[0].found[i] = -1;
     88    input[0].found_t[i] = -1;
    8189  }
    8290  if (Nstars < 1) {
    8391    if (VERBOSE) fprintf (stderr, "skipping %s, no overlapping stars\n", output[0].filename);
    84     free (output[0].found);
    85     free (input[0].found);
    8692    free (X1);
    8793    free (Y1);
     
    97103  for (i = 0; i < Nave; i++) {
    98104    RD_to_XY (&X2[i], &Y2[i], output[0].average[i].R, output[0].average[i].D, &tcoords);
    99     output[0].found[i] = -1;
     105    output[0].found_t[i] = -1;
    100106    N2[i] = i;
    101107  }
     
    187193        int Mout = output[0].average[n].measureOffset; 
    188194        if (replace_match(&output[0].average[n], &output[0].measure[Mout], &input[0].average[N], &input[0].measure[offset])) {
    189           input[0].found[N] = Mout;
     195          input[0].found_t[N] = Mout;
    190196          continue;
    191197        }
     
    237243        }
    238244      }
    239       input[0].found[N] = Nmeas;
     245      input[0].found_t[N] = Nmeas;
    240246      output[0].average[n].Nmeasure ++;
    241247      Nmeas ++;
     
    266272    /* Nm is updated, but not written out in -update mode (for existing entries)
    267273       Nm is recalculated in build_meas_links if loaded table is not sorted */
    268     output[0].found[n] = Nmeas;
     274    output[0].found_t[n] = Nmeas;
    269275    i++;
    270276  }
     
    288294    }
    289295
    290     if (input[0].found[N] >= 0) continue;
     296    if (input[0].found_t[N] >= 0) continue;
    291297    if (!IN_REGION (input[0].average[N].R, input[0].average[N].D)) continue;
    292298
     
    341347
    342348      /* we set next[Nmeas] to -1 here, and update correctly below */
    343       input[0].found[N] = Nmeas;
     349      input[0].found_t[N] = Nmeas;
    344350      next_meas[Nmeas] = -1;
    345351      Nmeas ++;
     
    367373  /* note stars which have been found in this catalog */
    368374  for (i = 0; i < input[0].Naverage; i++) {
    369     if (input[0].found[i] > -1) {
    370       input[0].found[i] = -2;
     375    if (input[0].found_t[i] > -1) {
     376      input[0].found_t[i] = -2;
    371377    } else {
    372       input[0].found[i] = -3;
     378      input[0].found_t[i] = -3;
    373379    }
    374380  }
     
    383389  free (next_meas);
    384390
    385   free (output[0].found);
    386391  free (X2);
    387392  free (Y2);
    388393  free (N2);
    389   free (input[0].found);
    390394  free (X1);
    391395  free (Y1);
     
    404408   images have boundaries which are lines in pixels coords, but curve in RA and DEC
    405409   
    406    output[0].found[Ncat] but stars[Nstar].found
     410   output[0].found_t[Ncat] but stars[Nstar].found
    407411   
    408412*/
Note: See TracChangeset for help on using the changeset viewer.