% mk_ctd_castlist.m - generate a cast list for CTD casts

mat_path = '..//process/';


ffid=fopen('ctd_castlist.txt','w');
fprintf(ffid,'     OC415-4 CTD Cast List\n');
fprintf(ffid,'     Cast   Date       Time        Lat      Lon     Max Depth\n');


for cast = [1:3 5:21]
  disp(int2str(cast))
  if cast <10
    fn = ['oc41540',int2str(cast)];
  elseif cast <100
    fn = ['oc4154',int2str(cast)];
  end

  eval(['load ',mat_path,fn])
  readhdr;
  fprintf(ffid,'     %2d ',cast);
  maxp=max(press);
  fprintf(ffid,'  %s  %s  %f %f %f\n',date,time,lat,lon,maxp);

end

fclose(ffid);