;+
; NAME:
;	SMEI_SEQUENCE::GET_SHIFT
;
;
; PURPOSE:
;	To get the PA shift for showing a smei sequence.
;
;
; CATEGORY:
;	SMEI_SEQUENCE
;
;
; CALLING SEQUENCE:
;	shift=seqref -> get_shift()
;
;
; OUTPUTS:
;	shift	int/fl	The factor by which to scale the images.
;
;
; KEYWORD PARAMETERS:
;	/raw	If set, then return the internal format of the factor
;		(i.e. how many right angles)
;	/degree	If set, then return the number of derees of shift
;
; NOTE:
;	The default is to return the number of Pixels to shift
;
; MODIFICATION HISTORY:
;	Original (after get_zoom): 23/11/09; SJT
;-

function smei_sequence::get_shift, raw = raw, degrees = degrees

if keyword_set(degrees) then zero = 0.0 $
else zero = 0

im1 = self -> get_first()
if ~obj_valid(im1) then return, zero

if im1 -> get_projection() ne 2 then return, zero ; Only applies to
                                ; rectangular projections.

if keyword_set(degrees) then return, self.options.pa_shift*90.
if keyword_set(raw) then return, self.options.pa_shift

zf = self -> get_zoom()
sz = im1 -> get_size(/x)
shift = self.options.pa_shift*zf*sz/4
return, shift

end
