IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37796


Ignore:
Timestamp:
Jan 11, 2015, 1:12:08 PM (12 years ago)
Author:
eugene
Message:

add option to load a full table (needed to manage some measure/average links)

Location:
branches/eam_branches/ipp-20140904/Ohana/src/dvosplit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/include/dvosplit.h

    r33656 r37796  
    2222} AveLinks;
    2323
     24int    FULL_TABLE;
    2425int    VERBOSE;
    2526char  *OUTDIR;
  • branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/src/args.c

    r33656 r37796  
    5757  }
    5858
     59  // override input catalog format (PS1_V1, PS1_REF, etc)
     60  FULL_TABLE = FALSE;
     61  if ((N = get_argument (argc, argv, "-full-table"))) {
     62    remove_argument (N, &argc, argv);
     63    FULL_TABLE = TRUE;
     64  }
     65
    5966  /* extra error messages */
    6067  VERBOSE = FALSE;
  • branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/src/split_averages.c

    r37043 r37796  
    2727  incatalog[0].catflags = LOAD_AVES | LOAD_SECF;
    2828
    29   if (incatalog[0].catmode == DVO_MODE_SPLIT) {
     29  if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) {
    3030    Nblocks = incatalog[0].Naves_disk / NROWS;
    3131    if (incatalog[0].Naves_disk % NROWS) Nblocks ++;
     
    3636  for (block = 0; block < Nblocks; block++) {
    3737
    38     if (incatalog[0].catmode == DVO_MODE_SPLIT) {
     38    if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) {
    3939      // read up to NROWS at a time
    4040      dvo_catalog_load_segment (incatalog, VERBOSE, block*NROWS, NROWS);
    4141      fprintf (stderr, "splitting %s (averages) .. %d of %d\n", incatalog[0].filename, block, Nblocks);
     42      assert (block*NROWS == incatalog[0].Naves_off);
    4243    } else {
    4344      dvo_catalog_load (incatalog, VERBOSE);
    4445      fprintf (stderr, "splitting %s (averages)\n", incatalog[0].filename);
    4546    }
    46 
    47     assert (block*NROWS == incatalog[0].Naves_off);
    4847
    4948    // distribute data to the output catalogs
     
    5453      inD = incatalog[0].average[ave].D;
    5554
     55      if (incatalog[0].average[ave].Nmeasure == 0) {
     56        fprintf (stderr, "WARNING: object with no measurements, skipping %d (%f, %f)\n", averef, inR, inD);
     57        continue;
     58      }
    5659      // which of the outcatalogs contains this coordinate?
    5760
     
    98101
    99102    // write out the new values
    100     for (cat = 0; cat < outlist[0].Nregions; cat++) {
    101       outcatalogs[cat].catflags = LOAD_AVES | LOAD_SECF;
     103    if (!FULL_TABLE) {
     104      for (cat = 0; cat < outlist[0].Nregions; cat++) {
     105        outcatalogs[cat].catflags = LOAD_AVES | LOAD_SECF;
    102106
    103       dvo_catalog_save (&outcatalogs[cat], VERBOSE);
    104       // fprintf (stderr, "secfilt: %d %d %d %d\n", outcatalogs[cat].Nsecf_mem, outcatalogs[cat].Nsecf_disk, outcatalogs[cat].Nsecf_off, outcatalogs[cat].Naverage, outcatalogs[cat].Nsecfilt);
     107        dvo_catalog_save (&outcatalogs[cat], VERBOSE);
     108        // fprintf (stderr, "secfilt: %d %d %d %d\n", outcatalogs[cat].Nsecf_mem, outcatalogs[cat].Nsecf_disk, outcatalogs[cat].Nsecf_off, outcatalogs[cat].Naverage, outcatalogs[cat].Nsecfilt);
    105109
    106       // advance the pointers and free the current data
    107       // XXX these should be done within save segment:
    108       outcatalogs[cat].Naves_disk += outcatalogs[cat].Naverage;
    109       outcatalogs[cat].Naves_off  += outcatalogs[cat].Naverage;
    110       outcatalogs[cat].Nsecf_disk += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage;
    111       outcatalogs[cat].Nsecf_off  += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage;
    112       outcatalogs[cat].Nsecfilt    = Nsecfilt;
     110        // advance the pointers and free the current data
     111        // XXX these should be done within save segment:
     112        outcatalogs[cat].Naves_disk += outcatalogs[cat].Naverage;
     113        outcatalogs[cat].Naves_off  += outcatalogs[cat].Naverage;
     114        outcatalogs[cat].Nsecf_disk += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage;
     115        outcatalogs[cat].Nsecf_off  += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage;
     116        outcatalogs[cat].Nsecfilt    = Nsecfilt;
    113117
    114       outcatalogs[cat].Naverage    = 0;
    115       outcatalogs[cat].Nsecf_mem   = 0;
     118        outcatalogs[cat].Naverage    = 0;
     119        outcatalogs[cat].Nsecf_mem   = 0;
     120      }
    116121    }
    117122  }
    118123
    119   for (cat = 0; cat < outlist[0].Nregions; cat++) {
    120     dvo_catalog_free_data (&outcatalogs[cat]);
     124  if (!FULL_TABLE) {
     125    for (cat = 0; cat < outlist[0].Nregions; cat++) {
     126      dvo_catalog_free_data (&outcatalogs[cat]);
     127    }
    121128  }
    122129
  • branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/src/split_measures.c

    r37043 r37796  
    2727  // }
    2828
    29   if (incatalog[0].catmode == DVO_MODE_SPLIT) {
     29  if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) {
    3030    Nblocks = incatalog[0].Nmeas_disk / NROWS;
    3131    if (incatalog[0].Nmeas_disk % NROWS) Nblocks ++;
     
    3737
    3838    // read up to NROWS at a time
    39     if (incatalog[0].catmode == DVO_MODE_SPLIT) {
     39    if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) {
    4040      dvo_catalog_load_segment (incatalog, VERBOSE, block*NROWS, NROWS);
    4141      fprintf (stderr, "splitting %s (measures) .. %d of %d\n", incatalog[0].filename, block, Nblocks);
     42      assert (block*NROWS == incatalog[0].Nmeas_off);
    4243    } else {
    4344      dvo_catalog_load (incatalog, VERBOSE);
    4445      fprintf (stderr, "splitting %s (measures)\n", incatalog[0].filename);
    4546    }
    46 
    47     assert (block*NROWS == incatalog[0].Nmeas_off);
    4847
    4948    for (meas = 0; meas < incatalog[0].Nmeasure; meas++) {
     
    5251      Ncat = outcat[averef];
    5352
     53      int averef_out = outref[averef];
     54      if (averef_out >= outcatalogs[Ncat].Naverage) {
     55        fprintf (stderr, "mismatch 1\n");
     56        abort();
     57      }
     58
    5459      Nout = outcatalogs[Ncat].Nmeasure;
    5560      outcatalogs[Ncat].measure[Nout] = incatalog[0].measure[meas];
    5661      outcatalogs[Ncat].measure[Nout].averef = outref[averef];
     62
    5763      outcatalogs[Ncat].Nmeasure++;
    5864
     
    6470    dvo_catalog_free_data (incatalog);
    6571
     72    if (!FULL_TABLE) {
     73      for (cat = 0; cat < outlist[0].Nregions; cat++) {
     74        outcatalogs[cat].catflags = LOAD_MEAS;
     75        dvo_catalog_save (&outcatalogs[cat], VERBOSE);
     76
     77        outcatalogs[cat].Nmeas_disk += outcatalogs[cat].Nmeasure;
     78        outcatalogs[cat].Nmeas_off  += outcatalogs[cat].Nmeasure;
     79        outcatalogs[cat].Nmeasure    = 0;
     80      }
     81    }
     82  }
     83
     84  if (FULL_TABLE) {
    6685    for (cat = 0; cat < outlist[0].Nregions; cat++) {
    67       outcatalogs[cat].catflags = LOAD_MEAS;
     86      outcatalogs[cat].catflags = LOAD_AVES | LOAD_SECF | LOAD_MEAS;
    6887      dvo_catalog_save (&outcatalogs[cat], VERBOSE);
    69 
    70       outcatalogs[cat].Nmeas_disk += outcatalogs[cat].Nmeasure;
    71       outcatalogs[cat].Nmeas_off  += outcatalogs[cat].Nmeasure;
    72       outcatalogs[cat].Nmeasure    = 0;
    73 
    7488    }
    7589  }
Note: See TracChangeset for help on using the changeset viewer.