
;	(26-mar-91)
FUNCTION CUBE_ALIGN2, DATA, OFFSETS=OFFSETS, SAMPLE=SAMPLE, $
  MAG_FAC=MAG_FAC, INTERP=INTERP
;+
; NAME:
;	CUBE_ALIGN2
; PURPOSE:
;	Register a series of images using cross correlations.
; CALLING SEQUENCE:
;	DATA_OUT = CUBE_ALIGN2(DATA, OFFSETS=OFFSETS)
; OUTPUTS:
;	DATA_OUT = Aligned data cube
; MODIFICATION HISTORY:
;	Version 1.0 - Mar, 1991, G. L. Slater, LPARL
;-

  if n_elements(interp) eq 0 then interp = 0
  if n_elements(sample) eq 0 then sample = 1 
  if n_elements(mag_fac) eq 0 then mag_fac = 1 
  offsets = get_off2(data, sample=sample, mag_fac=mag_fac)

  return, translate2(data, offsets, interp=interp)

  end

