From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/images/lib/rglltran.x | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pkg/images/lib/rglltran.x (limited to 'pkg/images/lib/rglltran.x') diff --git a/pkg/images/lib/rglltran.x b/pkg/images/lib/rglltran.x new file mode 100644 index 00000000..890cec0b --- /dev/null +++ b/pkg/images/lib/rglltran.x @@ -0,0 +1,42 @@ +include +include + +# RG_LLTRANSFORM -- Transform the reference image world coordinates to the +# input image world coordinate system. + +procedure rg_lltransform (cooref, cooin, rxlng, rylat, ixlng, iylat, npts) + +pointer cooref #I pointer to the reference image coordinate structure +pointer cooin #I pointer to the input image coordinate structure +double rxlng[ARB] #I the x refererence image world coordinates (degrees) +double rylat[ARB] #I the y refererence image world coordinates (degrees) +double ixlng[ARB] #O the x refererence image world coordinates (degrees) +double iylat[ARB] #O the y refererence image world coordinates (degrees) +int npts #I the number of coordinates + +int i +double ilng, ilat, olng, olat +int sk_stati() + +begin + if (sk_stati (cooref, S_PLNGAX) < sk_stati (cooref, S_PLATAX)) { + do i = 1, npts { + ilng = DEGTORAD (rxlng[i]) + ilat = DEGTORAD (rylat[i]) + call sk_lltran (cooref, cooin, ilng, ilat, INDEFD, + INDEFD, 0.0d0, 0.0d0, olng, olat) + ixlng[i] = RADTODEG (olng) + iylat[i] = RADTODEG (olat) + } + } else { + do i = 1, npts { + ilng = DEGTORAD (rylat[i]) + ilat = DEGTORAD (rxlng[i]) + call sk_lltran (cooref, cooin, ilng, ilat, INDEFD, + INDEFD, 0.0d0, 0.0d0, olng, olat) + ixlng[i] = RADTODEG (olat) + iylat[i] = RADTODEG (olng) + } + } +end + -- cgit