Home > atmlab > time > mjd2month.m

mjd2month

PURPOSE ^

MJD2MONTH Conversion of MJD to month

SYNOPSIS ^

function m = mjd2month(mjd)

DESCRIPTION ^

 MJD2MONTH   Conversion of MJD to month  

    Calculates the month by combining *mjd2date* and  *dayofmonth*. 
    Fractional part of month is kept. Jan 15 is about 1.5.

 FORMAT   m = mjd2month(mjd)
        
 OUT   m     Month number.
 IN    mjd   Modified julian date. Can be a vector.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mjd2month.m

SOURCE CODE ^

0001 % MJD2MONTH   Conversion of MJD to month
0002 %
0003 %    Calculates the month by combining *mjd2date* and  *dayofmonth*.
0004 %    Fractional part of month is kept. Jan 15 is about 1.5.
0005 %
0006 % FORMAT   m = mjd2month(mjd)
0007 %
0008 % OUT   m     Month number.
0009 % IN    mjd   Modified julian date. Can be a vector.
0010 
0011 % 2006-03-31   Created by Patrick Eriksson.
0012 
0013 function m = mjd2month(mjd)
0014                                                          %&%
0015 rqre_datatype( mjd, @isnumeric );                        %&%
0016 
0017 [year, month, day, hour, minute, second] = mjd2date( mjd(:) );
0018 
0019 %= *monthofyear* does not handle column vectors
0020 %
0021 if dimens(year) < 2  & length(year) > 1
0022   year   = vec2row( year );
0023   month  = vec2row( month );
0024   day    = vec2row( day );
0025   hour   = vec2row( hour );
0026   minute = vec2row( minute );
0027   second = vec2row( second );
0028 end
0029 
0030 %- To ensure that m gets same size as mjd
0031 %
0032 m = zeros( size( mjd ) );
0033 
0034 
0035 m(:) = monthofyear( year, month, day, hour, minute, second );

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