- Timestamp:
- Jun 20, 2016, 3:17:27 PM (10 years ago)
- Location:
- trunk/Ohana/src/relastro/src
- Files:
-
- 3 edited
-
RepairWarpMeasures.c (modified) (2 diffs)
-
RepairWarps.c (modified) (1 diff)
-
WarpImageMaps.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/src/RepairWarpMeasures.c
r39600 r39603 127 127 // NOTE: this actually works surprisingly well near the pole 128 128 double dPos = hypot(dR,dD); 129 if (dPos < 2.0) {129 if (dPos < 3.0) { 130 130 // image coord agrees with average coord 131 131 if (coordsDiffer) { … … 146 146 fprintf (stderr, "inconsistent warp measurement times: %d vs %d for %f, %f (%d, %ld)", measure->t, image[im].tzero, Rwrp, Dwrp, measure->photcode, extID); 147 147 result.NbadWarpTime ++; 148 continue; 149 }148 } 149 continue; 150 150 } 151 151 -
trunk/Ohana/src/relastro/src/RepairWarps.c
r39600 r39603 90 90 91 91 // save backup of original cpm file 92 if (!dvo_catalog_backup (&catalog, "rp0", TRUE)) { 93 fprintf (stderr, "ERROR: failed to make backup for catalog %s\n", catalog.filename); 92 if (!dvo_catalog_unlock (catalog.measure_catalog)) { 93 fprintf (stderr, "ERROR: failed to unlock cpm table for catalog %s\n", catalog.filename); 94 exit (1); 95 } 96 if (!dvo_catalog_backup (catalog.measure_catalog, ".rp2", FALSE)) { 97 fprintf (stderr, "ERROR: failed to make backup cpm table for catalog %s\n", catalog.filename); 98 exit (1); 99 } 100 if (!dvo_catalog_lock (catalog.measure_catalog, catalog.lockmode)) { 101 fprintf (stderr, "failed to re-lock cpm table catalog file %s\n", catalog.filename); 94 102 exit (1); 95 103 } -
trunk/Ohana/src/relastro/src/WarpImageMaps.c
r39474 r39603 123 123 ALLOCATE (warpgroup[i].onBoundary, int, warpgroup[i].Nwarps); 124 124 125 if (i == 54950) { 126 fprintf (stderr, "checking problem warpgroup\n"); 127 } 128 125 129 for (int j = 0; j < warpgroup[i].Nwarps; j++) { 126 130 … … 178 182 179 183 if (warpgroup[i].Rmax[j] - warpgroup[i].Rmin[j] > 270.0) { 180 // Rmin and Rmax are in the range 0 - 360. For images at the 0,360 boundary, 181 // "Rmax" is the lower edge, and "Rmin" is the upper edge. we need to flip them 182 // and then break the 0-360 range: 183 double tmp = warpgroup[i].Rmin[j]; 184 warpgroup[i].Rmin[j] = warpgroup[i].Rmax[j] - 360.0; 185 warpgroup[i].Rmax[j] = tmp; 184 // Rmin and Rmax are in the range 0 - 360. For images at the 0,360 boundary, we need to recalculated Rmin,Rmax 185 // using 0.0 as the midpoint (allowing the range -180 to +180) 186 187 XY_to_RD (&R, &D, 0.0, 0.0, &image[N].coords); 188 R = ohana_normalize_angle_to_midpoint(R, 0.0); 189 warpgroup[i].Rmin[j] = R; 190 warpgroup[i].Rmax[j] = R; 191 warpgroup[i].Dmin[j] = D; 192 warpgroup[i].Dmax[j] = D; 193 194 XY_to_RD (&R, &D, Nx, 0.0, &image[N].coords); 195 R = ohana_normalize_angle_to_midpoint(R, 0.0); 196 warpgroup[i].Rmin[j] = MIN (warpgroup[i].Rmin[j], R); 197 warpgroup[i].Rmax[j] = MAX (warpgroup[i].Rmax[j], R); 198 warpgroup[i].Dmin[j] = MIN (warpgroup[i].Dmin[j], D); 199 warpgroup[i].Dmax[j] = MAX (warpgroup[i].Dmax[j], D); 200 201 XY_to_RD (&R, &D, 0.0, Ny, &image[N].coords); 202 R = ohana_normalize_angle_to_midpoint(R, 0.0); 203 warpgroup[i].Rmin[j] = MIN (warpgroup[i].Rmin[j], R); 204 warpgroup[i].Rmax[j] = MAX (warpgroup[i].Rmax[j], R); 205 warpgroup[i].Dmin[j] = MIN (warpgroup[i].Dmin[j], D); 206 warpgroup[i].Dmax[j] = MAX (warpgroup[i].Dmax[j], D); 207 208 XY_to_RD (&R, &D, Nx, Ny, &image[N].coords); 209 R = ohana_normalize_angle_to_midpoint(R, 0.0); 210 warpgroup[i].Rmin[j] = MIN (warpgroup[i].Rmin[j], R); 211 warpgroup[i].Rmax[j] = MAX (warpgroup[i].Rmax[j], R); 212 warpgroup[i].Dmin[j] = MIN (warpgroup[i].Dmin[j], D); 213 warpgroup[i].Dmax[j] = MAX (warpgroup[i].Dmax[j], D); 214 186 215 warpgroup[i].onBoundary[j] = TRUE; 187 216 }
Note:
See TracChangeset
for help on using the changeset viewer.
