Changeset 13645
- Timestamp:
- Jun 5, 2007, 10:19:11 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/sky_tessalation.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/sky_tessalation.c
r13186 r13645 25 25 int sky_tessalation_triangles (FITS_DB *db, int level, int Nmax) { 26 26 27 int i, j, Ndigit, Ntriangles, Nbase, Ntotal, Ltop, N images;27 int i, j, Ndigit, Ntriangles, Nbase, Ntotal, Ltop, Nout, Nimages; 28 28 double Ntop, fLtop; 29 29 SkyTriangle *base, *tri, *new; … … 60 60 61 61 // for each base triangle, subdivide the rest of the way and save 62 Nout = 0; 62 63 for (i = 0; i < Nbase; i++) { 63 64 ALLOCATE (tri, SkyTriangle, 1); … … 74 75 for (j = 0; j < Ntriangles; j++) { 75 76 sky_triangle_to_image (&image[j], &tri[j]); 76 snprintf (image[j].name, 32, format, j); 77 snprintf (image[j].name, 32, format, Nout); 78 Nout++; 77 79 } 78 80 Nimages = Ntriangles; … … 93 95 int sky_tessalation_squares (FITS_DB *db, int level, int Nmax) { 94 96 95 int i, j, N digit, Ntriangles, Nbase, Ntotal, Ntop, Ltop, Nout, Nx, Ny;97 int i, j, Nname, Ndigit, Ntriangles, Nbase, Ntotal, Ntop, Ltop, Nout, Nx, Ny; 96 98 double fLtop; 97 99 SkyTriangle *base, *tri, *new; … … 131 133 132 134 // for each base triangle, subdivide the rest of the way and save 135 Nname = 0; 133 136 for (i = 0; i < Nbase; i++) { 134 137 ALLOCATE (tri, SkyTriangle, 1); … … 152 155 if (!strcmp(image[j].coords.ctype, "DROP")) continue; 153 156 memcpy (&out[Nout], &image[j], sizeof(Image)); 154 snprintf (out[Nout].name, 32, format, j); 157 snprintf (out[Nout].name, 32, format, Nname); 158 Nname++; 155 159 Nout++; 156 160 } … … 249 253 int sky_subdivide_image (Image *output, Image *input, int Nx, int Ny) { 250 254 251 int i, j, N, NX, NY; 255 int i, j, N, NX, NY, Ndigit; 256 char format[24]; 252 257 253 258 NX = input[0].NX/(double)Nx + 0.5; 254 259 NY = input[0].NY/(double)Ny + 0.5; 260 261 Ndigit = (int)(log10(Nx*Ny)) + 1 ; 262 snprintf (format, 24, "%s.%%0%dd", input[0].name, Ndigit); 255 263 256 264 N = 0; … … 259 267 260 268 memcpy (&output[N], &input[0], sizeof(Image)); 269 snprintf (output[N].name, 32, format, N); 261 270 262 271 // output[0].coords = input[0].coords;
Note:
See TracChangeset
for help on using the changeset viewer.
