% PLEASE modify this file to suit your needs. It is provided as an example % for how to work with directories worth of Argo float profile data % % rawm_all_scr parses the AtlanticIndex files into mat files. These can % then be loaded below. % % Need to separately download all the index data?? How do I know if my % data is complete? May have early profiles from an active float but not % later ones? % Greater Labrador Sea latlim = [50 80]; lonlim = [-70 10]; % Smaller Labrador Sea latlim = [52 68]; lonlim = [-67 -42]; % South Atlantic lonlim=[-65 0]; latlim=[-50 0]; % Subtropical North Atlantic latlim=[32.5 37.5]; lonlim=[-60 -50]; % Mann eddy latlim=[40 45]; lonlim=[-50 -40]; % Date range datestart = datenum(1998,01,01); dateend = datenum(2011,12,31); dvec = create_datevector(datestart,dateend); % Directories input_dir = '/Volumes/DATADRIVE/argo/AtlanticIndex/'; output_dir = input_dir; %% Plot the region load mycoastlines figure(2);clf plot(coastline(:,1),coastline(:,2)) hold on h=drawbox(lonlim,latlim); set(h,'color','k') %% Loop through files rdo=0; myfiles=dir(input_dir); for ddo=1:length(myfiles) name1=myfiles(ddo).name; if name1(1)=='a' & name1(end-1)=='a'% is a matfile eval(['load ',input_dir,name1]);% load the matfile % Loop through data to find things within range AA = length(data); for ado=1:AA lat1 = data(ado).latitude; if length(findbetw(lat1,latlim)) lon1 = data(ado).longitude; if length(findbetw(lon1,lonlim)) rdo=rdo+1; callSigns(rdo) = str2num(data(ado).callSign); datadate(rdo) = datenum([data(ado).date,' ',data(ado).time],'yyyy-mm-dd HH:MM'); datalat(rdo) = lat1; datalon(rdo) = lon1; data_center(rdo,:) = data(ado).data_center; data_P(rdo,:) = [str2num(data(ado).min_D_P) str2num(data(ado).max_D_P)]; data_levels(rdo) = str2num(data(ado).num_of_levels); data_mode(rdo) = data(ado).data_mode; tmp=data(ado).file; datafilename(rdo,1:length(tmp)) = tmp; end end end end end %% disp('Save this data? If not, do a ctrl-C to cancel, otherwise hit any other key to proceed and save.') pause save -v6 all_argo_in_mann.mat callSigns data* %% longrid=linspace(min(lonlim),max(lonlim),10); latgrid=linspace(min(latlim),max(latlim),10); lonhalf=(longrid(1:end-1)+longrid(2:end))/2; lathalf=(latgrid(1:end-1)+latgrid(2:end))/2; numprof=NaN*zeros(length(lonhalf),length(lathalf)); for odo=1:length(longrid)-1 ilon=findbetw(datalon,longrid(odo:odo+1)); for ado=1:length(latgrid)-1 ilat=findbetw(datalat(ilon),latgrid(ado:ado+1)); numprof(odo,ado)=length(ilat); end end numprof(find(numprof==0))=NaN; %% figure(2);clf %lonlim=[-65 0]; %latlim=[-50 0]; plot(coastline(:,1),coastline(:,2)) hold on h=drawbox(lonlim,latlim); set(h,'color','k'); pcolor(lonhalf,lathalf,numprof') shading flat %set(gca,'xlim',[-80 0],'ylim',[-60 10]) caxis([0 40]) title('Number of Argo profiles, 1998 thru Dec 2011') colorbar set(gca,'xlim',[-70 -40],'ylim',[0 50])