IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24750


Ignore:
Timestamp:
Jul 12, 2009, 10:28:47 AM (17 years ago)
Author:
eugene
Message:

fixed memleaks & photcode defs; dvomerge now working

Location:
trunk/Ohana/src/dvomerge/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/src/ConfigInit.c

    r24745 r24750  
    3636  SetZeroPoint (ZERO_POINT);
    3737
    38   /* XXX this does not yet write out the master photcode table */
    39   sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);
    40   if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) {
    41     fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
    42     exit (1);
     38  if (RADIUS < 1e-6) {
     39      fprintf (stderr, "non-sensical correlation radius %f\n", RADIUS);
     40      exit (1);
    4341  }
    4442
  • trunk/Ohana/src/dvomerge/src/dvomerge.c

    r24745 r24750  
    2121  input2 = argv[3];
    2222  output = argv[5];
     23
     24  // the first input define the photcode table & db layout
     25  sprintf (filename, "%s/Photcodes.dat", input1);
     26  if (!LoadPhotcodes (filename, NULL)) {
     27    fprintf (stderr, "error loading photcode table %s\n", filename);
     28    exit (1);
     29  }
     30  // save the photcodes in the output catdir
     31  sprintf (filename, "%s/Photcodes.dat", output);
     32  if (!check_file_access (filename, TRUE, TRUE)) {
     33    fprintf (stderr, "error creating output catdir %s\n", output);
     34    exit (1);
     35  }
     36  if (!SavePhotcodesFITS (filename)) {
     37    fprintf (stderr, "error saving photcode table %s\n", filename);
     38    exit (1);
     39  }
    2340
    2441  // load the sky table for the existing database
     
    86103        continue;
    87104      }
    88       merge_catalogs_old (&outsky[0].regions[i], &outcatalog, &incatalog, 1.0);
     105      merge_catalogs_old (&outsky[0].regions[i], &outcatalog, &incatalog, RADIUS);
    89106      dvo_catalog_unlock (&incatalog);
    90107      dvo_catalog_free (&incatalog);
    91108    }
     109    SkyListFree (inlist);
     110
    92111    outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
    93112    dvo_catalog_save (&outcatalog, VERBOSE);
  • trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c

    r24745 r24750  
    150150
    151151    /*** a match is found, add to average, measure ***/
     152    Nmatch ++;
     153    n = N2[Jmin];
     154    N = N1[i];
    152155
    153156    /* make sure there is space for next Nmeasure entries */
     
    158161    }
    159162
    160     Nmatch ++;
    161     n = N2[Jmin];
    162     N = N1[i];
    163 
    164163    /** add measurements for this input average object **/
    165164    for (Nin = 0; Nin < input[0].average[N].Nmeasure; Nin ++) {
     
    173172
    174173      Rin = input[0].average[N].R - input[0].measure[offset].dR / 3600.0;
    175       Din = input[0].average[N].R - input[0].measure[offset].dR / 3600.0;
     174      Din = input[0].average[N].D - input[0].measure[offset].dD / 3600.0;
    176175
    177176      /** dR,dD now represent arcsec **/
    178177      output[0].measure[Nmeas].dR       = 3600.0*(output[0].average[n].R - Rin);  // XXX update these based on choice of astromety
    179       output[0].measure[Nmeas].dD       = 3600.0*(output[0].average[n].D - Rin);  // XXX update these based on choice of astromety
     178      output[0].measure[Nmeas].dD       = 3600.0*(output[0].average[n].D - Din);  // XXX update these based on choice of astromety
    180179      output[0].measure[Nmeas].dbFlags  = 0;
    181180      output[0].measure[Nmeas].averef   = n;
     
    319318  if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmatch);
    320319
     320  free (next_meas);
     321
     322  free (output[0].found);
     323  free (X2);
     324  free (Y2);
     325  free (N2);
    321326  free (input[0].found);
    322   free (output[0].found);
    323327  free (X1);
    324328  free (Y1);
    325329  free (N1);
    326   free (X2);
    327   free (Y2);
    328   free (N2);
    329330  return (Nmatch);
    330331}
Note: See TracChangeset for help on using the changeset viewer.