Home > atmlab > time > compensate_wraparound.m

compensate_wraparound

PURPOSE ^

compensate_wraparound Correct for different CS/MHS time measurements

SYNOPSIS ^

function t = compensate_wraparound(t)

DESCRIPTION ^

 compensate_wraparound Correct for different CS/MHS time measurements

 Several datasets store time in (milli)seconds since the start of the day
 (UTC). When an orbit crosses the date boundary, some of the times will be
 close to 86400 whereas some will be close to 0. This function corrects
 for that affect by adding 86400 to whatever element of the vector is
 smaller than the first one. Like this, time differences between different
 measurements can be more easily calculated. The time has to be in
 seconds, so to use this for AMSU data, one needs to convert from
 milliseconds before passing it here.

 FORMAT

   t = compensate_wraparound(t)

 IN

   t   vector      time vector

 OUT

   t   vector      time vector

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

compensate_wraparound.m

SOURCE CODE ^

0001 function t = compensate_wraparound(t)
0002 
0003 % compensate_wraparound Correct for different CS/MHS time measurements
0004 %
0005 % Several datasets store time in (milli)seconds since the start of the day
0006 % (UTC). When an orbit crosses the date boundary, some of the times will be
0007 % close to 86400 whereas some will be close to 0. This function corrects
0008 % for that affect by adding 86400 to whatever element of the vector is
0009 % smaller than the first one. Like this, time differences between different
0010 % measurements can be more easily calculated. The time has to be in
0011 % seconds, so to use this for AMSU data, one needs to convert from
0012 % milliseconds before passing it here.
0013 %
0014 % FORMAT
0015 %
0016 %   t = compensate_wraparound(t)
0017 %
0018 % IN
0019 %
0020 %   t   vector      time vector
0021 %
0022 % OUT
0023 %
0024 %   t   vector      time vector
0025 %
0026 % $Id$
0027 
0028 if isempty(t)
0029     return
0030 end
0031 wraparound = t < t(1);
0032 t(wraparound) = t(wraparound) + 86400;

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005