加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

儒略日(Juliandate)计算(matlab)

(2011-10-23 20:58:55)
标签:

it

分类: matlab


thanks to :

http://zhidao.baidu.com/question/50376872

http://zhidao.baidu.com/question/112869690.html?fr=qrl&cid=83&index=2

在天文学有一种连续纪日的儒略日(JD),它以儒略历公元前4713年1月1日的GMT正午为第0日的开始。还有一种简化儒略日(MJD):

MJD=JD-2400000.5

MJD的第0日是从公历1858年11月17日的GMT零时开始的。

需要注意:儒略历公元前4713年1月1日相当于公历公元前4713年11月24日。


儒略日(Julian day)是指由公元前4713年1月1日,协调世界时中午12时开始所经过的天数,多为天文学家采用,用以作为天文学的单一历法,把不同历法的年表统一起来。

儒略日是一种不用年月的长期纪日法,简写为JD。是由法国学者Joseph Justus Scliger(1540-1609)在1583年所创,这名称是为了纪念他的父亲——意大利学者Julius Caesar Scaliger(1484-1558)。

儒略日的起点订在公元前4713年(天文学上记为 -4712 年)1月1日格林威治时间平午(世界时12:00),即JD 0 指定为 4713 B.C. 1月1日12:00 UT到4713 B.C. 1月2日12:00 UT的24小时。每一天赋予了一个唯一的数字,顺数而下,如:1996年1月1日12:00:00的儒略日是2450084。这个日期是考虑了太阳、月亮的运行周期,以及当时收税的间隔而订出来的。Joseph Scliger定义儒略周期为7980年,是因28、19、15的最小公倍数为28×19×15=7980。其中:

28年为一太阳周期(solar cycle),经过一太阳周期,则星期的日序与月的日序会重复。

19年为一太阴周期,或称默冬章(Metonic cycle),因235朔望月=19回归年,经过一太阴周期则阴历月年的日序重复。

15年为一小纪(indiction cycle),此为罗马皇帝君士坦丁(Constantine)所颁,每15年评定财产价值以供课税,成为古罗马用的一个纪元单位,

故以7980年为一儒略周期,而所选的起点公元前4713年,则是这三个循环周期同时开始的最近年份。

以儒略日计日是为方便计算年代相隔久远或不同历法的两事件所间隔的日数。

由于儒略日数字位数太多,国际天文学联合会于1973年采用简化儒略日(MJD),其定义为 MJD = JD - 2400000.5。MJD相应的起点是1858年11月17日世界时0时。

-----------------------------------------------------------------------------------------------------------------

儒略日的计算

儒略日= K - 32075 + 1461 * (I + 4800 + (J-14)/12)/4+367*(J-2-(J-14)/12*12)/12-3*((I+4900+(J-14)/12)/100)/4
>> type juliandate

function jd = juliandate( varargin )
JULIANDATE Calculate Julian date.
  JD = JULIANDATE( V ) converts one or more date vectors V into Julian date
  JD.  Input V can be an M-by-6 or M-by-3 matrix containing M full or
  partial date vectors, respectively.  JULIANDATE returns a column vector
  of M Julian dates which are the number of days and fractions since noon
  Universal Time on January 1, 4713 BCE.
 
  A date vector contains six elements, specifying year, month, day, hour,
  minute, and second. A partial date vector has three elements, specifying
  year, month, and day.  Each element of V must be a positive double
  precision number.
 
  JD = JULIANDATE(S,F) converts one or more date strings S to Julian date
  JD using format string F. S can be a character array where each
  row corresponds to one date string, or one dimensional cell array of
  strings.  JULIANDATE returns a column vector of M Julian dates, where M is
  the number of strings in S.
 
  All of the date strings in S must have the same format F, which must be
  composed of date format symbols according to DATESTR help. Formats with
  'Q' are not accepted by JULIANDATE.
 
  Certain formats may not contain enough information to compute a date
  number.  In those cases, hours, minutes, and seconds default to 0, days
  default to 1, months default to January, and years default to the
  current year. Date strings with two character years are interpreted to
  be within the 100 years centered around the current year.
    
  JD = JULIANDATE(Y,MO,D) and JD = JULIANDATE([Y,MO,D]) return the Julian
  date for corresponding elements of the Y,MO,D (year,month,day)
  arrays. Y, MO, and D must be arrays of the same size (or any can be a
% scalar).
 
  JD = JULIANDATE(Y,MO,D,H,MI,S) and JD = JULIANDATE([Y,MO,D,H,MI,S])
  return the Julian dates for corresponding elements of the Y,MO,D,H,MI,S
  (year,month,day,hour,minute,second) arrays.  The six arguments must be
  arrays of the same size (or any can be a scalar).
 
  Limitations:
  This function is valid for all common era (CE) dates in the Gregorian
  calendar.
%
  The calculation of Julian date does not take into account leap seconds.
%
  Examples:
%
  Calculate Julian date for May 24, 2005:
   jd = juliandate('24-May-2005','dd-mmm-yyyy')
 
  Calculate Julian date for December 19, 2006:
   jd = juliandate(2006,12,19)
 
  Calculate Julian date for October 10, 2004 at 12:21:00 pm:
   jd = juliandate(2004,10,10,12,21,0)
 
  See also DECYEAR, LEAPYEAR, MJULIANDATE.

  Copyright 2000-2006 The MathWorks, Inc.
  $Revision: 1.1.6.1 $  $Date: 2006/04/20 17:45:01 $


[year month day hour min sec] = datevec(datenum(varargin{:}));

for k = length(month):-1:1
    if ( month(k) <= 2 ) % january & february
        year(k)  = year(k) - 1.0;
        month(k) = month(k) + 12.0;
    end
end

jd = floor( 365.25*(year + 4716.0)) + floor( 30.6001*( month + 1.0)) + 2.0 - ...
    floor( year/100.0 ) + floor( floor( year/100.0 )/4.0 ) + day - 1524.5 + ...
    (hour + min/60 + sec/3600)/24;

例如:
>> format long g; juliandate(now())

ans =

          2455062.99134494

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有