IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38533


Ignore:
Timestamp:
Jun 24, 2015, 9:21:59 AM (11 years ago)
Author:
eugene
Message:

converting to find_matches

Location:
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/LoadData.c

    r38525 r38533  
    1010
    1111  Catalog *catalog = NULL;
    12   // ALLOCATE (catalog, Catalog, 1);
    13   // dvo_catalog_init (catalog, TRUE);
     12  ALLOCATE (catalog, Catalog, 1);
     13  dvo_catalog_init (catalog, TRUE);
     14  ALLOCATE (catalog->average, Average, 1);
     15  ALLOCATE (catalog->secfilt, SecFilt, 1);
     16  ALLOCATE (catalog->measure, Measure, 1);
     17  ALLOCATE (catalog->lensing, Lensing, 1);
    1418
    1519  if (images[0] == NULL) {
     
    103107    // replace full input catalog newcat with subset version
    104108    newcat = FilterStars (newcat, &images[0][Nvalid], Nvalid, options);
    105     catalog = newcat;
    106109
    107     // XXX I need to use find_matches_closest here, but for testing:
    108     // find_matches_closest (region, catalog, newcat, options);
    109     // dvo_catalog_free (newcat);
    110     // free (newcat);
     110    double Rref, Dref;
     111    XY_to_RD (&Rref, &Dref, 0.0, 0.0, &images[0][Nvalid].coords);
     112    SkyRegion region;
     113    region.Rmin = Rref - 180.0;
     114    region.Rmax = Rref + 180.0;
     115    region.Dmin = Dref -  90.0;
     116    region.Dmax = Dref +  90.0;
     117   
     118    AddstarClientOptions matchOptions = *options;
     119    matchOptions.radius = 0.1; // tight radius at this stage
     120    matchOptions.calibrate = FALSE;
     121    matchOptions.only_match = FALSE;
     122    matchOptions.nosort = FALSE;
     123
     124    find_matches_closest (&region, newcat, catalog, matchOptions);
     125    dvo_catalog_free (newcat);
     126    free (newcat);
    111127
    112128    Nvalid++;
  • branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/find_matches_closest.c

    r38525 r38533  
    270270  /* these new entries are all written out in UPDATE mode */
    271271  for (i = 0; (i < Nstars) && !options.only_match; i += NSTAR_GROUP) {
     272    fprintf (stderr, "loop %d\n", (int) i);
    272273    /* make sure there is space for next entry */
    273274    if (Nmeas >= NMEAS - NSTAR_GROUP) {
     
    299300    catalog[0].average[Nave].catID         = catID;
    300301
     302    ohana_memcheck(1);
     303
    301304    if (PSPS_ID) {
    302305        catalog[0].average[Nave].extID = CreatePSPSObjectID(catalog[0].average[Nave].R, catalog[0].average[Nave].D);
     
    306309
    307310    for (j = 0; j < Nsecfilt; j++) {
     311      // XXXX inconsistent with my alloc above
    308312      dvo_secfilt_init (&catalog[0].secfilt[Nave*Nsecfilt+j], SECFILT_RESET_ALL);
    309313    }
     314
     315    ohana_memcheck(1);
    310316
    311317    for (j = 0; j < NSTAR_GROUP; j++) {
     
    335341      next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j + 1;
    336342    }
     343
     344    ohana_memcheck(1);
    337345
    338346    // if we have lensing data, insert that as well
     
    357365      }
    358366    }
     367    ohana_memcheck(1);
    359368
    360369    Nave ++;
Note: See TracChangeset for help on using the changeset viewer.