Changeset 27838 for branches/tap_branches/Ohana/src/opihi/dvo/skycoverage.c
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/Ohana/src/opihi/dvo/skycoverage.c
r25757 r27838 6 6 7 7 int WITH_MOSAIC, SOLO_MOSAIC; 8 int i, N, Nimage, status, TimeSelect, ByName, xs, ys; 8 off_t i, Nimage; 9 int N, status, TimeSelect, ByName, xs, ys; 9 10 time_t tzero, tend; 10 double pixscale, dX, dY, Npts, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange, RaCenter ;11 double pixscale, dX, dY, Npts, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange, RaCenter, DecCenter; 11 12 Image *image; 12 char name[256] ;13 char name[256], projection[16]; 13 14 float *V; 14 15 int Nx, Ny; … … 33 34 34 35 RaCenter = 0.0; 35 if ((N = get_argument (argc, argv, "-ra-center"))) { 36 DecCenter = 0.0; 37 if ((N = get_argument (argc, argv, "-center"))) { 36 38 remove_argument (N, &argc, argv); 37 39 RaCenter = atof (argv[N]); 40 remove_argument (N, &argc, argv); 41 DecCenter = atof (argv[N]); 42 remove_argument (N, &argc, argv); 43 } 44 45 Nx = 0; 46 Ny = 0; 47 if ((N = get_argument (argc, argv, "-size"))) { 48 remove_argument (N, &argc, argv); 49 Nx = atof (argv[N]); 50 remove_argument (N, &argc, argv); 51 Ny = atof (argv[N]); 52 remove_argument (N, &argc, argv); 53 } 54 55 pixscale = 1.0; 56 if ((N = get_argument (argc, argv, "-scale"))) { 57 remove_argument (N, &argc, argv); 58 pixscale = atof (argv[N]); 38 59 remove_argument (N, &argc, argv); 39 60 } … … 45 66 remove_argument (N, &argc, argv); 46 67 ByName = TRUE; 68 } 69 70 strcpy (projection, "DEC--AIT"); 71 if ((N = get_argument (argc, argv, "-proj"))) { 72 remove_argument (N, &argc, argv); 73 if (!strcasecmp(argv[N], "TAN")) { 74 strcpy (projection, "DEC--TAN"); 75 } 76 if (!strcasecmp(argv[N], "SIN")) { 77 strcpy (projection, "DEC--SIN"); 78 } 79 if (!strcasecmp(argv[N], "GLS")) { 80 strcpy (projection, "DEC--GLS"); 81 } 82 if (!strcasecmp(argv[N], "PAR")) { 83 strcpy (projection, "DEC--PAR"); 84 } 85 remove_argument (N, &argc, argv); 47 86 } 48 87 … … 100 139 } 101 140 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"); 141 if (argc != 3) { 142 gprint (GP_ERR, "USAGE: skycoverage (buffer) (Npts)\n"); 143 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"); 144 gprint (GP_ERR, " (buffer) saves bitmapped image\n"); 107 145 gprint (GP_ERR, " (Npts) gives the number of test points per image in each dimension\n"); 146 gprint (GP_ERR, " -scale (pixscale) : specifies the pixel size in degrees [1.0]\n"); 147 gprint (GP_ERR, " -center (ra) (dec) : specifies the center of the field [0.0, 0.0]\n"); 148 gprint (GP_ERR, " -size (Nx) (Ny) : specifies the size of the image [360/scale, 180/scale]\n"); 149 gprint (GP_ERR, " -proj (projection) : specifies the projection choice [AIT]\n"); 108 150 gprint (GP_ERR, " note: we need 64800 / (pixscale)^2 pixels to represent the sky\n"); 109 151 return (FALSE); … … 111 153 112 154 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; 155 Npts = atof(argv[2]); 156 157 if (!Nx || !Ny) { 158 Nx = 360/pixscale; 159 Ny = 180/pixscale; 160 } 118 161 119 162 gfits_free_matrix (&buf[0].matrix); … … 123 166 124 167 coords.crval1 = RaCenter; 125 coords.crval2 = 0;168 coords.crval2 = DecCenter; 126 169 coords.crpix1 = 0.5*Nx; 127 170 coords.crpix2 = 0.5*Ny; 128 strcpy (coords.ctype, "DEC--AIT");171 strcpy (coords.ctype, projection); 129 172 coords.pc1_1 = -1.0; 130 173 coords.pc2_2 = +1.0;
Note:
See TracChangeset
for help on using the changeset viewer.
