[daip] Bug in IRING

Patrick Leahy jpl at jb.man.ac.uk
Wed Jul 24 18:27:33 EDT 2002


Hi folks,
	I just found a but in IRING: the centre of the rings is off by 1
pixel on each axis. This is easy to see by setting the width of the ring
to less than 1 pixel, so the central circle contains just one pixel
centre. The first "Average" then is equal to this pixel value, which can
be compared with the one read from the image by IMVAL or CURVAL.

I think this bug has been around for a long time... I was always puzzled
that IRING never seemed to peak up as much as I expected. 

cheers,
		Paddy Leahy

Here is the offending code:

Lines 237-238:

      RCEN(1) = CATR(KRCRP) + APM(1) + 1.0 - BLC(1)
      RCEN(2) = CATR(KRCRP+1) + APM(2) + 1.0 - BLC(2)

                    ! OK so far: APM (ie APARM) (1)&(2) are offsets from
                    ! the reference pixel. RCEN is then the pixel coord
                    ! in a system where the BLC has coords (1,1).
                    ! BLC is properly set to 1.0 if zero on input.

Lines 265 ff:

 100  DO 200 J = 1,NYW
         CALL LINIO ('READ', L16, FIND, RBUF, NXW, ARR, 1, BLNK, IER)
         IF (IER.NE.0) THEN
            WRITE (MSGTXT,1100) IER
            CALL MSGWRT (8)
            GO TO 980
            END IF
         DO 180 I = 1,NXW
            IF (ARR(I).EQ.BLNK) THEN
               ARR(I) = 0.0
               IF (CPM(4).EQ.0.0) GO TO 180
               END IF

                  ! So I, J are then the coords of the current pixel
                  ! in the selected window, i.e. same scheme as RCEN

C                                       RX, RY - position of the
C                                       given pixel relative to center
C                                       of the field
            RX = (I - 1 - RCEN(1)) * DX
            RY = (J - 1 - RCEN(2)) * DY
     !             ^^^^                   The bug! (for both RX and RY).




More information about the Daip mailing list