!
!
	integer function get_calibration(header, cal_axis, 
	1	cal_ee, cal_unit)
	implicit integer (a-z)

	integer header(128), cal_unit(2), cal_axis, cal_ee(5)

	include 'headdef.cmn/nolist'

c
c	Get the calibration information from a header array
c	Header is an array of dim 128
c	cal_ee is an array of 5 elements containing the calibration
c	constants. In the call they are reals but are treated as in
c	tegers since header is an integer array.
c	cal_unit is in the call a string descriptor pointing to character
c	string of length 4. It is here assumed as an integer array
c	of size 2 ( containing the length and address)
c
c	The routine does not use global symbols.
c

	parameter ( x_axis = 1, y_axis = 2, z_axis = 3)

	if(cal_axis .eq. x_axis) then
	  entry = shp_calx
	else if(cal_axis .eq. y_axis) then
	  entry = shp_caly
	else if(cal_axis .eq. z_axis) then
	  entry = shp_calz
	else
	  result = err_add_text(0,'illegal axis value')
	  goto 1000
	endif

c
c	Get the arguments in the header
c

	if(header(entry) .eq. 0) then
	  result = err_add_text(0,'no calibration')
	  goto 1000
	end if

	do i = 1,5

	  cal_ee(i) = header(entry + i)

	end do

	long_word = header(entry + shp_calid)
	call lib_putlong(cal_unit(2) , long_word)
	result = 1

 1000	if(.not. result) then
	  result = err_add_text(result,'**get_calibration')
	end if

	get_calibration = result

	end


