Home > omviz > tstau.m

tstau

PURPOSE ^

TSTAU Reads time series of wind from TSEPIC style files

SYNOPSIS ^

function [w,jd]=tstau(cdf);

DESCRIPTION ^

 TSTAU Reads time series of wind from TSEPIC style files
  this version assumes wind is a 1D variable (uniform wind over domain)

 USAGE: [w,jd]=tstau(cdf);

 Author: Rich Signell (rsignell@usgs.gov)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [w,jd]=tstau(cdf);
0002 % TSTAU Reads time series of wind from TSEPIC style files
0003 %  this version assumes wind is a 1D variable (uniform wind over domain)
0004 %
0005 % USAGE: [w,jd]=tstau(cdf);
0006 %
0007 % Author: Rich Signell (rsignell@usgs.gov)
0008 %
0009 
0010 [t]=mcvgt(cdf,'time');
0011 nt=length(t);
0012 %
0013 ncid=mexcdf('open',cdf);
0014 [name,datatype,ndims,dim,natts, status] = mexcdf('VARINQ',ncid, 'taux');
0015 mexcdf('close',ncid);
0016 ndims=1;
0017 if(ndims==1),
0018  u=mcvgt(cdf,'taux');
0019  v=mcvgt(cdf,'tauy');
0020  w=u+i*v;
0021  w=w.';
0022 else 
0023  [stations]=mcvgt(cdf,'stations');
0024  nsta=length(stations);
0025  corner=[0 0 0 0];
0026  edges=[nt 1 1 nsta];
0027  u=mcvgt(cdf,'taux',corner,edges);
0028  v=mcvgt(cdf,'tauy',corner,edges);
0029  w=u+i*v;
0030 end
0031 %
0032 base_date=zeros(1,6);
0033 base_date(1:3)=mcagt(cdf,'global','base_date');
0034 jd0=julian(base_date);
0035 jd=jd0+t/3600/24;

Generated on Thu 01-Dec-2005 08:50:35 by m2html © 2003