%  SetupPlots.m - define lists of stations based on the cruise and the set
%                 of stations (Line) desired. Also sets plot size
%                 label locations and label strings
%                 Will recalculate grid values from lat,lon for FixGrid=1.
%                 Checks for missing grid values and will calculate from lat,lon
%
%    needs variables set: GEOMINFO CRUISEINFO FixGrid Line CruiseName
%
%    sets variables: CRUISEINFO GEOMINFO xrange InfoX InfoZ InfoString
%                    ctdcastlist xctdcastlist xbtcastlist 
%
%    calls: SetDefaults GetInfo ll2grid
%

global GEOMINFO CRUISEINFO DEFAULTS MASKDONE

if isempty(GEOMINFO) 
  GEOMINFO=0;
end
if isempty(CRUISEINFO) 
  CRUISEINFO=0;
end
if isempty(DEFAULTS)
  DEFAULTS=0;
end
if isempty(MASKDONE)
  MASKDONE=0;
end

if DEFAULTS == 0
%        set default values only once
  disp('  Setting defaults ')
  SetDefaults;
end

if GEOMINFO==0
%         need to do only once
  disp('  Read Geometry info')
  GEOMINFO=1;
%                    load coastline in grid coordinates
  load wap3_coast_xy.mat;
%                    load etopo2 for west Ant Pen region
%                    loads files londep, latdep, zdep, xdep, ydep
  load wap.etopo2.mat;
end
if CRUISEINFO == 0
%         need to do only once
  disp(['Read info for cruise ' CruiseName]) 
  CRUISEINFO=1;
%                  setup information for plots
%                   get info on ctd casts and stations
   GetInfo;
  if (FixGrid == 1) 
%          correct all grid values based on lat and lon
%     note that event files have deg south and west, so need neg sign
      [ctdxgrid,ctdygrid]=ll2grid(-ctdlat,-ctdlon);
      [xbtxgrid,xbtygrid]=ll2grid(-xbtlat,-xbtlon);
      [xctdxgrid,xctdygrid]=ll2grid(-xctdlat,-xctdlon);
  else
%               fill in missing grid values
     i=find(ctdxgrid == -99);
     if (~isempty(i))
        [ctdxgrid(i),ctdygrid(i)]=ll2grid(-ctdlat(i),-ctdlon(i));
     end
     i=find(xctdxgrid == -99);
     if (~isempty(i))
        [xctdxgrid(i),xctdygrid(i)]=ll2grid(-xctdlat(i),-xctdlon(i));
     end
     i=find(xbtxgrid == -99);
     if (~isempty(i))
        [xbtxgrid(i),xbtygrid(i)]=ll2grid(-xbtlat(i),-xbtlon(i));
     end
  end
end

%      set up across shelf lines

if Line == 'alls' 
%                      all casts
  if CruiseName=='NBP0103'
     ctdcastlist= [1:102];
     xbtcastlist= [0];
     xctdcastlist= [1:21];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [1:74];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [1:107];
     xbtcastlist= [1:90];
     xctdcastlist= [1:5];
%      100 m casts at 2, 14, 25, 40, 49, 72
%       ctdcastlist= [1 3:13 15:24 26:39 41:48 50:71 73 74:86 88:96];
%       xctdcastlist= [1:2];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [1:130];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  InfoString='All CTD stations ';

elseif Line == 'grid' 
%                      one cast at all stations on the grid
  if CruiseName=='NBP0103'
%      remove one of duplicate casts: 37-95, 23-99, 9-100;
     ctdcastlist= [2 4 5 7:12 14 16 18 20:23 25:27 29 31:34 36:38 40:44 ...
                   46 48 50 52:55 57 59:94 96:98 101 102];
     xbtcastlist= [0];
     xctdcastlist= [6:21];
  elseif CruiseName=='NBP0104'
%     test cast is at the end (cast index 74)
%    remove one of duplicate casts: 70-13, 71-14, 72-15, 73-16
     ctdcastlist= [1:69];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
%    remove one of replicate casts: 97 through 101 (101 is deepest)
%      100 m casts at 2, 14, 25, 40, 49, 72
     ctdcastlist= [1 3:13 15:24 26:39 41:48 50:71 73:86 88:96 101:107];
%     xbtcastlist= [1:90];
     xbtcastlist= [0];
%     xctdcastlist= [1:5];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [8 11 13 15 17 19:22 25 28 30 31 33:35 37 39:41 43 45 47 ...
             49 51 57 59 60 62:64 66 68 74 76 81 83 85 87 91 93 ...
             95 97 99 101 103 105 107 111 114 116];
%              there other stations are unique, but are NE of the x=600
%             105 107 111 114 116 118 120 123 127 129 130];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  InfoString='Basic Grid CTD stations';

elseif Line == 'x500' 
%                       500 line
  if CruiseName=='NBP0103'
     ctdcastlist= [8 7 5 4 2 102];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 2 - 8, 102';
                 '500 across shelf line  '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [6:-1:1];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 1 - 6   ';
                 '500 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [8:-1:3];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 3 - 8   ';
                 '500 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations -       ';
                 '500 across shelf line'];
  end
  xrange=[100 300];
  InfoX=170;
  InfoZ= -500;

