Changeset 41515
- Timestamp:
- Apr 2, 2021, 1:48:56 PM (5 years ago)
- Location:
- trunk/Ohana/src/opihi/cmd.astro
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/cdensify.c
r41341 r41515 144 144 145 145 float F = 1.0; 146 if (vv) { 147 F = isFloatScale ? Fs[i] : Is[i]; 148 } 146 if (vv) { F = isFloatScale ? Fs[i] : Is[i]; } 149 147 150 148 switch (PSFTYPE) { -
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; -
trunk/Ohana/src/opihi/cmd.astro/coords.c
r41379 r41515 7 7 int i, mode, form, N, Quiet; 8 8 double Xin, Yin, Xout, Yout; 9 char *MOSAIC;10 9 Coords coords, moscoords; 11 10 Buffer *buf, *mosbuffer; 12 11 Vector *xvec = NULL; 13 12 Vector *yvec = NULL; 13 char *MOSAIC = NULL; 14 14 15 15 if ((N = get_argument (argc, argv, "-copy"))) { … … 36 36 } 37 37 38 MOSAIC = NULL;39 38 if ((N = get_argument (argc, argv, "-mosaic"))) { 40 39 remove_argument (N, &argc, argv); -
trunk/Ohana/src/opihi/cmd.astro/region.c
r41341 r41515 165 165 got_ctype: 166 166 167 graphmode.coords.crval1 = Ra; 168 graphmode.coords.crval2 = Dec; 169 170 float pc1_1 = (graphmode.flipeast) ? -1 : 1; 171 float pc2_2 = (graphmode.flipnorth) ? -1 : 1; 172 173 graphmode.coords.pc1_1 = cos(Angle*RAD_DEG)*pc1_1; 174 graphmode.coords.pc1_2 = sin(Angle*RAD_DEG)*pc2_2; 175 graphmode.coords.pc2_1 = -sin(Angle*RAD_DEG)*pc1_1; 176 graphmode.coords.pc2_2 = cos(Angle*RAD_DEG)*pc2_2; 167 // set the rotation 168 { 169 float pc1_1 = (graphmode.flipeast) ? -1 : 1; 170 float pc2_2 = (graphmode.flipnorth) ? -1 : 1; 171 172 graphmode.coords.pc1_1 = cos(Angle*RAD_DEG)*pc1_1; 173 graphmode.coords.pc1_2 = sin(Angle*RAD_DEG)*pc2_2; 174 graphmode.coords.pc2_1 = -sin(Angle*RAD_DEG)*pc1_1; 175 graphmode.coords.pc2_2 = cos(Angle*RAD_DEG)*pc2_2; 176 } 177 178 // determine central pixel for projection: 179 { 180 // PSEUDOCYL modes need center R,D to be 0,0 and center pixel to be adjusted 181 OhanaProjection proj = GetProjection (graphmode.coords.ctype); 182 OhanaProjectionMode mode = GetProjectionMode (proj); 183 184 graphmode.coords.crpix1 = 0.0; 185 graphmode.coords.crpix2 = 0.0; 186 187 if (mode == PROJ_MODE_PSEUDOCYL) { 188 graphmode.coords.crval1 = Ra; 189 graphmode.coords.crval2 = 0.0; 190 } else { 191 graphmode.coords.crval1 = Ra; 192 graphmode.coords.crval2 = Dec; 193 } 194 195 if (mode == PROJ_MODE_PSEUDOCYL) { 196 double Xc, Yc; 197 RD_to_XY (&Xc, &Yc, Ra, Dec, &graphmode.coords); 198 graphmode.coords.crpix2 = -Yc; 199 fprintf (stderr, "center pixel is %f, %f\n", Xc, Yc); 200 } 201 } 177 202 178 203 // ask kapa for coordinate limits, to get the right aspect ratio
Note:
See TracChangeset
for help on using the changeset viewer.
