IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 18, 2016, 4:40:39 PM (10 years ago)
Author:
eugene
Message:

enable skycat for parallel dvo

File:
1 edited

Legend:

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

    r34584 r39354  
    4444  skylist = SkyListByRadius (sky, Depth, graphmode.coords.crval1, graphmode.coords.crval2, Radius);
    4545 
     46  HostTable *table = NULL; 
     47  char *CATDIR = GetCATDIR();
     48  if (HostTableExists (CATDIR, sky->hosts)) {
     49    table = HostTableLoad (CATDIR, sky->hosts);
     50    if (!table) {
     51      gprint (GP_ERR, "ERROR: failure reading Host Table %s for parallel database %s\n", sky->hosts, CATDIR);
     52      return FALSE;
     53    }   
     54  }
     55
    4656  if (VERBOSE) gprint (GP_ERR, "region: %6.2f - %6.2f, %6.2f - %6.2f\n",
    4757                        graphmode.coords.crval1 - Radius, graphmode.coords.crval1 + Radius,
     
    6575
    6676  for (i = 0; (i < Nregions) && !interrupt; i++) {
    67     if (ShowAll || (stat (skylist[0].filename[i], &filestat) != -1)) {
    68       if (VERBOSE) gprint (GP_ERR, "%3d %s %6.2f - %6.2f, %6.2f - %6.2f\n", i, regions[i][0].name,
    69                             regions[i][0].Rmin, regions[i][0].Rmax, regions[i][0].Dmin, regions[i][0].Dmax);
     77    if (!ShowAll) {
     78      char hostfile[1024];
     79      if (table) {
     80        int hostID = (regions[i][0].hostFlags & DATA_USE_BCK) ? regions[i][0].backupID : regions[i][0].hostID;
     81        int index = table->index[hostID];
     82        snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, regions[i][0].name);
     83      } else {
     84        strcpy (hostfile, skylist[0].filename[i]);
     85      }
     86      if (stat (hostfile, &filestat) == -1) continue;
     87    }
    7088
    71       leftside = -1;
    72       RD_to_XYpic (&X[0], &Y[0], regions[i][0].Rmin, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
    73       RD_to_XYpic (&X[1], &Y[1], regions[i][0].Rmin, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
    74       RD_to_XYpic (&X[2], &Y[2], regions[i][0].Rmax, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
    75       RD_to_XYpic (&X[3], &Y[3], regions[i][0].Rmax, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
    76 
    77       Xvec.elements.Flt[Npts] = X[0];
    78       Yvec.elements.Flt[Npts] = Y[0];
    79       for (j = 1; j < 4; j++) {
    80         Xvec.elements.Flt[Npts + j*2 - 0] = X[j];
    81         Yvec.elements.Flt[Npts + j*2 - 0] = Y[j];
    82         Xvec.elements.Flt[Npts + j*2 - 1] = X[j];
    83         Yvec.elements.Flt[Npts + j*2 - 1] = Y[j];
    84       }
    85       Xvec.elements.Flt[Npts+7] = Xvec.elements.Flt[Npts];
    86       Yvec.elements.Flt[Npts+7] = Yvec.elements.Flt[Npts];
    87       Npts += 8;
    88       if (Npts > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
    89         NPTS += 200;
    90         REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS);
    91         REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS);
    92       }
     89    if (VERBOSE) gprint (GP_ERR, "%3d %s %6.2f - %6.2f, %6.2f - %6.2f\n", i, regions[i][0].name,
     90                         regions[i][0].Rmin, regions[i][0].Rmax, regions[i][0].Dmin, regions[i][0].Dmax);
     91   
     92    leftside = -1;
     93    RD_to_XYpic (&X[0], &Y[0], regions[i][0].Rmin, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     94    RD_to_XYpic (&X[1], &Y[1], regions[i][0].Rmin, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     95    RD_to_XYpic (&X[2], &Y[2], regions[i][0].Rmax, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     96    RD_to_XYpic (&X[3], &Y[3], regions[i][0].Rmax, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
     97   
     98    Xvec.elements.Flt[Npts] = X[0];
     99    Yvec.elements.Flt[Npts] = Y[0];
     100    for (j = 1; j < 4; j++) {
     101      Xvec.elements.Flt[Npts + j*2 - 0] = X[j];
     102      Yvec.elements.Flt[Npts + j*2 - 0] = Y[j];
     103      Xvec.elements.Flt[Npts + j*2 - 1] = X[j];
     104      Yvec.elements.Flt[Npts + j*2 - 1] = Y[j];
     105    }
     106    Xvec.elements.Flt[Npts+7] = Xvec.elements.Flt[Npts];
     107    Yvec.elements.Flt[Npts+7] = Yvec.elements.Flt[Npts];
     108    Npts += 8;
     109    if (Npts > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
     110      NPTS += 200;
     111      REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS);
     112      REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS);
    93113    }
    94114  }
Note: See TracChangeset for help on using the changeset viewer.