elseif Line == 'x460' 
%                       460 line
  if CruiseName=='NBP0103'
     ctdcastlist= [9:12 14 101];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 9 - 14 101';
                 '460 across shelf line  '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [7:12];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 7 -  12 ';
                 '460 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [9:13 15];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 9 - 15  ';
                 '460 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '460 across shelf line'];
  end
  xrange=[100 300];
  InfoX=120;
  InfoZ= -500;

elseif Line == 'x420' 
%                       420 line
  if CruiseName=='NBP0103'
     ctdcastlist= [22 21 20 18 16];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 16 - 22 ';
                 '420 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [17:-1:13];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 13 - 17 ';
                 '420 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [20:-1:16];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 16 - 20 ';
                 '420 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations -       ';
                 '420 across shelf line'];
  end
  xrange=[100 300];
  InfoX=120;
  InfoZ= -500;

elseif Line == 'x421' 
%                       420 line repeated
  if CruiseName=='NBP0103'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations - (repeat)    ';
                 '420 across shelf line      '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [17 73 72 71 70];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 17 70 - 73 (repeat)';
                 '420 across shelf line           '];
  elseif CruiseName=='NBP0202'
%              check these cast numbers
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 13-17 (repeat)';
                 '420 across shelf line      '];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations - (repeat)    ';
                 '420 across shelf line      '];
  end
  xrange=[100 300];
  InfoX=120;
  InfoZ= -500;

elseif Line == 'x380' 
%                       380 line
  if CruiseName=='NBP0103'
     ctdcastlist= [97 98 23 25:27 29];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 23 - 29 97 98  ';
                 '380 across shelf line       '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [35 36 37 39 40 41 18:22];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 18-22 35-37 39 40';
                 '380 across shelf line         '];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [39 38 37 35 33 21:24 26];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 21 - 24 26 33 - 39  ';
                 '380 across shelf line            '];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations -                   ';
                 '380 across shelf line            '];
  end
  xrange=[0 300];
  InfoX=20;
  InfoZ= -500;

elseif Line == 'x340' 
%                       340 line
  if CruiseName=='NBP0103'
     ctdcastlist= [43 42 91 92 38 93 94 37 36 34 33 32 31];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 31 - 43 91 92';
                 '340 across shelf line     '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [33 34 38 40 28:-1:23];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 23-28 33 34 38 40';
                 '340 across shelf line         '];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [42 41 36 35 34 32:-1:27];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 27-32 34-36 41 42   ';
                 '340 across shelf line            '];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations                     ';
                 '340 across shelf line            '];
  end
  xrange=[-50 300];
  InfoX=0;
  InfoZ= -500;

elseif Line == 'x304' 
%                combined 300 and 340 line

  if CruiseName=='NBP0103'
     ctdcastlist= [44 46 48 50 36 34 33 32 31];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 31- 36 44 - 50';
                 '300+340 across shelf line  '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [32:-1:29 27:-1:23] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 29 - 45     ';
                 '300+340 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [43:48 50] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 43 - 50     ';
                 '300+340 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -          ';
                 '300+340 across shelf line'];
  end
  xrange=[-50 300];
  InfoX=0;
  InfoZ= -500;
elseif Line == 'x300' 
%                       300 line

  if CruiseName=='NBP0103'
     ctdcastlist=[50 48 46 44] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 44 - 50 ';
                 '300 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [32:-1:29 42:45] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 29 - 45 ';
                 '300 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [43:48 50] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 43 - 50 ';
                 '300 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '300 across shelf line'];
  end
  xrange=[-50 300];
  InfoX=0;
  InfoZ= -500;
elseif Line == 'x260' 
%                       260 line
  if CruiseName=='NBP0103'
     ctdcastlist= [52 53 54 55] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 52 - 55 ';
                 '260 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [53:-1:46];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 46 - 53 ';
                 '260 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [59:-1:51];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 51 - 59 ';
                 '260 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '260 across shelf line'];
  end
  xrange=[0 300];
  InfoX=100;
  InfoZ= -500;
elseif Line == 'x220' 
%                       220 line
  if CruiseName=='NBP0103'
     ctdcastlist= [60 59 57 89 62 88 63 64 65] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 57 - 65 88 89 ';
                 '220 across shelf line      '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [54:58] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 54 - 58 ';
                 '220 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [61:71 73] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 61 - 73 ';
                 '220 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '220 across shelf line'];
  end
  xrange=[50 300];
  InfoX=120;
  InfoZ= -500;
elseif Line == 'x180' 
%                       180 line
  if CruiseName=='NBP0103'
     ctdcastlist= [70:-1:66] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 66 - 70 ';
                 '180 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [61 60 59 68] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 59 - 61 68';
                 '180 across shelf line  '];
  elseif CruiseName=='NBP0202'
     ctdcastlist=  [78:-1:74] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 74 - 78 ';
                 '180 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '180 across shelf line'];
  end
  xrange=[100 300];
  InfoX=120;
  InfoZ= -500;
