Changeset 27262 for trunk/Ohana
- Timestamp:
- Mar 12, 2010, 9:26:52 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/skycoverage.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/skycoverage.c
r25757 r27262 8 8 int i, N, Nimage, status, TimeSelect, ByName, xs, ys; 9 9 time_t tzero, tend; 10 double pixscale, dX, dY, Npts, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange, RaCenter ;10 double pixscale, dX, dY, Npts, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange, RaCenter, DecCenter; 11 11 Image *image; 12 char name[256] ;12 char name[256], projection[16]; 13 13 float *V; 14 14 int Nx, Ny; … … 33 33 34 34 RaCenter = 0.0; 35 if ((N = get_argument (argc, argv, "-ra-center"))) { 35 DecCenter = 0.0; 36 if ((N = get_argument (argc, argv, "-center"))) { 36 37 remove_argument (N, &argc, argv); 37 38 RaCenter = atof (argv[N]); 39 remove_argument (N, &argc, argv); 40 DecCenter = atof (argv[N]); 41 remove_argument (N, &argc, argv); 42 } 43 44 Nx = 0; 45 Ny = 0; 46 if ((N = get_argument (argc, argv, "-size"))) { 47 remove_argument (N, &argc, argv); 48 Nx = atof (argv[N]); 49 remove_argument (N, &argc, argv); 50 Ny = atof (argv[N]); 51 remove_argument (N, &argc, argv); 52 } 53 54 pixscale = 1.0; 55 if ((N = get_argument (argc, argv, "-scale"))) { 56 remove_argument (N, &argc, argv); 57 pixscale = atof (argv[N]); 38 58 remove_argument (N, &argc, argv); 39 59 } … … 45 65 remove_argument (N, &argc, argv); 46 66 ByName = TRUE; 67 } 68 69 strcpy (projection, "DEC--AIT"); 70 if ((N = get_argument (argc, argv, "-proj"))) { 71 remove_argument (N, &argc, argv); 72 if (!strcasecmp(argv[N], "TAN")) { 73 strcpy (projection, "DEC--TAN"); 74 } 75 if (!strcasecmp(argv[N], "SIN")) { 76 strcpy (projection, "DEC--SIN"); 77 } 78 if (!strcasecmp(argv[N], "GLS")) { 79 strcpy (projection, "DEC--GLS"); 80 } 81 if (!strcasecmp(argv[N], "PAR")) { 82 strcpy (projection, "DEC--PAR"); 83 } 84 remove_argument (N, &argc, argv); 47 85 } 48 86 … … 100 138 } 101 139 102 if (argc != 4) { 103 gprint (GP_ERR, "USAGE: skycoverage (buffer) (pixscale) (Npts)\n"); 104 gprint (GP_ERR, " options: [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic] [-ra-center RA]\n"); 105 gprint (GP_ERR, " (buffer) saves bitmapped AIT plot\n"); 106 gprint (GP_ERR, " (pixscale) specifies the pixel size in degrees\n"); 140 if (argc != 3) { 141 gprint (GP_ERR, "USAGE: skycoverage (buffer) (Npts)\n"); 142 gprint (GP_ERR, " options: [-scale pixscale] [-center ra dec] [-size Nx Nx] [-proj projection] [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic]\n"); 143 gprint (GP_ERR, " (buffer) saves bitmapped image\n"); 107 144 gprint (GP_ERR, " (Npts) gives the number of test points per image in each dimension\n"); 145 gprint (GP_ERR, " -scale (pixscale) : specifies the pixel size in degrees [1.0]\n"); 146 gprint (GP_ERR, " -center (ra) (dec) : specifies the center of the field [0.0, 0.0]\n"); 147 gprint (GP_ERR, " -size (Nx) (Ny) : specifies the size of the image [360/scale, 180/scale]\n"); 148 gprint (GP_ERR, " -proj (projection) : specifies the projection choice [AIT]\n"); 108 149 gprint (GP_ERR, " note: we need 64800 / (pixscale)^2 pixels to represent the sky\n"); 109 150 return (FALSE); … … 111 152 112 153 if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) return (FALSE); 113 pixscale = atof(argv[2]); 114 Npts = atof(argv[3]); 115 116 Nx = 360/pixscale; 117 Ny = 180/pixscale; 154 Npts = atof(argv[2]); 155 156 if (!Nx || !Ny) { 157 Nx = 360/pixscale; 158 Ny = 180/pixscale; 159 } 118 160 119 161 gfits_free_matrix (&buf[0].matrix); … … 123 165 124 166 coords.crval1 = RaCenter; 125 coords.crval2 = 0;167 coords.crval2 = DecCenter; 126 168 coords.crpix1 = 0.5*Nx; 127 169 coords.crpix2 = 0.5*Ny; 128 strcpy (coords.ctype, "DEC--AIT");170 strcpy (coords.ctype, projection); 129 171 coords.pc1_1 = -1.0; 130 172 coords.pc2_2 = +1.0;
Note:
See TracChangeset
for help on using the changeset viewer.
