;+
; NAME:
;     SFD_CDS
; PURPOSE:
;     overlay CDS or TRACE field of view on the most recent SFD
; CATEGORY: 
; CALLING SEQUENCE:
;     sfd_cds, cds_cen, cds_fov
;     sfd_cds, [0,0], [240,240] would be a standard CDS FOV at disk center
;     sfd_cds, [-600,600], [314,314] puts an SXT 2x2 OR near the NE limb
;     sfd_cds, cds_cen, cds_fov, /notv
;     sfd_cds, trace_cen, /trace  ;puts 8.5x8.5 arcmin box at position
;					given by trace_cen
; INPUTS:
;     CDS parameters (see 
;       http://sohodb.nascom.nasa.gov/synoptic/.targets/soho_today.html)
;     
;     CDS_CEN is x- and y-displacement of center of box from disk
;	center, in arcseconds.
;     CDS_FOV is [width,height] of box, in arcseconds.
;
;     Defaults to Sun center and an SXT 2x2 FOV.
;
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
;     NOTV, when set, lets you put another box on the same image
; OUTPUTS:
; COMMON BLOCKS:
; SIDE EFFECTS:
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     24-Apr-97, HSH, written 
;     01-jun-98, DMcK, corrected FOV by factor of 2
;     06-oct-98, DMcK, added /trace switch for default TRACE FOV.
;			Fixed too-small size of default SXT FOV.
;			Enhanced previously obscure documentation.
;-

pro sfd_cds, cds_cen, cds_fov, qstop=qstop, notv = notv, trace=trace
lastsfd,index,data,/notv

; Start with default values.
if n_elements(cds_fov) eq 0 then cds_fov = [314,314]
if n_elements(cds_cen) eq 0 then cds_cen = [0,0]

; Is it specified as TRACE?
if keyword_set(trace) then cds_fov = [510,510]

if keyword_set(notv) then begin
  lastsfd,index,data,/notv
endif else lastsfd,index,data
cds_cen = conv_a2p(cds_cen,index)/2
if keyword_set(notv) eq 0 then begin
  fact = gt_pix_size(gt_res(index))
endif else fact = 4.92
cds_fov = cds_fov/fact
x0 = cds_cen(0)-cds_fov(0)/2.
x1 = cds_cen(0)+cds_fov(0)/2.
y0 = cds_cen(1)-cds_fov(1)/2.
y1 = cds_cen(1)+cds_fov(1)/2.
draw_boxcorn,x0,y0,x1,y1
if keyword_set(qstop) then stop
end
