get_NCEP_year.m 619 Bytes
Newer Older
1 2 3 4
function year = get_NCEP_year(file)
% Extract the year from a give NCEP file name (either 'uwnd.sig995.YYYY.nc'
% or 'vwnd.sig995.YYYY.nc'). Files are those downloaded from
% ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis/surface/.
5
%
6 7
% INPUT:
%   NCEP NetCDF filename (and path)
8
%
9 10
% OUTPUT:
%   NCEP data year
11
%
12 13
% Author(s):
%   Pierre Cazenave (Plymouth Marine Laboratory)
14
%
15 16
% Revision history:
%   2012-10-15 First version
17
%
18 19 20 21 22
%==========================================================================

[~, tmp_year, ~] = fileparts(file);
tmp_year = regexp(tmp_year, '\.', 'split');
year = str2double(tmp_year(end));