MATLAB / History Buffer Analysis package for klystron data analysis. The following station data is from the history buffer file BCUR -- The peak-held beam current (only if station has a MKSU) BVLT -- The peak-held beam voltage ( '' ) PDES -- The "desired" phase for the station (only SBST or MKSU) KPHR -- The klystron phase shifter position ( '' ) PJTT -- The phase jitters AJTT -- The amplitude jitters The beam parameters are used to calculate the voltage, current, and perveance of the klystron. The usual formulae: "I = perveance * V^(3/2)" and "Power = V * I" are used. Points are disqualified if any of the following is true: o Beam voltage point must be within at least 20 kVolts of the highest point, and at least 180 kVolts. o Beam current point must be within at least 20 Amps of the highest point, and at least 180 amps. Stored for each station is: o The Delta kVolts (max value - min value ) from the valid points. o The Delta Amps from the set of valid points. o The Delta megaWatts from the set of valid points. o The Delta micro-perveance from the set of valid data points. o The number of data points remaining following the tests on beam Volts and Amps, the number of points used for jitters and trims. o The number of jitter tolerance points for each amplitude and phase. The phase parameters are used to guess the number of trims, and to calculate the motion of the phase shifter. All points are used. To be a "trim", the KPHR value must change, the PDES must not, and the trim amount must exceed the trim tolerance (1/2 the check tolerance in the database) The phase shifter motion associated with trims is computed by integrating all motions as fdefined by the preceeding paragraph. The Trim values are then processed to remove any +360/-360 degree discontinunities. Stored for each station is: o The number of anomalous KPHR changes ("trims") o The Delta phase shift from the processed Trim readings. Listed on the output are: Time of analysis. The summaries of the worst station statistics. The worst 16 in each catagory are listed. Normalization is done to compensate for differences in history buffer data point counts. The data for all klystron stations. The "average" values for all stations. Any station which has a value of exactly zero for the averaged item is not used in computing the average. This keeps offline subboosters and stations from changing the averages.