IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 24, 2015, 6:01:22 AM (11 years ago)
Author:
eugene
Message:

test for parallel dvo; add option to print full filename (automatically parallel or local); add option to scale cdensify image by a vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/gcat.c

    r34088 r39294  
    99  SkyList *skylist;
    1010
     11  int ShowFile = FALSE;
     12  if ((N = get_argument (argc, argv, "-file"))) {
     13    remove_argument (N, &argc, argv);
     14    ShowFile = TRUE;
     15  }
    1116  int ShowHost = FALSE;
    1217  if ((N = get_argument (argc, argv, "-host"))) {
     
    4146  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
    4247
     48  HostTable *table = NULL; 
     49  char *CATDIR = GetCATDIR();
     50  if (HostTableExists (CATDIR, sky->hosts)) {
     51    table = HostTableLoad (CATDIR, sky->hosts);
     52    if (!table) {
     53      gprint (GP_ERR, "ERROR: failure reading Host Table %s for parallel database %s\n", sky->hosts, CATDIR);
     54      return FALSE;
     55    }   
     56  }
     57
    4358  // prepare to handle interrupt signals
    4459  signal (SIGINT, handle_interrupt);
     
    4661
    4762  for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
    48     gprint (GP_ERR, "%3d %s", i, skylist[0].regions[i][0].name);
    49     if (stat (skylist[0].filename[i], &filestat) != -1) {
     63    SkyRegion *region = skylist[0].regions[i];
     64
     65    char hostfile[1024];
     66    if (table) {
     67      int hostID = (region->hostFlags & DATA_USE_BCK) ? region->backupID : region->hostID;
     68      int index = table->index[hostID];
     69      snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, region->name);
     70    } else {
     71      strcpy (hostfile, skylist[0].filename[i]);
     72    }
     73
     74    if (ShowFile) {
     75      gprint (GP_ERR, "%3d %s", i, hostfile);
     76    } else {
     77      gprint (GP_ERR, "%3d %s", i, region->name);
     78    }
     79
     80    if (stat (hostfile, &filestat) != -1) {
    5081      gprint (GP_ERR, " *");
    5182    } else {
     
    5384    }
    5485    if (ShowHost) {
    55       gprint (GP_ERR, "  %3d", skylist[0].regions[i][0].hostID);
     86      gprint (GP_ERR, "  %3d", region->hostID);
    5687    } else {
    5788      gprint (GP_ERR, "     ");
    5889    }
    5990    if (ShowBackup) {
    60       gprint (GP_ERR, "  %3d", skylist[0].regions[i][0].backupID);
     91      gprint (GP_ERR, "  %3d", region->backupID);
    6192    } else {
    6293      gprint (GP_ERR, "     ");
    6394    }
    6495    if (ShowFlags) {
    65       gprint (GP_ERR, "  0x%04x", skylist[0].regions[i][0].hostFlags);
     96      gprint (GP_ERR, "  0x%04x", region->hostFlags);
    6697    } else {
    6798      gprint (GP_ERR, "        ");
    6899    }
    69100    gprint (GP_ERR, "\n");
    70     set_str_variable ("CATNAME", skylist[0].filename[i]);
     101    set_str_variable ("CATNAME", hostfile);
    71102  }
    72103
Note: See TracChangeset for help on using the changeset viewer.