% hiftwfp.m
%
% script to generate waterfall plot of pre-processed
% data set.  Assumes one-half periods of skipped in
% the processing to match the processing done in early
% 1992.
%
% 6June2000...initial version...K.Metzger
%
clear all;

% specify starting bin and number of bins to plot
%
start_bin = 5600; % matches x0270949.sam processing
plot_bins = 2001;

load plot.mat tseries fname;     % read pre-processed data set

[nrows, ncols] = size(tseries);  % determine data set size

% extract only portion of most interest
%
tseries = tseries(start_bin:start_bin+plot_bins-1, :);

[nrows, ncols] = size(tseries);  % determine subset size

figure =1; clf; hold on;

% generate the grid MATLAB needs for waterfall plots
%
[X, Y] = meshgrid(start_bin:start_bin+nrows-1, 1:ncols);

tseries = tseries.*tseries;  % magnitudes squared

zmax = max(max(tseries));    % to scale the plotted values

% generate waterfall and setup desired plot characteristics
%
colormap([0 0 0]);
waterfall(X, Y, tseries.');  
axis([start_bin, start_bin+nrows-1, 1, ncols, 1, 2.5*zmax]);
view(0, 60);
grid off;
title(fname);