elseif Line == 'x140' 
%                       140 line
  if CruiseName=='NBP0103'
     ctdcastlist= [71:74] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 71 - 74 ';
                 '140 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [62 63 64 67] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 62 - 64 67';
                 '140 across shelf line  '];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [79:83];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 79 - 83 ';
                 '140 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '140 across shelf line'];
  end
  xrange=[100 300];
  InfoX=110;
  InfoZ= -500;
elseif Line == 'x100' 
%                       100 line
  if CruiseName=='NBP0103'
     ctdcastlist= [77 76 75];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 75 - 77 ';
                 '100 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations         ';
                 '100 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [88 86 85 84] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 84 - 88 ';
                 '100 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '100 across shelf line'];
  end
  xrange=[100 300];
  InfoX=120;
  InfoZ= -500;
elseif Line == 'x060' 
%                       060 line
  if CruiseName=='NBP0103'
     ctdcastlist= [87 78 79 80 81];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 78 - 81 87';
                 '060 across shelf line  '];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations         ';
                 '060 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [89:93] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 89 - 93 ';
                 '060 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '060 across shelf line'];
  end
  xrange=[100 300];
  InfoX=120;
  InfoZ= -500;
elseif Line == 'x020' 
%                       020 line
  if CruiseName=='NBP0103'
     ctdcastlist= [84 83 82];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 82 - 84 ';
                 '020 across shelf line'];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations         ';
                 '020 across shelf line'];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [96 95 94] ;
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations 94 - 96 ';
                 '020 across shelf line'];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
     InfoString=['CTD stations  -      ';
                 '020 across shelf line'];
  end
  xrange=[100 300];
  InfoX=150;
  InfoZ= -500;
elseif Line == 'y260' 
%                      260 line
  if CruiseName=='NBP0103'
%     consider including cast 29, but that is off the shelf break.
     ctdcastlist= [82 81 66 53 32 16 14 2];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0104'
%             consider cast 22, but it is off the shelf
     ctdcastlist=[67 68 47 45 24 13 11 2];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [94 93 84 83 74 70 52 50 28 26 16 13 4];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  xrange=[100 550];
  InfoX=150;
  InfoZ= -500;
  InfoString=['CTD stations on shelf break';
              '260 along shelf line       '];
elseif Line == 'y220' 
%                      220 line
  if CruiseName=='NBP0103'
     ctdcastlist= [83 80 75 74 67 65 54 33 27 18 12 4];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [48 44 25 21 14 10 3];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [95 92 85 82 75 68 53 29 24 17 12 5];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  xrange=[100 550];
  InfoX=150;
  InfoZ= -500;
  InfoString=['CTD stations on the ';
              '220 along shelf line'];
elseif Line == 'y180' 
%                      180 line
  if CruiseName=='NBP0103'
     ctdcastlist= [84 79 76 73 68 64 55 34 26 20 11 5];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [66 65 64 59 58 49 43 26 20 15 9 4];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [96 91 86 81 76 67 54 48 30 23 18 11 6];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  xrange=[50 550];
  InfoX=150;
  InfoZ= -500;
  InfoString=['CTD stations on the ';
              '180 along shelf line'];
elseif Line == 'y140' 
%                      140 line
  if CruiseName=='NBP0103'
     ctdcastlist= [78 77 72 69 63 36 25 21 10 7];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [63 60 57 50 42 27 19 16 8 5];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [90 88 80 77 66 55 47 31 22 19 10 7];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  xrange=[100 550];
  InfoX=150;
  InfoZ= -500;
  InfoString=['CTD stations on the ';
              '140 along shelf line'];
elseif Line == 'y100' 
%                      100 line
  if CruiseName=='NBP0103'
     ctdcastlist= [87 71 70 88 50 37 23 22 9 8];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [62 61 56 51 29 28 18 17 7 6];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [79 78 65 56 46 32 21 20 9 8];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  xrange=[100 550];
  InfoX=150;
  InfoZ= -500;
  InfoString=['CTD stations on the ';
              '100 along shelf line'];
elseif Line == 'r001' 
%                      r1 line
  if CruiseName=='NBP0103'
     ctdcastlist= [16 18 20 25 36 50 57 59 60];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0104'
     ctdcastlist= [13 14 20 19 27 29 53];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0202'
     ctdcastlist= [15 13 106 105 104 103 102 31 46 58 62 61];
     xbtcastlist= [0];
     xctdcastlist= [0];
  elseif CruiseName=='NBP0204'
     ctdcastlist= [0];
     xbtcastlist= [0];
     xctdcastlist= [0];
  end
  xrange=[-50 350];
  InfoX=50;
  InfoZ= -500;
  InfoString=['CTD stations on a line ';
              'along the canyon       '];
end

