;+
; PROJECT:
;	SDAC
; NAME: 
;	GET_BATSE_POINTING
;
; PURPOSE:
;	This procedure extracts the GRO attitude from a database file
;	and returns the Z and X axis directions in degrees.
; CATEGORY:
;	BATSE
;
; CALLING SEQUENCE:
;	GET_BATSE_POINTING, date, zxradec
;
; CALLS:
;	none
;
; INPUTS:
;       date - Time readable by ANYTIM
;
; OPTIONAL INPUTS:
;	none
;
; OUTPUTS:
; 	Zxradec - GRO Z and X axis pointing in degrees.
;	[Z ra, Z dec, X ra, X dec]
;
; OPTIONAL OUTPUTS:
;	none
;
; KEYWORDS:
;	UT_OFF-Time of change in pointing within 1 orbit
; COMMON BLOCKS:
;	none
;
; SIDE EFFECTS:
;	none
;
; RESTRICTIONS:
;	Database file is only accurate to whole days, but spacecraft is
;	pointed during the day.
;
; PROCEDURE:
;	Uses database in SSWDB_BATSE, gro_pointing_cycle6.dat
;
; MODIFICATION HISTORY:
;	RAS, 15-apr-1996
;	RAS, 18-dec-1996, updated to gro_pointing_cycle6.dat, and finds
;	time in day of pointing change
;               RAS, 7-Jul-1997, changed PERM_DATA to SSWDB_BATSE
;	VERSION 5, 17-aug-1997, changed default path to BATSE_DATA, 
;		richard.schwartz@gsfc.nasa.gov
;-
pro get_batse_pointing, date, zxradec, ut_off=ut_off

out=0
readme=''
restore, loc_file(path=['BATSE_DATA','SSWDB_BATSE'], 'gro_pointing_cycle6.dat')

ut_off = (out(0,*))(*)
w = where(change ne 0.0)
ut_off(w)=change(w)

ut = anytim(date,/sec)

w  =where( ut(0) ge ut_off, nw)

i = w(nw-1)

zxradec = (out(1:4,i))(*)

end
