Changeset 1208
- Timestamp:
- Jul 12, 2004, 12:18:39 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibADD.tex (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibADD.tex
r1090 r1208 1 %%% $Id: psLibADD.tex,v 1.2 0 2004-06-25 03:04:46eugene Exp $1 %%% $Id: psLibADD.tex,v 1.21 2004-07-12 22:18:39 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 685 685 sum is renormalized by the ratio (12.57/16.00). 686 686 687 \paragraph{Image Rotation} 688 689 Image rotation can be performed in two possible ways under different 690 circumstances, identified in the following discussion. 691 692 In the simplest case, the rotation angle is an integer multiple of 90 693 degrees ($\pi/2$ rad). In these cases, the input and output pixels 694 have a one-to-one mapping. If the input image has dimensions of $N_x, 695 N_y$, then the output image will have dimensions of either $N_x, N_y$ 696 (for even multiples of 90 degrees) or $N_y, N_x$ (for odd multiples). 697 698 If the angle of the rotation is not a multiple of 90, then the output 699 pixels necessarily result from the interpolation of several input 700 pixels. In this case, for an input image of dimensions $N_x, N_y$ and 701 rotation angle $\theta$, the output image has dimensions $Lx = |N_x 702 \cos \theta| + |N_y \sin \theta|$ and $Ly = |N_x \sin \theta| + |N_y 703 \cos \theta|$, each dimension rounded up to the nearest integer as 704 needed. Every pixel in the output image is in general derived from an 705 interpolation over 4 neighboring pixels. The coordinate of a pixel in 706 the output image ($i,j$) corresponds to a fractional pixel coordinate 707 ($x,y$) in the input image according to: 708 \[ x = (i - i_o)*\cos\theta + (j - j_o)*\sin\theta \] 709 \[ y = (i_o - i)*\sin\theta + (j - j_o)*\cos\theta \] 710 where the offset coordinate ($i_o,j_o$) depends on the sign of the 711 sine of the angle $\theta$. If the sign of that sine is positive, the 712 offset coordinate is ($N_y\sin\theta$,0), otherwise it is 713 (0,$-N_x\sin\theta$). 714 687 715 \subsubsection{Celestial Coordinate Conversions} 688 716 … … 692 720 PSLib function & SLALIB function \\ \hline 693 721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 694 \code{psCoordinatesI toE()} & \code{sla_EQECL} \\695 \code{psCoordinatesE toI()} & \code{sla_ECLEQ} \\696 \code{psCoordinatesI toG()} & \code{sla_EQGAL} \\697 \code{psCoordinatesG toI()} & \code{sla_GALEQ} \\722 \code{psCoordinatesICRSToEcliptic()} & \code{sla_EQECL} \\ 723 \code{psCoordinatesEclipticToICRS()} & \code{sla_ECLEQ} \\ 724 \code{psCoordinatesICRSToGalactic()} & \code{sla_EQGAL} \\ 725 \code{psCoordinatesGalacticToICRS()} & \code{sla_GALEQ} \\ 698 726 \end{tabular} 699 727 … … 778 806 {\rm where}\hspace{1cm} z & \equiv & \sqrt{1 - (x\pi/720^\circ)^2 - (y\pi/360^\circ)^2} 779 807 \end{eqnarray} 808 809 \subsubsection{Offset} 810 811 Coordinate offsets can either spherical offsets or linear offsets. 812 813 A spherical offset is performed by adding the components of the 814 offset, after unit conversion, to the given position. The resulting 815 coordinates must be wrapped to within the allowed range ($-\pi$ to 816 $\pi$, 0 to $2\pi$). 817 818 A linear offset is defined to be a linear offset in a tangent 819 projection centered on the starting coordinate with $y$ axis aligned 820 with the local direction or increasing Declination. This projection 821 is undefined only for the coordinates exactly at the north and south 822 poles, in which case the orientation is defined to have the $y$ axis 823 parallel to the line of RA = 0.0. The scale of the projection is 1.0 824 (ie, 1 'pixel' is 1 radian) and the given offsets must the scaled 825 based on the given offset units. 826 827 Pseudo-code to implement the above for an offset: 828 829 \begin{verbatim} 830 psSphere *psSphereSetOffset (psSphere pos, psSphere offset) { 831 832 psPlane lin; 833 psSphere new; 834 psProjection proj; 835 836 proj.R = pos->r; 837 proj.D = pos->d; 838 proj.X = 0; 839 proj.Y = 0; 840 proj.type = PS_PROJ_TAN; 841 842 lin.x = offset.r; 843 lin.y = offset.d; 844 845 new = psDeproject (&lin, &proj); 846 return (new); 847 } 848 \end{verbatim} 780 849 781 850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note:
See TracChangeset
for help on using the changeset viewer.
