Hello.I am getting different results from an SPP program when I use the "-z" switch
on xc. The program is a whittled down version of zzdebug from the IRAF MWCS
subdirectory. I'm only running the test progrm "wcs" within zzdebug. The
starred lines show the different results: astoria-65: xc strange_bug.x
strange_bug.x:
sys_runtask:
t_wcs:
plterm:
strange_bug.f:
sysruk:
twcs:
plterm:
link:
astoria-66: strange_bug.e
> wcs
----- lterm -----
0.866 0.500 0.000 : 10.000
-0.500 0.866 0.000 : 20.000
0.000 0.000 1.000 : 0.000
----- lterm -----
** 3.464 2.000 0.000 : 40.000
** -0.100 0.173 0.000 : 4.000
0.000 0.000 1.000 : 0.000
> bye
astoria-68: xc -z strange_bug.x
strange_bug.x:
sys_runtask:
t_wcs:
plterm:
strange_bug.f:
sysruk:
twcs:
plterm:
link:
astoria-69: strange_bug.e
> wcs
----- lterm -----
0.866 0.500 0.000 : 10.000
-0.500 0.866 0.000 : 20.000
0.000 0.000 1.000 : 0.000
----- lterm -----
** 3.464 0.100 0.000 : 40.000
** -2.000 0.173 0.000 : 4.000
0.000 0.000 1.000 : 0.000
> bye
I'm fairly confident that these are not equivalent matrices which are
produced by the call to mw_scale(). Why should "-z" affect the results?
There is no urgency to this question -- I stumbled upon this difference
when trying to compare two different versions of some code.My sample code follows. The include file ("imwcs.h") comes directly
from the IRAF MWCS directory.Thanks,David Van Stone
-------# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.include <mach.h>
include <math.h>
include <mwset.h>
include "imwcs.h"task wcs = t_wcs
# WCS -- Test the creation and use of a world coordinate system.procedure t_wcs()pointer mw
real theta, center[2], scale[2], shift[2]
real ltm[3,3], ltv[3]
double l2m[2,2], l2v_1[2], l2v_2[2], d_theta
int ndim
pointer mw_open()begin
ndim = 3 # Create a unitary, 3 dim WCS.
mw = mw_open (NULL, ndim) # Apply a transform to the first 2 axes.
d_theta = DEGTORAD(30.0D0)
l2m[1,1] = cos(d_theta); l2m[2,1] = sin(d_theta)
l2m[1,2] = -sin(d_theta); l2m[2,2] = cos(d_theta)
l2v_1[1] = 0.0; l2v_1[2] = 0.0
l2v_2[1] = 10.0; l2v_2[2] = 20.0 theta = d_theta; call aclrr (center, 2)
call mw_rotate (mw, theta, center, 3
shift[1] = 10.0; shift[2] = 20.0
call mw_shift (mw, shift, 3
# Examine the Lterm.
call plterm (mw, ltm, ltv, ndim) scale[1] = 4.0; scale[2] = 0.2
call mw_scale (mw, scale, 3
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.include <mach.h>
include <math.h>
include <mwset.h>
include "imwcs.h"task wcs = t_wcs
# WCS -- Test the creation and use of a world coordinate system.procedure t_wcs()pointer mw
real theta, center[2], scale[2], shift[2]
real ltm[3,3], ltv[3]
double l2m[2,2], l2v_1[2], l2v_2[2], d_theta
int ndim
pointer mw_open()begin
ndim = 3 # Create a unitary, 3 dim WCS.
mw = mw_open (NULL, ndim) # Apply a transform to the first 2 axes.
d_theta = DEGTORAD(30.0D0)
l2m[1,1] = cos(d_theta); l2m[2,1] = sin(d_theta)
l2m[1,2] = -sin(d_theta); l2m[2,2] = cos(d_theta)
l2v_1[1] = 0.0; l2v_1[2] = 0.0
l2v_2[1] = 10.0; l2v_2[2] = 20.0 theta = d_theta; call aclrr (center, 2)
call mw_rotate (mw, theta, center, 3
shift[1] = 10.0; shift[2] = 20.0
call mw_shift (mw, shift, 3
# Examine the Lterm.
call plterm (mw, ltm, ltv, ndim) scale[1] = 4.0; scale[2] = 0.2
call mw_scale (mw, scale, 3
# Examine the Lterm.
call plterm (mw, ltm, ltv, ndim) call mw_close (mw)
end
# PLTERM -- Print the Lterm.procedure plterm (mw, ltm, ltv, ndim)pointer mw
real ltm[ndim,ndim]
real ltv[ndim]
int ndimint i, jbegin
# Examine the Lterm.
call mw_gltermr (mw, ltm, ltv, ndim)
call eprintf ("----- lterm -----\n") do j = 1, ndim {
do i = 1, ndim {
call eprintf (" %8.3f")
call pargr (ltm[i,j])
}
call eprintf (" : %8.3f\n")
call pargr (ltv[j])
}
end