%
% This script creates a map of a tropical cyclone track, specified by
% maximum lifetime intensity, by maximum wind speed at a point of interest
% or the intersection points of tracks with a specified set of line
% segments, or by track number. "Prep" must be run before this can be 
% used. This script requires installation of the "m_map" routines.
% November 2008
% Copyright 2009 WindRiskTech L.L.C.
% Modified July, 2020 to account for larger size of colormaps
% Modified 24 June 2026 to add SST anomaly time series and streamline code
%-------------------------------------------------------------------------
%
setplot;
%
nplot=2;
while nplot > 1
    nplot=menu('Track plots','Stop','Track on map background', 'Track on satellite background', ...
        'Track in Google Earth','Max winds along track','Vmax including secondary eyewalls', ...
        'Wind radii','Minimum pressure along track', 'Shear along track', ...
        'SST anomaly along track','Maximum wind swath','Windfield at selected time', ...
        'Wind time series at selected point','Accumulated rain swath', ...
        'Rain field at selected time','Time series of rain at selected point', ...
        'Print as .png figure');
    if nplot == 1
        delete templot.mat  %  Delete temporary file
        break
    elseif nplot == 2   
        trplotmapmt          
    elseif nplot == 3  
        trsatmap                             
    elseif nplot == 4
        trgooglemap
    elseif nplot == 5
        multitimevar                     
    elseif nplot == 6
        vdoubletime
    elseif nplot == 7
        rdoubletime
    elseif nplot == 8
        prestime                                 
    elseif nplot == 9
        sheartime
    elseif nplot == 10
        ssttime                                         
    elseif nplot == 11
        load templot
        swathmt
    elseif nplot == 12
        load templot
        windfieldmt
    elseif nplot == 13
        load templot
        pointplot
    elseif nplot == 14
        load templot
        rainswathmt
    elseif nplot == 15
        load templot
        rainfieldmt
    elseif nplot == 16
        load templot
        rainseries
    elseif nplot == 17
        prompt = {'Enter Figure Name'};
        dlg_title = 'Figure name';
        num_lines = 1;
        answer = inputdlg(prompt,dlg_title,num_lines);
        if isempty(answer) || isempty(answer{1})
            return
        end    
        figurename=answer{1};
        print(figurename,'-dpng','-r300')    
    end
end    
%
% Clean up
%
if strcmp(Clearvlbs,'y')
    clearvars('-except',protected_variables{:})
end 