Changeset 29938 for trunk/Ohana/src/opihi/dvo/images.c
- Timestamp:
- Dec 5, 2010, 10:04:42 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/images.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/images.c
r28958 r29938 11 11 int images (int argc, char **argv) { 12 12 13 off_t i, Nimage ;13 off_t i, Nimage, Nmosaic; 14 14 int j, status, InPic, leftside, *plist, TimeSelect, ByName; 15 15 int WITH_MOSAIC, SOLO_MOSAIC, HIDDEN; 16 16 time_t tzero, tend; 17 int N, NPTS, n, npts, Npts, kapa ;17 int N, NPTS, n, npts, Npts, kapa, *foundMosaic; 18 18 Vector Xvec, Yvec; 19 19 double r[8], d[8], x[8], y[8], Rmin, Rmax, Rmid, trange, Radius; … … 35 35 36 36 SOLO_MOSAIC = FALSE; 37 foundMosaic = NULL; 37 38 if ((N = get_argument (argc, argv, "-mosaic"))) { 38 39 remove_argument (N, &argc, argv); … … 132 133 BuildChipMatch (image, Nimage); 133 134 135 if (SOLO_MOSAIC && photcode) { 136 ALLOCATE(foundMosaic, int, Nimage); 137 memset(foundMosaic, 0, Nimage*sizeof(int)); 138 } 139 134 140 Rmin = graphmode.coords.crval1 - 180.0; 135 141 Rmax = graphmode.coords.crval1 + 180.0; … … 137 143 138 144 int DistortImage = wordhash ("-DIS"); 145 int ChipImage = wordhash ("-WRP"); 139 146 int TriangleUp = wordhash ("TRP-"); 140 147 int TriangleDn = wordhash ("TRM-"); … … 150 157 if (ByName && strncmp (image[i].name, name, strlen(name))) continue; 151 158 if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue; 152 if (!FindMosaicForImage (image, Nimage, i)) continue; 159 if (!(Nmosaic = FindMosaicForImage (image, Nimage, i))) continue; 160 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 153 161 if (photcode) { 154 162 if ( photcodeEquiv && (photcode[0].code != GetPhotcodeEquivCodebyCode(image[i].photcode))) continue; … … 161 169 162 170 typehash = wordhash (&image[i].coords.ctype[4]); 171 172 if (photcode && SOLO_MOSAIC) { 173 // mosaic (DIS) images are not currently given a photcode : plot these via the WRP entries 174 /* DIS images represent a field, not a chip */ 175 if (typehash != ChipImage) continue; 176 if (foundMosaic[Nmosaic]) continue; 177 x[0] = -0.5*image[Nmosaic].NX; y[0] = -0.5*image[Nmosaic].NY; 178 x[1] = +0.5*image[Nmosaic].NX; y[1] = -0.5*image[Nmosaic].NY; 179 x[2] = +0.5*image[Nmosaic].NX; y[2] = +0.5*image[Nmosaic].NY; 180 x[3] = -0.5*image[Nmosaic].NX; y[3] = +0.5*image[Nmosaic].NY; 181 for (j = 0; j < Npts; j++) { 182 status = XY_to_RD (&r[j], &d[j], x[j], y[j], &image[Nmosaic].coords); 183 if (!status) break; 184 r[j] = ohana_normalize_angle (r[j]); 185 while (r[j] < Rmin) { r[j] += 360.0; } 186 while (r[j] > Rmax) { r[j] -= 360.0; } 187 if (j == 0) { 188 leftside = (r[j] < Rmid); 189 } 190 if (j > 0) { 191 if ( leftside && (r[j] > Rmid + 90)) { r[j] -= 360.0; } 192 if (!leftside && (r[j] < Rmid - 90)) { r[j] += 360.0; } 193 } 194 } 195 foundMosaic[Nmosaic] = TRUE; 196 goto plot_points; 197 } 163 198 164 199 /* DIS images represent a field, not a chip */ … … 270 305 if (Npts == 0) continue; 271 306 307 plot_points: 308 272 309 status = FALSE; 273 310 for (j = 0; j < Npts; j++) { … … 320 357 free (Yvec.elements.Flt); 321 358 FreeImages (image); 359 FREE (foundMosaic); 322 360 return (TRUE); 323 361
Note:
See TracChangeset
for help on using the changeset viewer.
