Changeset 39354 for trunk/Ohana/src/opihi/dvo/skycat.c
- Timestamp:
- Feb 18, 2016, 4:40:39 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/skycat.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/skycat.c
r34584 r39354 44 44 skylist = SkyListByRadius (sky, Depth, graphmode.coords.crval1, graphmode.coords.crval2, Radius); 45 45 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 46 56 if (VERBOSE) gprint (GP_ERR, "region: %6.2f - %6.2f, %6.2f - %6.2f\n", 47 57 graphmode.coords.crval1 - Radius, graphmode.coords.crval1 + Radius, … … 65 75 66 76 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 } 70 88 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); 93 113 } 94 114 }
Note:
See TracChangeset
for help on using the changeset viewer.
