;+
; Project     : SOLAR-B - EIS
;
; Name        : EIS_CPT_CAM_readout_default
;
; Purpose     : Generates default structure EIS_CAM_readout.
;
; Explanation : Sets up default values for structure EIS_CAM_readout.
;
; Use         : <s = EIS_CPT_CAM_readout_default(node) >
;
; Inputs      : nodes : INTARR[4] FLAG indicating readout nodes enabled..
;
; Opt. Inputs : None.
;
; Outputs     : s : STRUCTURE of type EIS_CAM_readout
;
; Opt. Outputs: None.
;
; Keywords    : None.
;
; Calls       : None.
;
; Common      : None.
;
; Restrictions: None.
;
; Side effects: None.
;
; Category    : EIS_CPT.
;
; Prev. Hist. : None.
;
; Written     : Martin Carter RAL 03/08/04
;
; Modified    : Version 0.1, 29/09/04, MKC
;                 Removed CAM_hardware_window.
;               Version 0.2, 30/11/04, MKC
;                 Added flush_CCDS.
;               Version 0.3, 24/02/05, MKC
;                 Added ystart and yheight tags.
;               Version 0.4, 11/04/05, MKC
;                 Enable just left readout nodes.
;               Version 0.5, 12/04/05, MKC
;                 Reversed order of readout nodes.
;                 Added special readout sequence ID and renamed other normal readout sequence ID.
;                 Changed ystart and yheight tags to addresses tag.
;               Version 0.6, 24/06/05, MKC
;                 Changed INT values to UINT.
;               Version 0.7, 29/06/05, MKC
;                 Added node argument.
;               Version 0.8, 08/06/11, MKC
;                 Added ccd ro node to call.
;
; Version     : 0.8, 08/06/11
;-
;**********************************************************

FUNCTION eis_cpt_cam_readout_default, nodes, ccd_ro_node

  ; generate structure

  s = {EIS_CAM_readout}

  ; On_Chip_Binning          : UINT[2] X and Y flags. OCB will not be used so fixed
  ;                            at [1,1]. NB If OCB used would need appropriate CSG
  ;                            sequence ID and line list.

  s.On_Chip_Binning = [1,1] ; on chip binning not supported

  ; CAM_CSG_flush_sequence_ID : UINT Identifies clocking sequence required to perform
  ;                             flushing.

  s.CAM_CSG_flush_sequence_ID = 2 ; flush sequence CSG ID 2 (EIS telecommanding doc)

  ; CAM_CSG_normal_readout_sequence_ID : UINT Identifies normal clocking sequence required to
  ;                                      perform CCDs read-out.

  s.CAM_CSG_normal_readout_sequence_ID = 3  ; normal readout CSG ID (EIS telecommanding doc)

  ; CAM_CSG_special_readout_sequence_ID : UINT Identifies special clocking sequence required to
  ;                                       perform CCDs read-out.

  s.CAM_CSG_special_readout_sequence_ID = 4  ; special readout CSG ID (EIS telecommanding doc)

  ; Readout_nodes            : UINT[4] flags that define the CCD readout nodes.
  ;                                                  0 : CCDA R R/O chain enable
  ;                                                  1 : CCDA L R/O chain enable
  ;                                                  2 : CCDB R R/O chain enable
  ;                                                  3 : CCDB L R/O chain enable
  ;                            NB This setting must match the instrument automatic
  ;                            state set by the CAM command C_SET_AE.

  s.Readout_nodes = nodes

  ; CCD_ro_node              : UINT CCD readout node in linelist header required for hunter studies.

  s.CCD_ro_node = ccd_ro_node

  ; CCD_length               : UINT CCD readout register length. Only changes if
  ;                            OCB used so fixed at 2148.

  s.CCD_length = 2148 ; OCB not used

  ; flush_CCDs               : UINT number of times to flush CCDs before each exposure

  s.flush_CCDs = 5 ; taken from seq.00 from MCRW

  ;  addresses                : ULONG[4] Camera flare readout sequence window coordinate addresses
  ;                             for the FM CAM RROM CODE for CSG ID 4. Elements are :-
  ;                                                  0 : X start   = 0x04002D00
  ;                                                  1 : Y start   = 0x04000C00
  ;                                                  2 : X length  = 0x04010700
  ;                                                  3 : Y length  = 0x04001400

  s.addresses = ['04002D00'XUL, '04000C00'XUL, '04010700'XUL, '04001400'XUL]

  ; return structure

  RETURN, s

END





