C Copyright(c) 1997, Space Science and Engineering Center, UW-Madison
C Refer to "McIDAS Software Acquisition and Distribution Policies"
C in the file  mcidas/data/license.txt

      SUBROUTINE SATTVR(FRAM,LIN,ELE,TVLIN,TVELE,SS,JDAY,TIME)
C *** $Id: sattvr.f,v 1.10 1997/10/10 20:18:47 dglo Exp $ ***
C $ SUBROUTINE SATTVR(FRAM,LIN,ELE,TVLIN,TVELE,SS,JDAY,TIME)
C $ TRANSFORMS FROM SATELLITE TO TV COORDINATES
C $ FRAM = (I) INPUT FRAME NUMBER
C $ LIN = (R) INPUT LINE SATELLITE COORDINATE
C $ ELE = (R) INPUT ELEMENT SATELLITE COORDINATE
C $ TVLIN = (R) OUTPUT LINE TV COORDINATE
C $ TVELE = (R) OUTPUT ELEMENT TV COORDINATE
C $ SS = (I) OUTPUT SATELLITE IDENTIFICATION NUMBER
C $ TIME = (I) OUTPUT HHMMSS OF FRAME
C $ JDAY = (I) OUTPUT YYDDD OF FRAME
C $$ SATTV = TV, CONVERT, COORDINATES, SATELLITE
      IMPLICIT INTEGER (A-Z)
      REAL LIN,ELE,TVLIN,TVELE
      COMMON /FRAME/ FRMENT(64)
      DATA FRMWRD/13/,FSAV/-1/
C----
      IF(FRAM.LT.1.OR.FRAM.GT.LUC(FRMWRD)) GOTO 900
      IF(FRAM.EQ.FSAV) GO TO 10
      CALL GETFRM(FRAM,FRMENT)
      ITVLUP=FRMENT(8)
      ITVEUP=FRMENT(9)
      MAGL=FRMENT(10)
      MAGE=MAGL
      IF (FRMENT(33).GT.0) MAGE=FRMENT(33)
      LINRES=FRMENT(11)
      IELRES=FRMENT(12)
      IF(FRMENT(2).EQ.0) GOTO 900
      FSAV=FRAM
10    CONTINUE
      SS=FRMENT(1)
      JDAY=FRMENT(2)
      TIME=FRMENT(3)
      TVLIN=ITVLUP+(MAGL*(LIN-FRMENT(5)))/LINRES
      TVELE=ITVEUP+(MAGE*(ELE-FRMENT(6)))/IELRES
      RETURN
  900 CALL EDEST('SATTVR: INVALID FRAME NUMBER ',FRAM)
      RETURN
      END
