Changeset 41515 for trunk/Ohana/src/opihi/cmd.astro/cgrid.c
- Timestamp:
- Apr 2, 2021, 1:48:56 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.astro/cgrid.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/cgrid.c
r41341 r41515 40 40 OnPic = FALSE; \ 41 41 First = TRUE; \ 42 for (d = firstDEC; (d < 90 + dD) && (LOnPic || NorthPole || SouthPole ); d += dD) { \42 for (d = firstDEC; (d < 90 + dD) && (LOnPic || NorthPole || SouthPole || InvalidCorner); d += dD) { \ 43 43 D = MAX (-90, MIN(90, d)); \ 44 44 ADD_COORDINATE((RA), D); \ … … 47 47 First = TRUE; \ 48 48 LOnPic = TRUE; \ 49 for (d = firstDEC; (d > -90 - dD) && (LOnPic || NorthPole || SouthPole ); d -= dD) { \49 for (d = firstDEC; (d > -90 - dD) && (LOnPic || NorthPole || SouthPole || InvalidCorner); d -= dD) { \ 50 50 D = MAX (-90, MIN(90, d)); \ 51 51 ADD_COORDINATE((RA), D); \ … … 59 59 First = TRUE; \ 60 60 lastRA = graphmode.coords.crval1 + 180.0; \ 61 for (r = firstRA; (r < lastRA + dR) && (LOnPic || NorthPole || SouthPole ); r += dR) { \61 for (r = firstRA; (r < lastRA + dR) && (LOnPic || NorthPole || SouthPole || InvalidCorner); r += dR) { \ 62 62 R = MIN (r, lastRA); \ 63 63 ADD_COORDINATE(R, D); \ … … 67 67 LOnPic = TRUE; \ 68 68 lastRA = graphmode.coords.crval1 - 180.0; \ 69 for (r = firstRA; (r > lastRA - dR) && (LOnPic || NorthPole || SouthPole ); r -= dR) { \69 for (r = firstRA; (r > lastRA - dR) && (LOnPic || NorthPole || SouthPole || InvalidCorner); r -= dR) { \ 70 70 R = MAX (r, lastRA); \ 71 71 ADD_COORDINATE(R, D); \ … … 167 167 SouthPole = TRUE; 168 168 169 // PSEUDOCYL modes need center R,D to be 0,0 and center pixel to be adjusted 170 OhanaProjection proj = GetProjection (graphmode.coords.ctype); 171 OhanaProjectionMode mode = GetProjectionMode (proj); 172 int InvalidCorner = FALSE; 173 if (mode == PROJ_MODE_PSEUDOCYL) { 174 // for PSEUDOCYL, the ra range is 360 if the corners are invalid 175 InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmin, graphmode.ymin, &graphmode.coords); 176 InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmax, graphmode.ymin, &graphmode.coords); 177 InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmax, graphmode.ymax, &graphmode.coords); 178 InvalidCorner |= XY_to_RD (&r, &d, graphmode.xmin, graphmode.ymax, &graphmode.coords); 179 } 180 169 181 range = MIN (fabs(graphmode.coords.cdelt1*(graphmode.xmax-graphmode.xmin)), fabs(graphmode.coords.cdelt2*(graphmode.ymax-graphmode.ymin))); 170 if (NorthPole || SouthPole ) range = 360;182 if (NorthPole || SouthPole || InvalidCorner) range = 360; 171 183 dR = range * GRID_SPACING; 172 184 dD = range * GRID_SPACING;
Note:
See TracChangeset
for help on using the changeset viewer.
