Changeset 5451 for trunk/Ohana/src/opihi/dvo/skycat.c
- Timestamp:
- Oct 27, 2005, 7:10:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/skycat.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/skycat.c
r5442 r5451 1 1 # include "dvo1.h" 2 3 int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside); 2 4 3 5 int skycat (int argc, char **argv) { … … 5 7 double Radius; 6 8 int i, j, N, Nregions, ShowAll, NPTS, Npts, leftside, Depth, TableDepth; 7 char filename[128];8 9 struct stat filestat; 9 10 Vector Xvec, Yvec; 10 11 Graphdata graphmode; 11 12 double X[4], Y[4], Rmin, Rmax, Rmid; 12 char catdir[256], gscfile[256];13 13 int Ngraph, VERBOSE; 14 14 SkyTable *sky; 15 15 SkyList *skylist; 16 16 SkyRegion **regions; 17 18 VarConfig ("CATDIR", "%s", catdir);19 VarConfig ("GSCFILE", "%s", gscfile);20 17 21 18 VERBOSE = FALSE; … … 45 42 46 43 Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax)); 47 sky = SkyTableFromGSC (gscfile, TableDepth, VERBOSE); 48 if (sky == NULL) return (FALSE);44 45 sky = GetSkyTable (); 49 46 skylist = SkyListByRadius (sky, Depth, graphmode.coords.crval1, graphmode.coords.crval2, Radius); 50 47 … … 66 63 67 64 for (i = 0; i < Nregions; i++) { 68 sprintf (filename, "%s/%s", catdir, regions[i][0].name); 69 if (ShowAll || (stat (filename, &filestat) != -1)) { 65 if (ShowAll || (stat ((char *) regions[i][0].filename, &filestat) != -1)) { 70 66 if (VERBOSE) fprintf (stderr, "%3d %s %6.2f - %6.2f, %6.2f - %6.2f\n", i, regions[i][0].name, 71 67 regions[i][0].Rmin, regions[i][0].Rmax, regions[i][0].Dmin, regions[i][0].Dmax); … … 114 110 115 111 } 112 113 114 int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside) { 115 116 while (r < Rmin) { r += 360.0; } 117 while (r > Rmax) { r -= 360.0; } 118 119 if (*leftside == -1) { 120 *leftside = (r < Rmid); 121 } else { 122 if ( *leftside && (r > Rmid + 90)) { r -= 360.0; } 123 if (! *leftside && (r < Rmid - 90)) { r += 360.0; } 124 } 125 126 RD_to_XY (x, y, r, d, coords); 127 128 return (TRUE); 129 }
Note:
See TracChangeset
for help on using the changeset viewer.
