Home > matutils > dateconv > tstr2mjd.m

tstr2mjd

PURPOSE ^

mjd=tstr2mjd(tstr)

SYNOPSIS ^

function mjd=tstr2mjd(tstr)

DESCRIPTION ^

mjd=tstr2mjd(tstr)

Converts a SZA-standard UTC time string to mjd

mjd=tstr2mjd('12-jun-2005:00:00:00')

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mjd=tstr2mjd(tstr)
0002 
0003 %mjd=tstr2mjd(tstr)
0004 %
0005 %Converts a SZA-standard UTC time string to mjd
0006 %
0007 %mjd=tstr2mjd('12-jun-2005:00:00:00')
0008 
0009 % do in a loop if more than one time
0010 l = size(tstr,1);
0011 
0012 for m=1:l
0013   if(isempty(strfind(tstr(m,:), '-')))
0014     % time is blank
0015     mjd(m,:) = 0;
0016   else
0017     %Separate units os string into fields of time structure t
0018     t=tstr2date(tstr(m,:));
0019     
0020     %Convert month string to integer
0021     t=monthStr2num(t);
0022     
0023     %Find mjd
0024     mjd(m,1)=date2mjd(t.year,t.month,t.day,t.hour,t.min,t.sec);
0025   end
0026 end
0027   
0028 return

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005