Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
b1fc2551
Commit
b1fc2551
authored
Oct 16, 2012
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tool to extract the NCEP year from the reanalysis file names
parent
53a259b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
utilities/get_NCEP_year.m
utilities/get_NCEP_year.m
+25
-0
No files found.
utilities/get_NCEP_year.m
0 → 100644
View file @
b1fc2551
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/.
%
% INPUT:
% NCEP NetCDF filename (and path)
%
% OUTPUT:
% NCEP data year
%
% Author(s):
% Pierre Cazenave (Plymouth Marine Laboratory)
%
% Revision history:
% 2012-10-15 First version
%
%==========================================================================
[
~
,
tmp_year
,
~
]
=
fileparts
(
file
);
tmp_year
=
regexp
(
tmp_year
,
'\.'
,
'split'
);
year
=
str2double
(
tmp_year
(
end
));
if
~
isnumeric
(
tmp_year
)
error
(
'Could not parse the NCEP year from the NCEP file name. Expecting
''
uwnd.sig995.YYYY.nc
''
or
''
vwnd.sig995.YYYY.nc
''
'
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment