Re: special value for line drawing routines

From: Dave Kennison (kennison AT unknown)
Date: Wed Sep 11 1996 - 11:55:29 MDT


        
Rich Selin writes:

> I am drawing a zonal average line on my plot page along the
> side of my xy plot with the routine 'curved'. However, there
> are times when I don't want points plotted in the line, for
> example, when there is all land points in the zonal average at
> the South Pole.
>
> Is there a 'special value' that I can set like SPV for the
> Conpack package? I'd rather not have to go through a do loop
> and plot the line one point at a time.
        
I assume you're not using AUTOGRAPH (which does have a special-value
feature for curve points), but instead just calling CURVED directly.

I see no evidence for any such "internal parameter" in any of the
old family of dash packages and I did not implement any such thing
in the new DASHPACK.

One possibility is to write a routine called CURVES that skips special-
value curve points and then call that routine instead of CURVED. In
fact, I just put together such a routine and am enclosing it below
as part of a test driver illustrating its behavior. (Please note that
this turned out to be a little more complicated than I anticipated
and that I have not done *really* thorough testing of the routine.)

Calling CURVES will work just fine as long as you're calling CURVED
directly. If you're calling it indirectly, though (you're calling
a package that calls CURVED for you), then there's a problem, because
you may not be able to get at the calls to CURVED to change them to
call CURVES.

I will look into the possibility of incorporating a "special-value"
flag in the new DASHPACK.

Cheers,

Dave Kennison

-------------

Program follows:

      PROGRAM TESTIT
        DIMENSION XDAT(721),YDAT(721)
        DO 101 I=1,721
          IF (I.LT.100.OR.I.GT.200.AND.I.NE.700) THEN
          XDAT(I)=REAL(I-1)/720.*COS(.017453292519943*REAL(I-1))
          YDAT(I)=REAL(I-1)/720.*SIN(.017453292519943*REAL(I-1))
        ELSE
          XDAT(I)=1.E36
          YDAT(I)=1.E36
        END IF
  101 CONTINUE
        CALL OPNGKS
        CALL SET (0.,1.,0.,1.,-1.1,1.1,-1.1,1.1,1)
        CALL CURVES (XDAT,YDAT,721,1.E36)
        CALL FRAME
        CALL CLSGKS
        STOP
      END

      SUBROUTINE CURVES (XDAT,YDAT,NDAT,SPVA)
        DIMENSION XDAT(NDAT),YDAT(NDAT)
        IBEG=0
        DO 101 IDAT=1,NDAT
          IF (XDAT(IDAT).EQ.SPVA) THEN
            IF (IBEG.NE.0) THEN
              IF (IBEG-IDAT.EQ.1) THEN
                CALL POINT (XDAT(IBEG),YDAT(IBEG))
              ELSE
                CALL CURVED (XDAT(IBEG),YDAT(IBEG),IDAT-IBEG)
              END IF
              IBEG=0
            END IF
          ELSE
            IF (IBEG.EQ.0) IBEG=IDAT
          END IF
  101 CONTINUE
        IF (IBEG.NE.0) THEN
          IF (IBEG.EQ.NDAT) THEN
            CALL POINT (XDAT(IBEG),YDAT(IBEG))
          ELSE
            CALL CURVED (XDAT(IBEG),YDAT(IBEG),NDAT-IBEG+1)
          END IF
        END IF
        RETURN
      END



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:44:56 MDT