FUNCTION QTILT, WAVE, REQ_DATE
;
    on_error, 2
;
;  Check the input parameters.
;
    if n_params() ne 2 then begin
           get_utc, req_date
    endif

;
;   convert date to standard
;
        date = anytim2utc(req_date)

;
;  Check the spectrum value.
;
        spec = 0
        if wave gt 307.1 and wave lt 379.44 then spec = 1
        if wave gt 511.6 and wave lt 632.82 then spec = 2

        if spec eq 0 then begin
           print,'Wavelength out of range'
           return, 0.0
        endif

;
;  get tilt calibration
;
        get_tiltcal,spec,date,coeff

;
;  get tilt for specific wavelength
;
        if spec eq 1 then begin
           pix = wave2pix('n1',wave)
        endif else begin
           pix = wave2pix('n2',wave)
        endelse

;
;  return with tilt
;
        return,poly(pix,coeff)

    end