NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/VIZICQ4_1.2/query_fcast_dir.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 function [starting_time,ending_time]=query_fcast_dir(dirname)
2 %QUERY_FCAST_DIR
3 % QUERY_FCAST_DIR determines the starting and ending
4 % simulation times for a specified forecast directory.
5 % Two time structures are returned.
6
7 if exist(dirname)~=7
8    error([dirname ' does not exist.']);
9    return
10 end
11
12 d=dir([dirname '/*.icq4']);
13 filenames={d.name}';
14 nfiles=length(filenames);
15
16 % If the forecast .icq4 files are in order,
17 % the first and last entries in filenames
18 % are the starting and ending times in the
19 % forecast.  Read the headers to get the times.
20
21 startingicq4struct=read_icq4([dirname '/' filenames{1}],0);
22 endingicq4struct=read_icq4([dirname '/' filenames{nfiles}],0);
23
24 starting_time.day  =startingicq4struct.day;
25 starting_time.month=startingicq4struct.month;
26 starting_time.year =startingicq4struct.year;
27 starting_time.sec  =startingicq4struct.curr_seconds;
28
29 ending_time.day  =endingicq4struct.day;
30 ending_time.month=endingicq4struct.month;
31 ending_time.year =endingicq4struct.year;
32 ending_time.sec  =endingicq4struct.curr_seconds;
33
34
Note: See TracBrowser for help on using the browser.