sband transmitter idl routines

Last modified: Thu Mar 16 13:07:11 2023.


List of Routines


Routine Descriptions

SBINPSTATINFO - INPUT A STATUS INFO DATAFILE

[Next Routine] [List of Routines]
NAME:
sbinpstatinfo - input a status info datafile
SYNTAX: n=sbinpstatinfo(filename,stInfo,std=std)
ARGS:
filename: string     name of file to input
KEYWORDS:
     std:         if set, then ignore filename and read in the standard
                  file: idl/sb/statInfoStd.dat
RETURNS:
n      :  int   1   ok
               -1   first non comment line not ngroups n
               -2   trouble parsing grpnames
               -3   number groupnames doens't match ngroups
               -4   grouporder keyword not 3rd non comment line
               -10  trouble reading statinfo file
                
stInfo[n]: {}       struct array holding stat info
                    for each group

DESCRIPTION:
   Input a status info datafile and return the info
int the stInfo[] array. This data structure can then
be passed to sbplotstat() to generate plots.
	The file format is:
;  ; in column 1 are comments
ngroups  n                     .. number of separate groups in file
groupnames {1,name1} {2,name2} .. name for each group (plot title) 
grouporder  1 3 2              .. order to output groups
;wd bit  grp.ord label      
  0   0    1 000 'BODY I FF'   .. data for the plots
  0   1    1 010.3 'K1 COLL I FF'
  ....
  ...

 You can create a new file by copying statInfoAll.dat and editing it
The allowable edits are:
1. you can delete any lines you don't want
2. add more groups: 1.nnn  . 
   - each group is output ordered by the .nnn within each group
   - the default file has all the bits in 1 group
     You can generate multiple groups by changing the 1.  
3. reorder the output order within a group by changing the .nnn within each group
   (lower numbers are output first).
4. edit ngroups to reflect the number of groups in the file
5. edit groupnames to have a name for each group in file
   the format is {grpNum1,grpname1}  {grpNum2,grpname2} ... 
   .. don't include {} in the group name since the parser uses that for the delimitors
   if you have more than will fit on 1 line, just keep typing (without carriage return).
6. edit grouporder to be the order that the groups are output.
   If you want to ignore some bits, but you don't want to delete them,
   just throw them into a unique group, and then don't add this group 
   to the grouporder (you still need and entry in group names for each group)

	The return struct array contains:
 grpI.grpnum
 grpI.grpName
 grpI.nbits
 grpI.wdAr[maxentry] 	; used nbits to limit the number to less than maxentry
 grpI.bitAr[maxentry]
 grpI.labAr[maxentry]

 stInfo.ngroups
 stinfo.grpOrder[ngroups]; group numbers in order to output
 stinfo.grpI[ngroups]

(See /pkg/rsi/local/libao/phil/sb/sbinpstatinfo.pro)


SBLOGGET - READ SBAND LOG FILE

[Previous Routine] [Next Routine] [List of Routines]
NAME:
sblogget - read sband log file
SYNTAX: nrecs=sblogget(logfile,d,draw=draw)
ARGS:
logfile: string  filename to open and read
RETURNS:
nrec   : long  > 0 number of log records found
               -1 error opening or reading reading file 
d[n]   : {}    struct holding info scaled to engineering units
draw[n]: {}    strcut holding info before scaling to eng units.

DESCRIPTION:
	read all of the log records from the specified sband logfile.
