“时间格式的处理”的版本间差异

来自Shiyin's note
跳到导航 跳到搜索
(以“* 读入 year =0 & month = 0 & day = 0 ;初始化定义 Date='2012-02-21' reads,Date,year,month,day,format='(I4,1x,I2,1x,I2)' * 转换成儒略日 TIMEGEN,JULD...”为内容创建页面)
 
无编辑摘要
 
(未显示同一用户的3个中间版本)
第1行: 第1行:
*[[儒略日]]计算
* 读入
Jul=Julday(month,day,year,hour,minute,second)
year =0 & month = 0 & day = 0 ;初始化定义
Date='2012-02-21'
reads,Date,year,month,day,format='(I4,1x,I2,1x,I2)'


* 转换成儒略日
*儒略日计算date
CALDAT, Jul, Month [, Day [, Year [, Hour [, Minute [, Second]]]]]
TIMEGEN,JULDAY

*生成儒略日时间
MyTimes = TIMEGEN(365, UNITS="Days") + SYSTIME(/JULIAN)
MyTimes = TIMEGEN(12, UNITS="Months", START=JULDAY(1,1,2000))


* 画图,时间坐标
* 画图,时间坐标
第32行: 第34行:
例子 '%D/%N/%Y' yields 11/12/1993
例子 '%D/%N/%Y' yields 11/12/1993
'%M!C%Y' yields DEC on the top line, 1993 on the bottom (!C is the new line graphic command).
'%M!C%Y' yields DEC on the top line, 1993 on the bottom (!C is the new line graphic command).

[[astro_lib]]中的儒略日相关程序

2015年1月13日 (二) 12:18的最新版本

Jul=Julday(month,day,year,hour,minute,second)
  • 由儒略日计算date
CALDAT, Jul, Month [, Day [, Year [, Hour [, Minute [, Second]]]]]
  • 生成儒略日时间
MyTimes = TIMEGEN(365, UNITS="Days") + SYSTIME(/JULIAN)
MyTimes = TIMEGEN(12, UNITS="Months", START=JULDAY(1,1,2000))
  • 画图,时间坐标
label_date
例:  dummy = LABEL_DATE(DATE_FORMAT='%M%Z')
mytimes=timegen(12,unit='months,start=julday(1,1,2012))
y=findgen(12)
plot,mytimes,y,xtickformat='label_date'
DATE_FORMAT 格式
%M for month
%N for month (2 digit abbr)
%D for day of month,
%Y for 4 digit year.
%Z for last two digits of year.
%W for day of week
   For time:
%A for AM or PM
%H for Hours, 2 digits.
%I for minutes, 2 digits.
%S for Seconds, 2 digits.
%0--%9 following %S, indicates digits after decimal point.
%% is %
例子  '%D/%N/%Y' yields 11/12/1993
'%M!C%Y' yields DEC on the top line, 1993 on  the bottom (!C is the new line graphic command).

astro_lib中的儒略日相关程序