MATLAB Examples

argofiles documentation

The argofiles returns urls of ARGO NetCDF files within specified geographic and temporal limits. This function is intended for use with the argodata function.



ncfiles = argodata(latlim,lonlim,tlim,basin)
[ncfiles,lat,lon,t] = argodata(...)


ncfiles = argodata(latlim,lonlim,tlim,basin) searches the internet for ARGO profiles that start within the geographic confines latlim,lonlim and temporal range tlim. latlim and lonlim can be two-element arrays to specify limits or a polygon of three or more points if you only want floats within an arbitrary shape. Times tlim can be a single date or a starting and ending date and can be in any format recognized by Matlab's datenum function. Due to the way files are structured on the NODC you must also specify a basin as 'pacific', 'atlantic', or 'indian'. Output ncfiles is a cell array of urls.

[ncfiles,lat,lon,t] = argodata(...) also returns arrays of lat, lon, and times t for each .nc file.

Usage Notes

  • This function requires an internet connection with friendly firewall settings.
  • Processing time is not affected by geographic limits, but a wide temporal range will slow things down. Expect roughly a few seconds per month in your specified tlim.

Example 1: In the Nino 3.4 box given a range of days

The Nino 3.4 box is defined by the range 5°S to 5°N and 170°W to 120°W. Find all ARGO profiles in that box from Christmas Day 2005 to New Years Day 2006:

latlim = [-5 5];
lonlim = [-170 -120];
t = [datenum('dec 25, 2005') datenum('jan 1, 2006')];
f = argofiles(latlim,lonlim,t,'pacific');

Now f should be a cell array of strings that looks something like this. Here are the first five urls:

ans = 

Example 2: In an arbitrary polygon on a specific day

Perhaps you're interested in all the ARGO floats within some polygon on a specific day. Below I'll use my borders function to give a little bit of context, then I'll plot the polygon in red.

lats = [32;33;35;36;35;33;30;28;25;23;21;23;25;27;30;33;35;36;35;33];
lons = [-47;-50;-53;-56;-61;-63;-63;-59;-54;-50;-48;-45;-39;-36;-33;-32;-33;-37;-41;-45];

borders('countries','facecolor',[0.82 0.7 0.44],'nomap')
set(gca,'color',[0.01 0.44 0.61])

axis([-93 5 2 58])

Suppose you want to find all the ARGO profiles inside that polygon on a specific day, maybe Valentines Day 2009?

[ncfiles,lat,lon] = argofiles(lats,lons,'feb. 14, 2009','atlantic');

There were only seven ARGO profiles in the heart-shaped polygon on Valentine's Day 2009:


Example 3: Anywhere in the world on a given day

Where were all the ARGO floats on Flag Day, 2000? We'll have to query each ocean basin separately to answer this question:

[nca,lata,lona] = argofiles([-90 90],[-180 180],'June 14, 2010','atlantic');
[nci,lati,loni] = argofiles([-90 90],[-180 180],'June 14, 2010','indian');
[ncp,latp,lonp] = argofiles([-90 90],[-180 180],'June 14, 2010','pacific');

As in Example 2 I'm using my borders function to give a little context and this time I'm specifying color RGB values with my rgb function.

hold on


set(gca,'color',rgb('ocean blue'))
axis tight

Author Info:

The argofiles function was written by Chad A. Greene of the University of Texas at Austin's Institute for Geophysics (UTIG), December 2015.