htmltable.m
changeset 0 0a450563f904
equal deleted inserted replaced
-1:000000000000 0:0a450563f904
       
     1 %======================================================================
       
     2 %                    H T M L T A B L E . M 
       
     3 %                    doc: Wed Jun  4 12:58:37 2008
       
     4 %                    dlm: Wed Nov 18 20:44:02 2009
       
     5 %                    (c) 2008 M. Visbeck & A.M. Thurnherr
       
     6 %                    uE-Info: 49 73 NIL 0 0 72 0 2 4 NIL ofnI
       
     7 %======================================================================
       
     8 
       
     9 function [] = htmltable(directory, dods)
       
    10 % function [] = htmltable(directory, dods)
       
    11 %
       
    12 % Create HTML Table of LADCP Files in a Directory
       
    13 %
       
    14 % Input :  directory  : Either a directory '/home/someone/lookhere/'
       
    15 %                       Or the 'f' structure from LADCP where
       
    16 %                       'f.res' will be used.
       
    17 %      
       
    18 %          dods       : Structure with DODS info ** OPTIONAL **
       
    19 %                       dods.cruise - dods address for cruise file
       
    20 %                       dods.d1     - start of address for cast
       
    21 %                       dods.d2     - end of address for cast
       
    22 %                       
       
    23 % Output : Files created in your directory:
       
    24 %             index.html  - Start Page with Map
       
    25 %             index.htm   - Start Page with Map
       
    26 %             table0.html - Start Page with Map
       
    27 %             table1.html - Individual Cast Data
       
    28 %             table2.html - Processing Methods
       
    29 %             table3.html - Technical
       
    30 %             table4.html - Plots
       
    31 %             cruise.ps   - Map of Cruise (filename will vary)
       
    32 %             cruise.gif  - Map of Cruise (filename will vary)
       
    33 %
       
    34 % For DODS addresses, htmltable will insert the cast number to get the
       
    35 % correct address.
       
    36 %
       
    37 % Example: directory = '../ladcp_output/';
       
    38 %
       
    39 %          dods.cruise = ['http://kage.ldeo.columbia.edu:81/SOURCES/' ...
       
    40 %                         '.LDEO/.ClimateGroup/.LADCP/.test/dods'];
       
    41 %          dods.d1     = ['http://kage.ldeo.columbia.edu:81/SOURCES/' ...
       
    42 %                         '.LDEO/.ClimateGroup/.LADCP/.test/N+'];
       
    43 %          dods.d2     = ['+VALUE/dods'];
       
    44 %
       
    45 
       
    46 % Modifications by ANT:
       
    47 %	Jun  4, 2008: - replace all spaces by _ in cruise name
       
    48 %   Jan  7, 2009: - tightened use of exist()
       
    49 %	Nov 18, 2009: - replaced "convert" by "pstogif" (syntax is identical)
       
    50 
       
    51 if nargin < 1, help htmltable, return, end
       
    52 if nargin == 2 & isstruct(dods)
       
    53    DODS = 1;
       
    54 else
       
    55    DODS = 0;
       
    56 end
       
    57 
       
    58 disp('HTMLTABLE')
       
    59 disp(' Surveying Files')
       
    60 warning off
       
    61 
       
    62 if isstruct(directory)
       
    63    loc = directory.res;
       
    64    ii = max(find(loc == '/'));
       
    65    loc = loc(1:ii);
       
    66 else
       
    67    loc = directory;
       
    68 end
       
    69 
       
    70 d = dir([loc '/*.nc']);
       
    71 
       
    72 % Ignore Cruise File
       
    73 count = 0;
       
    74 bad = [];
       
    75 for i = 1:length(d)
       
    76    f = netcdf([loc '/' d(i).name]);
       
    77    % Is this an LADCP File?
       
    78    if isempty(f.GEN_Profile_start_decimal_day(:))
       
    79       bad = [bad i];
       
    80       if ~isempty(f{'cast'}(:))
       
    81 	 cruise_cast = f{'cast'}(:);
       
    82 	 cruise_station = f{'station'}(:);
       
    83       end
       
    84    else
       
    85       count = count + 1;
       
    86    end
       
    87    close(f)
       
    88 end
       
    89 d(bad) = [];
       
    90 if ~exist('cruise_cast','var')
       
    91    DODS = 0;
       
    92 end
       
    93 
       
    94 if count 
       
    95    disp([' Found ' int2str(count) ' Files to Process']);
       
    96    for i = 1:length(d)
       
    97       disp(['  ' d(i).name]);
       
    98    end
       
    99 else
       
   100    error([' Nothing To Do!';])
       
   101 end
       
   102 f = netcdf([loc '/' d(1).name]);
       
   103 name = regexprep(f.cruise_id(:),' ','_');
       
   104 soft = f.software(:);
       
   105 time = date;
       
   106 time(time == '-') = ' ';
       
   107 if isempty(name)
       
   108    name = 'unknown';
       
   109 end
       
   110 disp([' Cruise ID: ' name ]);
       
   111 disp([' Software:  ' soft ]);
       
   112 disp([' Creating HTML Tables']);
       
   113 
       
   114 % Header
       
   115 cr=char(10); % Carriage Return
       
   116 
       
   117 H0 = ['<TITLE>' name '</TITLE>' cr ...
       
   118       '<B>' name '</B>' cr '<BR>' cr ...
       
   119       'Created on ' time ' using ' soft cr '<BR>' ...
       
   120       '<a href="table0.html"> Cruise Data </a> &nbsp' cr ...
       
   121       '<a href="table1.html"> Individual Cast Data </a> &nbsp' cr ...
       
   122       '<a href="table2.html"> Processing Methods</a> &nbsp' cr ...
       
   123       '<a href="table3.html"> Technical </a> &nbsp' cr ...
       
   124       '<a href="table4.html"> Plots </a> &nbsp' cr ...
       
   125       '<a href="../index.html"> Other Cruises </a> &nbsp' cr];
       
   126 
       
   127 % TABLE 0
       
   128 H1 = [H0, '<img SRC="' name '.gif" HEIGHT=800 WIDTH=600 ALIGN=center>' cr];
       
   129 if DODS
       
   130    H1 = [H1 '<br><ul><li>' cr...
       
   131 	 '<a href="' dods.cruise(1:end-4) ...
       
   132 	 '">Live Access IRI/LDEO Data Server</a><br>'];
       
   133 else
       
   134       H1 = [H1 '<br><ul><li>' cr...
       
   135 	 'Live Access IRI/LDEO Data Server<br>'];
       
   136 end
       
   137 
       
   138 H1 = [H1 '<li>All Cruise Data in one file: ' cr];
       
   139 H1 = [H1 '<a href="' name '.nc"> NetCDF </a>'];
       
   140 H1 = [H1 ' <br>' cr '</li><li>' cr];
       
   141 if DODS
       
   142    H1 = [H1 ' <a href="' dods.cruise '"> DODS </a> <br>' cr];   
       
   143 else
       
   144    H1 = [H1 ' DODS <br>' cr];
       
   145 end
       
   146 H1 = [H1 '</li><li>' ...
       
   147       'One File Per Cast: '];
       
   148 H1 = [H1 '<a href="' name '_nc.tgz"> NetCDF tarball </a>'];
       
   149 H1 = [H1 '</li><li>' ];
       
   150 H1 = [H1 '<a href="' name '_ps.tgz"> PS tarball </a>'];
       
   151 H1 = [H1 '</li><li>' ];
       
   152 H1 = [H1 '<a href="' name '_log.tgz"> Logfile tarball </a>'];
       
   153 H1 = [H1 '</li><li>' ];
       
   154 H1 = [H1 '<a href="' name '_lad.tgz"> ASCII results tarball </a>'];
       
   155 H1 = [H1 '</li><li>' ];
       
   156 H1 = [H1 '<a href="' name '_mat.tgz"> MAT results tarball </a>'];
       
   157 H1 = [H1 '</li><li>' ];
       
   158 H1 = [H1 'To unpack tarballs :   tar -xzvf filename.tgz'];
       
   159 
       
   160 cwd = pwd;
       
   161 cd(loc)
       
   162 disp(['  NETCDF tarball']);
       
   163 system(['tar -czf ' name '_nc.tgz *.nc']); 
       
   164 disp(['  PostScript tarball']);
       
   165 system(['tar -czf ' name '_ps.tgz *.ps']); 
       
   166 disp(['  Logfile tarball']);
       
   167 system(['tar -czf ' name '_log.tgz *.log']); 
       
   168 disp(['  ASCII tarball']);
       
   169 system(['tar -czf ' name '_lad.tgz *.lad']); 
       
   170 disp(['  Mat-file tarball']);
       
   171 system(['tar -czf ' name '_mat.tgz *.mat']); 
       
   172 cd(cwd)
       
   173 
       
   174 fid = fopen([loc '/table0.html'], 'w');
       
   175 fwrite(fid, H1);
       
   176 fclose(fid);
       
   177 fid = fopen([loc '/index.html'], 'w');
       
   178 fwrite(fid, H1);
       
   179 fclose(fid);
       
   180 fid = fopen([loc '/index.htm'], 'w');
       
   181 fwrite(fid, H1);
       
   182 fclose(fid);
       
   183 disp(['  index.html']);
       
   184 disp(['  index.htm']);
       
   185 disp(['  table0.html']);
       
   186 
       
   187 % TABLE 1
       
   188 H1 = [H0 '&nbsp ',cr,...
       
   189       '<div ALIGN=right><table BORDER COLS=12 WIDTH="100%" NOSAVE >',cr];
       
   190 H1 = [H1 '<tr align=center>' cr];
       
   191 H1 = [H1 '<td> Name           </td>' cr];
       
   192 H1 = [H1 '<td> Year           </td>' cr];
       
   193 H1 = [H1 '<td> Month          </td>' cr];
       
   194 H1 = [H1 '<td> Day            </td>' cr];
       
   195 H1 = [H1 '<td> Lat            </td>' cr];
       
   196 H1 = [H1 '<td> Lon            </td>' cr];
       
   197 H1 = [H1 '<td> Max Z          </td>' cr];
       
   198 H1 = [H1 '<td> Median U Error </td>' cr];
       
   199 H1 = [H1 '<td> NETCDF File    </td>' cr];
       
   200 H1 = [H1 '<td> Matlab File    </td>' cr];
       
   201 H1 = [H1 '<td> Text File      </td>' cr];
       
   202 H1 = [H1 '<td> DODS           </td>' cr];
       
   203 
       
   204 for i = 1:length(d)
       
   205    f = netcdf([loc '/' d(i).name]);
       
   206    warn = f.warnings(:);
       
   207    WARN(i) = 0;
       
   208    % Are there warnings? If so, we will highlight these
       
   209    if length(find(warn == char(10))) > 1
       
   210       WARN(i) = 1;
       
   211    end
       
   212    cruiseid = f{'name'}(:)';
       
   213    gtime = f{'date'}(:);
       
   214    uerr = f{'uerr'}(:);
       
   215    lat = f{'lat'}(:);
       
   216    lon = f{'lon'}(:);
       
   217    station(i) = f.ladcp_station(:);
       
   218    LAT(i) = lat;
       
   219    LON(i) = lon;
       
   220    maxz = max(f{'z'}(:));
       
   221    med_err_vel = median(uerr(~isnan(uerr(:))));
       
   222    H1 = [H1 '<tr align=center>' cr];
       
   223    if WARN(i)
       
   224       H1 = [H1 '<td> <font color="red">' cruiseid '</font></td>' cr];      
       
   225    else
       
   226       H1 = [H1 '<td>' cruiseid                     '</td>' cr];
       
   227    end
       
   228    H1 = [H1 '<td>' num2str(gtime(1))            '</td>' cr];
       
   229    H1 = [H1 '<td>' num2str(gtime(2))            '</td>' cr];
       
   230    H1 = [H1 '<td>' num2str(gtime(3))            '</td>' cr];   
       
   231    H1 = [H1 '<td>' num3str(lat, 0,2,'0')        '</td>' cr];
       
   232    H1 = [H1 '<td>' num3str(lon, 0,2,'0')        '</td>' cr];
       
   233    H1 = [H1 '<td>' num2str(maxz)                '</td>' cr];
       
   234    H1 = [H1 '<td>' num3str(med_err_vel,0,3,'0') '</td>' cr];   
       
   235    H1 = [H1 '<td> <a href="' d(i).name    '"> nc </td>' cr];
       
   236    mat = [d(i).name(1:end-2) 'mat'];
       
   237    if exist([loc '/' mat],'file')
       
   238       H1 = [H1 '<td> <a href="' mat '"> mat </td>' cr];
       
   239    else
       
   240       H1 = [H1 '<td> mat </td>' cr];
       
   241    end
       
   242    lad = [d(i).name(1:end-2) 'lad'];
       
   243    if exist([loc '/' lad],'file')
       
   244       H1 = [H1 '<td> <a href="' lad '"> lad </td>' cr];
       
   245    else
       
   246       H1 = [H1 '<td> lad </td>' cr];
       
   247    end
       
   248    if DODS
       
   249       cast = cruise_cast(find(cruise_station == station(i)));
       
   250       H1 = [H1 '<td> <a href="' dods.d1 int2str(cast) dods.d2 ...
       
   251 	    '"> dods </a> <td>' cr];      
       
   252    else
       
   253       H1 = [H1 '<td> dods <td>' cr];
       
   254    end
       
   255    close(f)
       
   256 end
       
   257 
       
   258 H1 = strrep(H1, '<td></td>', '<td>&nbsp </td>'); % Pad Empty Cells
       
   259 fid = fopen([loc '/table1.html'], 'w');
       
   260 fwrite(fid, H1);
       
   261 fclose(fid);
       
   262 disp(['  table1.html']);
       
   263 
       
   264 
       
   265 % TABLE 2 - Processing Data
       
   266 empty = '<td>&nbsp </td>';
       
   267 H1 = [H0 '&nbsp ',cr,...
       
   268       '<div ALIGN=right><table BORDER COLS=6 WIDTH="100%" NOSAVE >', cr];
       
   269 H1 = [H1 '<tr align=center>' cr];
       
   270 H1 = [H1 '<td> Name </td>' cr];
       
   271 H1 = [H1 '<td> Bar Ref </td>' cr];
       
   272 H1 = [H1 '<td> Depth Source </td>' cr];
       
   273 H1 = [H1 '<td> Sound Speed </td>' cr];
       
   274 H1 = [H1 '<td> Percent 3-Beam </td>' cr];
       
   275 H1 = [H1 '<td> Log </td>' cr];
       
   276 
       
   277 for i = 1:length(d)
       
   278    H1 = [H1 '<tr align=center>' cr];
       
   279    f = netcdf([loc '/' d(i).name]);
       
   280    cruiseid = f{'name'}(:)';
       
   281    if WARN(i)
       
   282       H1 = [H1 '<td> <font color="red">' cruiseid '</font></td>' cr];      
       
   283    else
       
   284       H1 = [H1 '<td>' cruiseid                     '</td>' cr];
       
   285    end
       
   286    dum = f.BAR_ref_descr(:);
       
   287    if ~isempty(dum)
       
   288       H1 = [H1 '<td>' dum '</td>' cr];
       
   289    else
       
   290       H1 = [H1 empty];
       
   291    end
       
   292    dum = f.GEN_Depth_source(:);
       
   293    if ~isempty(dum)
       
   294       H1 = [H1 '<td>' dum '</td>' cr];
       
   295    else
       
   296       H1 = [H1 empty];
       
   297    end
       
   298    dum = f.GEN_Sound_sp_calc(:);
       
   299    if ~isempty(dum)
       
   300       H1 = [H1 '<td>' dum '</td>' cr];
       
   301    else
       
   302       H1 = [H1 empty];
       
   303    end
       
   304    dum = f.GEN_Percent_3beam(:);
       
   305    if ~isempty(dum)
       
   306       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   307    else
       
   308       H1 = [H1 empty];
       
   309    end
       
   310    H1 = [H1 '<td> <a href="' d(i).name(1:end-2) 'log"> log </td>' cr];
       
   311    close(f)
       
   312 end
       
   313 H1 = strrep(H1, '<td></td>', '<td>&nbsp </td>'); % Pad Empty Cells
       
   314 fid = fopen([loc '/table2.html'], 'w');
       
   315 fwrite(fid, H1);
       
   316 fclose(fid);
       
   317 disp(['  table2.html']);
       
   318 
       
   319 % TABLE 3 - LADCP Technical Data
       
   320 H1 = [H0 '&nbsp',cr,...
       
   321       '<div ALIGN=right><table BORDER COLS=11 WIDTH="100%" NOSAVE >', cr];
       
   322 H1 = [H1 '<tr align=center>' cr];
       
   323 H1 = [H1 '<td> Name </td>' cr];
       
   324 H1 = [H1 '<td> LADCP Up Hard Type </td>' cr];
       
   325 H1 = [H1 '<td> LADCP Up Hard SN </td>' cr];
       
   326 H1 = [H1 '<td> LADCP Up Hard Conf Single Ping Acc </td>' cr];
       
   327 H1 = [H1 '<td> LADCP Up Conf Bin Len </td>' cr];
       
   328 H1 = [H1 '<td> LADCP Up Conf Number Pings </td>' cr];
       
   329 H1 = [H1 '<td> LADCP Dn Hard Type </td>' cr];
       
   330 H1 = [H1 '<td> LADCP Dn Hard SN </td>' cr];
       
   331 H1 = [H1 '<td> LADCP Dn Hard Conf Single Ping Acc </td>' cr];
       
   332 H1 = [H1 '<td> LADCP Dn Conf Bin Len </td>' cr];
       
   333 H1 = [H1 '<td> LADCP Dn Conf Number Pings </td>' cr];
       
   334 
       
   335 for i = 1:length(d)
       
   336    f = netcdf([loc '/' d(i).name]);
       
   337    H1 = [H1 '<tr align=center>' cr];
       
   338    cruiseid = f{'name'}(:)';
       
   339    if WARN(i)
       
   340       H1 = [H1 '<td> <font color="red">' cruiseid '</font></td>' cr];      
       
   341    else
       
   342       H1 = [H1 '<td>' cruiseid                     '</td>' cr];
       
   343    end
       
   344    dum = f.LADCP_up_hard_type(:);
       
   345    if ~isempty(dum)
       
   346       H1 = [H1 '<td>' dum '</td>' cr];
       
   347    else
       
   348       H1 = [H1 empty];
       
   349    end
       
   350    dum = f.LADCP_up_hard_SN(:);
       
   351    if ~isempty(dum)
       
   352       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   353    else
       
   354       H1 = [H1 empty];
       
   355    end
       
   356    dum = f.LADCP_up_conf_single_ping_acc(:);
       
   357    if ~isempty(dum)
       
   358       H1 = [H1 '<td>' num3str(dum,1,3,'0') '</td>' cr];
       
   359    else
       
   360       H1 = [H1 empty];
       
   361    end
       
   362     dum = f.LADCP_up_conf_bin_len_m(:);
       
   363    if ~isempty(dum)
       
   364       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   365    else
       
   366       H1 = [H1 empty];
       
   367    end
       
   368    dum = f.LADCP_up_conf_number_pings(:);
       
   369    if ~isempty(dum)
       
   370       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   371    else
       
   372       H1 = [H1 empty];
       
   373    end
       
   374    dum = f.LADCP_dn_hard_type(:);
       
   375    if ~isempty(dum)
       
   376       H1 = [H1 '<td>' dum '</td>' cr];
       
   377    else
       
   378       H1 = [H1 empty];
       
   379    end
       
   380    dum = f.LADCP_dn_hard_SN(:);
       
   381    if ~isempty(dum)
       
   382       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   383    else
       
   384       H1 = [H1 empty];
       
   385    end
       
   386    dum = f.LADCP_dn_conf_single_ping_acc(:);
       
   387    if ~isempty(dum)
       
   388       H1 = [H1 '<td>' num3str(dum,1,3,'0') '</td>' cr];
       
   389    else
       
   390       H1 = [H1 empty];
       
   391    end
       
   392    dum = f.LADCP_dn_conf_bin_len_m(:);
       
   393    if ~isempty(dum)
       
   394       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   395    else
       
   396       H1 = [H1 empty];
       
   397    end
       
   398    dum = f.LADCP_dn_conf_number_pings(:);
       
   399    if ~isempty(dum)
       
   400       H1 = [H1 '<td>' num2str(dum) '</td>' cr];
       
   401    else
       
   402       H1 = [H1 empty];
       
   403    end
       
   404    close(f)
       
   405 end
       
   406 H1 = strrep(H1, '<td></td>', '<td>&nbsp </td>'); % Pad Empty Cells
       
   407 fid = fopen([loc '/table3.html'], 'w');
       
   408 fwrite(fid, H1);
       
   409 fclose(fid);
       
   410 disp(['  table3.html']);
       
   411 
       
   412 % TABLE 4 - Plots
       
   413 H1 = [H0 '&nbsp ',cr,...
       
   414       '<div ALIGN=right><table BORDER COLS=11 WIDTH="100%" NOSAVE >', cr];
       
   415 H1 = [H1 '<tr align=center>' cr];
       
   416 H1 = [H1 '<td> Name                     </td>' cr]; %  Name
       
   417 H1 = [H1 '<td> Summary                  </td>' cr]; %  1
       
   418 H1 = [H1 '<td> Engineering Data         </td>' cr]; %  2
       
   419 H1 = [H1 '<td> Data Quality             </td>' cr]; %  3
       
   420 H1 = [H1 '<td> Depth                    </td>' cr]; %  4
       
   421 H1 = [H1 '<td> Heading Corrections      </td>' cr]; %  5
       
   422 H1 = [H1 '<td> Up/Down Differences      </td>' cr]; %  6
       
   423 H1 = [H1 '<td> CTD Position             </td>' cr]; %  7
       
   424 H1 = [H1 '<td> Shear                    </td>' cr]; %  8
       
   425 H1 = [H1 '<td> SADCP U, V               </td>' cr]; %  9
       
   426 H1 = [H1 '<td> U, V Offsets, Tilt Error </td>' cr]; % 10
       
   427 
       
   428 for i = 1:length(d)
       
   429    H1 = [H1 '<tr align=center>' cr];
       
   430    f = netcdf([loc '/' d(i).name]);
       
   431    cruiseid = f{'name'}(:)';
       
   432    if WARN(i)
       
   433       H1 = [H1 '<td> <font color="red">' cruiseid '</font></td>' cr];      
       
   434    else
       
   435       H1 = [H1 '<td>' cruiseid                     '</td>' cr];
       
   436    end
       
   437    for j = 1:10
       
   438       ps = char([d(i).name(1:end-3) '_' int2str(j) '.ps']);
       
   439       if exist([loc '/' ps],'file')
       
   440 	 H1 = [H1 '<td><a href=' ps '> PS ' int2str(j) '</a></td>' cr];
       
   441       else
       
   442 	 H1 = [H1 '<td> PS ' int2str(j) '</td>' cr];
       
   443       end
       
   444    end
       
   445    close(f)
       
   446 end
       
   447 fid = fopen([loc '/table4.html'], 'w');
       
   448 fwrite(fid, H1);
       
   449 fclose(fid);
       
   450 disp(['  table4.html']);
       
   451 
       
   452 % Map of Casts
       
   453 disp([' Creating Map of Casts']);
       
   454 load topo.mat
       
   455 figure
       
   456 clf
       
   457 orient tall
       
   458 
       
   459 if abs(median(LON)) > 90
       
   460    LON(LON < 0) = LON(LON < 0) + 360;
       
   461 end
       
   462 lonmin = floor(min(LON));
       
   463 lonmax = ceil(max(LON));
       
   464 latmin = floor(min(LAT));
       
   465 latmax = ceil(max(LAT));
       
   466 
       
   467 n = length(d);
       
   468 col = hsv(n);
       
   469 dx = .02 * (lonmax-lonmin);
       
   470 dy = .02 * (latmax-latmin);
       
   471 lon = LON;
       
   472 lat = LAT;
       
   473    
       
   474 topo_2 = [topo topo];
       
   475 topo_x = -359.5:359.5;
       
   476 topo_y = -89.5:89.5;
       
   477 axes('pos', [.1 .7 .8 .2])
       
   478 pcolor(topo_x, topo_y, topo_2)
       
   479 shading flat
       
   480 colormap(topomap1)
       
   481 brighten(.8);
       
   482 hold on
       
   483 plot([lonmin lonmax lonmax lonmin lonmin lonmax], ...
       
   484      [latmin latmin latmax latmax latmin latmin], '-r', 'linewidth', 3)
       
   485 title(name, 'fontsize', 20)
       
   486 
       
   487 axes('pos', [.1 .1 .8 .5])
       
   488 pcolor(topo_x, topo_y, topo_2)
       
   489 shading interp
       
   490 colormap(topomap1)
       
   491 brighten(.8);
       
   492 hold on
       
   493 for i = 1:n
       
   494    if station(i) == 1 | station(i) == max(station)
       
   495       plot(lon(i), lat(i), '.', 'markersize', 30, 'color', col(i,:))
       
   496       text(lon(i)+dx, lat(i)+dy, int2str(station(i)), 'color', [0 0 0])
       
   497    else
       
   498       plot(lon(i), lat(i), '.', 'markersize', 20, 'color', col(i,:))      
       
   499       if mod(station(i),10) == 0
       
   500 	 text(lon(i)+dx, lat(i)+dy, int2str(station(i)), 'color', [0 0 0])
       
   501       end
       
   502    end
       
   503 end
       
   504 
       
   505 % Put Text Labels On Top
       
   506 htext = findall(gca, 'type', 'text');
       
   507 ltext = findall(gca, 'type', 'line');
       
   508 child = get(gca, 'children');
       
   509 set(gca, 'children', [htext; ltext; setxor([htext; ltext], child)]);
       
   510 
       
   511 axis([lonmin lonmax latmin latmax])
       
   512 ylabel('Latitude [^oN]', 'fontsize', 12)
       
   513 xlabel('Longitude [^oE]', 'fontsize', 12)
       
   514 drawnow
       
   515 
       
   516 eval(['print -dpsc ' loc '/' name '.ps']);
       
   517 disp(['  ' name '.ps']);
       
   518 s = system(['pstogif -density 150 ' loc '/' name '.ps ' loc '/' name '.gif']);
       
   519 if s
       
   520    disp([' Unable to create ' name '.gif']);
       
   521 else
       
   522    disp(['  ' name '.gif']);
       
   523 end
       
   524 cwd = pwd;
       
   525 cd(directory);
       
   526 loc = pwd;
       
   527 disp([' View HTML Table at:'])
       
   528 disp(['  file://' loc '/table0.html']);
       
   529 cd(cwd);