- Timestamp:
- Nov 14, 2010, 4:02:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/Ohana/src/opihi/dvo/images.c
r28958 r29779 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; … … 132 132 BuildChipMatch (image, Nimage); 133 133 134 if (SOLO_MOSAIC && photcode) { 135 ALLOCATE(foundMosaic, int, Nimage); 136 memset(foundMosaic, 0, Nimage*sizeof(int)); 137 } 138 134 139 Rmin = graphmode.coords.crval1 - 180.0; 135 140 Rmax = graphmode.coords.crval1 + 180.0; … … 137 142 138 143 int DistortImage = wordhash ("-DIS"); 144 int ChipImage = wordhash ("-WRP"); 139 145 int TriangleUp = wordhash ("TRP-"); 140 146 int TriangleDn = wordhash ("TRM-"); … … 150 156 if (ByName && strncmp (image[i].name, name, strlen(name))) continue; 151 157 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; 158 if (!(Nmosaic = FindMosaicForImage (image, Nimage, i))) continue; 159 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 153 160 if (photcode) { 154 161 if ( photcodeEquiv && (photcode[0].code != GetPhotcodeEquivCodebyCode(image[i].photcode))) continue; … … 161 168 162 169 typehash = wordhash (&image[i].coords.ctype[4]); 170 171 if (photcode && SOLO_MOSAIC) { 172 // mosaic (DIS) images are not currently given a photcode : plot these via the WRP entries 173 /* DIS images represent a field, not a chip */ 174 if (typehash != ChipImage) continue; 175 if (foundMosaic[Nmosaic]) continue; 176 x[0] = -0.5*image[Nmosaic].NX; y[0] = -0.5*image[Nmosaic].NY; 177 x[1] = +0.5*image[Nmosaic].NX; y[1] = -0.5*image[Nmosaic].NY; 178 x[2] = +0.5*image[Nmosaic].NX; y[2] = +0.5*image[Nmosaic].NY; 179 x[3] = -0.5*image[Nmosaic].NX; y[3] = +0.5*image[Nmosaic].NY; 180 for (j = 0; j < Npts; j++) { 181 status = XY_to_RD (&r[j], &d[j], x[j], y[j], &image[Nmosaic].coords); 182 if (!status) break; 183 r[j] = ohana_normalize_angle (r[j]); 184 while (r[j] < Rmin) { r[j] += 360.0; } 185 while (r[j] > Rmax) { r[j] -= 360.0; } 186 if (j == 0) { 187 leftside = (r[j] < Rmid); 188 } 189 if (j > 0) { 190 if ( leftside && (r[j] > Rmid + 90)) { r[j] -= 360.0; } 191 if (!leftside && (r[j] < Rmid - 90)) { r[j] += 360.0; } 192 } 193 } 194 foundMosaic[Nmosaic] = TRUE; 195 goto plot_points; 196 } 163 197 164 198 /* DIS images represent a field, not a chip */ … … 270 304 if (Npts == 0) continue; 271 305 306 plot_points: 307 272 308 status = FALSE; 273 309 for (j = 0; j < Npts; j++) { … … 320 356 free (Yvec.elements.Flt); 321 357 FreeImages (image); 358 free (foundMosaic); 322 359 return (TRUE); 323 360
Note:
See TracChangeset
for help on using the changeset viewer.
