IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28863


Ignore:
Timestamp:
Aug 6, 2010, 11:22:14 PM (16 years ago)
Author:
eugene
Message:

adding region option

Location:
branches/eam_branches/ipp-20100621/Ohana/src/dvomerge
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/Ohana/src/dvomerge/include/dvomerge.h

    r28838 r28863  
    5959
    6060int        SkyTablePopulatedRange PROTO((off_t *ns, off_t *ne, SkyTable *sky, off_t Nstart));
     61int        SkyListPopulatedRange  PROTO((off_t *ns, off_t *ne, SkyList *sky, off_t Nstart));
    6162
    6263SkyList   *SkyTablePopulatedList  PROTO((SkyTable *sky));
  • branches/eam_branches/ipp-20100621/Ohana/src/dvomerge/src/SkyTablePopulatedRange.c

    r27435 r28863  
    1212    Ns = sky[0].regions[Nstart].childS;
    1313    Ne = sky[0].regions[Nstart].childE;
     14    if (Ns == 0) {
     15      fprintf (stderr, "no populated tables at an appropriate depth\n");
     16      exit (1);
     17    }
     18    Nstart = Ns;
     19  }
     20
     21  *ns = Ns;
     22  *ne = Ne;
     23  return (TRUE);
     24}
     25
     26int SkyListPopulatedRange (off_t *ns, off_t *ne, SkyList *sky, off_t Nstart) {
     27
     28  off_t Ns, Ne;
     29
     30  // given the starting sky region, find the populated range at or below this region
     31
     32  Ns = Nstart;
     33  Ne = Nstart + 1;
     34  while (!sky[0].regions[Nstart][0].table) {
     35    Ns = sky[0].regions[Nstart][0].childS;
     36    Ne = sky[0].regions[Nstart][0].childE;
    1437    if (Ns == 0) {
    1538      fprintf (stderr, "no populated tables at an appropriate depth\n");
  • branches/eam_branches/ipp-20100621/Ohana/src/dvomerge/src/args.c

    r28838 r28863  
    1010  if ((N = get_argument (*argc, argv, "-v"))) {
    1111    VERBOSE = TRUE;
     12    remove_argument (N, argc, argv);
     13  }
     14
     15  /*** provide additional data ***/
     16  /* restrict to a portion of the sky? */
     17  UserPatch.Rmin = 0;
     18  UserPatch.Rmax= 360;
     19  UserPatch.Dmin = -90;
     20  UserPatch.Dmax = +90;
     21  if ((N = get_argument (*argc, argv, "-region"))) {
     22    remove_argument (N, argc, argv);
     23    UserPatch.Rmin = atof (argv[N]);
     24    remove_argument (N, argc, argv);
     25    UserPatch.Rmax = atof (argv[N]);
     26    remove_argument (N, argc, argv);
     27    UserPatch.Dmin = atof (argv[N]);
     28    remove_argument (N, argc, argv);
     29    UserPatch.Dmax = atof (argv[N]);
    1230    remove_argument (N, argc, argv);
    1331  }
  • branches/eam_branches/ipp-20100621/Ohana/src/dvomerge/src/dvomergeUpdate.c

    r28674 r28863  
    66  off_t i, j, Ns, Ne;
    77  SkyTable *outsky, *insky;
    8   SkyList *outlist;
     8  SkyList *outlist, *inlist;
    99  Catalog incatalog, outcatalog;
    1010  char filename[256], *input, *output;
     
    4646  SkyTableSetFilenames (insky, input, "cpt");
    4747
     48  // XXX apply this...generate the subset matching the user-selected region
     49  inlist = SkyListByPatch (insky, -1, &UserPatch);
     50
    4851  // generate an output table populated at the desired depth
    4952  outsky = SkyTableLoadOptimal (output, NULL, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
     
    5558  // loop over the populatable output tables; check for data in input in the corresponding regions
    5659
    57   SkyTablePopulatedRange (&Ns, &Ne, insky, 0);
    58   depth = insky[0].regions[Ns].depth;
     60  SkyListPopulatedRange (&Ns, &Ne, inlist, 0);
     61  depth = inlist[0].regions[Ns][0].depth;
    5962 
    6063  // loop over the populated input regions
    6164  for (i = 0; i < outsky[0].Nregions; i++) {
    62     if (!insky[0].regions[i].table) continue;
    63     if (VERBOSE) fprintf (stderr, "input: %s\n", insky[0].regions[i].name);
     65    if (!inlist[0].regions[i][0].table) continue;
     66    if (VERBOSE) fprintf (stderr, "input: %s\n", inlist[0].regions[i][0].name);
    6467
    6568    // load / create output catalog (if catalog does not exist, it will be created)
    66     LoadCatalog (&incatalog, &insky[0].regions[i], insky[0].filename[i], "r");
     69    LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r");
    6770    // skip empty input catalogs
    6871    if (!incatalog.Naves_disk) {
     
    7881    // compare to a slightly reduced footprint
    7982    float dPos = 2.0/3600.0;
    80     outlist = SkyListByBounds (outsky, depth, insky[0].regions[i].Rmin + dPos, insky[0].regions[i].Rmax - dPos, insky[0].regions[i].Dmin + dPos, insky[0].regions[i].Dmax - dPos);
     83    outlist = SkyListByBounds (outsky, depth, inlist[0].regions[i][0].Rmin + dPos, inlist[0].regions[i][0].Rmax - dPos, inlist[0].regions[i][0].Dmin + dPos, inlist[0].regions[i][0].Dmax - dPos);
    8184    for (j = 0; j < outlist[0].Nregions; j++) {
    8285      if (VERBOSE) fprintf (stderr, "output : %s\n", outlist[0].regions[j][0].name);
     
    9396      dvo_catalog_free (&outcatalog);
    9497
    95       fprintf (stderr, "merged %s into %s\n", insky[0].regions[i].name, outlist[0].regions[j][0].name);
     98      fprintf (stderr, "merged %s into %s\n", inlist[0].regions[i][0].name, outlist[0].regions[j][0].name);
    9699    }
    97100    SkyListFree (outlist);
  • branches/eam_branches/ipp-20100621/Ohana/src/dvomerge/src/help.c

    r28838 r28863  
    44  fprintf (stderr, "USAGE: dvomerge (input1) and (input2) to (output)\n");
    55  fprintf (stderr, "   OR: dvomerge (input) into (output)\n");
     6  fprintf (stderr, "   [-region Rmin Rmax Dmin Dmax]\n");
    67  exit (2);
    78}
Note: See TracChangeset for help on using the changeset viewer.