Viewing contents of file '../idllib/ghrs/pro/calhrs_air.pro'
;+
;*NAME:
;			calhrs_air
;
;*PURPOSE:
; Convert vacumm wavelengths to air wavelenghts
;
;*PARAMETERS:
; CALLING SEQUENCE:
;	calhrs_air,wave,ih,log
;
; INPUT/OUTPUT:
;	wave - wavelength vector(s)
;
; OPTIONAL INPUT/OUTPUTS:
;	ih - header array (if supplied the conversion will be flagged)
;	log - processing log
;
; HISTORY:
;	version 1  D. Lindler April 89
;       Mar 18 1991      JKF/ACC    - moved to GHRS DAF (IDL Version 2)
;
;--------------------------------------------------------------------------
pro calhrs_air,wave,ih,log


	VERSION = 1.0
;
; COMPUTE CONVERSION FACTOR
;
	WAVE2=WAVE*WAVE
	FACT=1.0 + 2.735182E-4 + 131.4182/WAVE2 + 2.76249E8/(WAVE2*WAVE2)
	FACT= FACT*(WAVE GE 2000.) + 1.0*(WAVE LT 2000.0)
;
; CONVERT WAVELENGTHS
;
	WAVE=WAVE/FACT
;
; UPDATE PROCESSING LOG
;
	hist='CALHRS_AIR version'+string(version,'(F5.2)')+ $
		': Conversion to air wavelengths above 2000 A'
	if !dump gt 0 then printf,!textunit,hist
	if n_elements(log) gt 0 then sxaddhist,hist,log
	if n_elements(ih) gt 0 then ih(67,0)=ih(67,*) or 32
RETURN
END