The  data is returned in an array of structures (d). The meter data has
been scaled to engineering units (normally mulitply by 10^y (y=1,.1,.01).
If the draw keyword is supplied then a copy of the raw input data
(before meter scaling.. ints) is also returned.
	The data structure returned is:
 help,d,/st
** Structure <84a188c>, 4 tags, length=192, data length=191, refs=2:
   TM              BYTE      Array[8]
   DATE            BYTE      Array[8]
   STAT            BYTE      Array[47]
   MET             STRUCT    ->  Array[1]

 The meter data has been scaled to the same units as the online
723 program. The d.met structure contains:

IDL> help,d.met,/st
** Structure <84b8a14>, 32 tags, length=128, data length=128, refs=3:
   MAGVK1          FLOAT           167.000
   MAGVK2          FLOAT           148.000
   BEAMV           FLOAT           0.00000
   MAGIK1          FLOAT           13.0000
   MAGIK2          FLOAT           12.6000
   BODYI           FLOAT           0.00000
   FILVK1          FLOAT           10.6000
   FILVK2          FLOAT           10.2000
   FILIK1          FLOAT           18.9000
   FILIK2          FLOAT           18.4000
   COLIK1          FLOAT           0.00000
   COLIK2          FLOAT           0.00000
   VACIIK1         FLOAT          0.114815
   VACIIK2         FLOAT         0.0223872
   SP1             FLOAT           0.00000
   SP2             LONG                 0
   WASTFWDP        FLOAT           10.0000
   FWDPK1          FLOAT           0.00000
   REFLPK1         FLOAT           0.00000
   FWDPK2          FLOAT           3.00000
   REFLPK2         FLOAT         0.0200000
   WASTREFLP       FLOAT           0.00000
   TURNDLP         FLOAT           2.00000
   ANTFWDP         FLOAT           5.00000
   ANTREFLP        FLOAT           0.00000
   RFDRVPK1        FLOAT           3.00000
   RFDRVPK2        LONG                24
   WASTFLWRATE     FLOAT           287.000
   DELTATEMP       FLOAT          0.130000
   COLFLOWK2       FLOAT           310.000
   EXCITERINPP     FLOAT           3.00000
   SP3             FLOAT           0.00000

 abbreviations used are:
  K1 - klystron 1
  K2 - klystron 2
  I=current
  V=voltabe
  P=power
  Fwd=forward
  Refl=reflected
  mag=magnet
  fil=filament
  col=collector
  wast= wasterload
  turn: turnstile
  dl  : dummy load
  P   : proof
  spN : spare bit

Notes: you need to do @sbandinit before using this routine

(See /pkg/rsi/local/libao/phil/sb/sblogget.pro)


SBPLOTMET - PLOT THE SBAND METER VALUES VS TIME

[Previous Routine] [Next Routine] [List of Routines]
NAME:
sbplotmet - plot the sband meter values vs time
SYNTAX: sbplotmet,d,utit=utit,wait=wait,pagelist=pagelist
ARGS:
      d[n]:{}  sband long info read from disc via sblogget()
KEYWORDS:
utit: string   user title to add to top of  each page
wait:          if set then wait for return after each page.
pagelist:long  specify the pages to be plotted. pagelist=1236
               will plot pages 1,2,3, and 6

DESCRIPTION:
   Plot the meter values vs day number. The data should first
be input with sblogget(). 
	Utit is the user specified title that will be added to each page
pagelist=n can be used to plot only a subset of all of the pages.
eg pagelist=135 will only plot pages 1,3, and 5

	Plot pages are generated for:
Page 1: kly1 forwared power
        kly2 forwared power
        antenna forward power
        waster forward power

Page 2: kly1 reflected power
        kly2 reflected power
        antenna reflected power
        waster reflected power

Page 3: kly1,2  magnet voltage
        kly1,2  magnet currents
        kly1,2  filament voltages
        kly1,2  filament currents

Page 4: kly1,2 rf drive power
        kly1,2 collector currents
        beam voltage
        body current

Page 5: kly1,2 vacion current
        waster flow rate
        delta temp
        collector flow kly2

Page 6: turnstyle dummy load power
        exciter input proof

(See /pkg/rsi/local/libao/phil/sb/sbplotmet.pro)


SBPLOTSTAT - PLOT THE STATUS BITS VERSUS TIME

[Previous Routine] [List of Routines]
NAME:
sbplotstat - plot the status bits versus time
SYNTAX: sbplotstat,d,stI,utit=utit,wait=wait,gap=gap,laboff=laboff 
ARGS:
      d[n]:{}  sband long info read from disc via sblogget()
stI:  {}       statInfo input from file via sbinpstatinfo()
               determines which bytes and in what order to 
               output the data
KEYWORDS:
utit: string  	user title to add to each page
wait:          if set then wait for return after each page.
gap  : float    number of units of X that specify a gap in the
               data. If provided then an extra trace will appear
               at the top of each page showing when there was 
               valid data.
laboff: float  fraction of screen distance to move the labels to the
               left. For hardcopy .2 is ok. for interactive display
               .1 is probably better.

DESCRIPTION:
	Make a plot of sband status bits vs x (normally dayno).
The stI struct info is read from a file via sbinpstatinfo().
It contains the number of "groups" to output. Each group is
output starting on a new page. The order of the groups as
well as the bits within each group is also contained in stI.
	To generate a different plot:
1. copy sbStatInfoAll.dat to a new file.
2. edit the new file removing bits that aren't needed
3. assign different bits to different groups and arrange
   the order of output in each group to what you want.
4. use sbinpstatinfo() to read this file and pass it to
   this routine.

(See /pkg/rsi/local/libao/phil/sb/sbplotstat.pro)