Functions related to calendar and time conversions.

swe_julday(year, month, day, hourd, gregflag)

swe_date_conversion(year, month, day, hourd, cal)

swe_revjul(jd, gregflag)

swe_utc_time_zone(year, month, day, houri, min, sec, d_timezone)

swe_utc_to_jd(year, month, day, houri, min, sec, gregflag)

swe_jdet_to_utc(jd_et, gregflag)

swe_jdut1_to_utc(jd_ut, gregflag)

swe_time_equ(jd_ut)

swe_lmt_to_lat(jd_lmt, geolon)

swe_lat_to_lmt(jd_lat, geolon)

Arguments

year

Astronomical year as integer

month

Month as integer

day

Day as integer

hourd

Hour as double

gregflag

Calendar type as integer (SE$JUL_CAL=0 or SE$GREG_CAL=1)

cal

Calendar type "g" [Gregorian] or "j" [Julian] as char

jd

Julian day number as double

houri

Hour as integer

min

min as integer

sec

Second as double

d_timezone

Timezone offset as double (hour)

jd_et

Julian day number (ET) as double (day)

jd_ut

Julian day number (UT) as double (day)

jd_lmt

Julian day number (LMT=UT+geolon/360) as double (day)

geolon

geographic longitude as double (deg)

jd_lat

Julian day number (LAT) as double (day)

Value

swe_date_conversion returns a list with named entries: return status flag as integer,

jd Julian day number as double

swe_revjul returns a list with named entries: year year as integer,

month month as integer, day day as integer and hour hour as double.

swe_utc_time_zone returns a list with named entries: year_out year as integer,

month_out month as integer, day_out day as integer, hour_out hour as integer, min_out minute as integer,

sec_out second as double,

swe_utc_to_jd returns a list with named entries: return status flag as integer,

dret Julian day number as numeric vector and serr for error message as string.

swe_jdet_to_utc returns a list with named entries: year_out year as integer,

month_out month as integer, day_out day as integer, hour_out hour as integer, min_out minute as integer,

sec_out second as double,

swe_jdut1_to_utc returns a list with named entries: year_out year as integer,

month_out month as integer, day_out day as integer, hour_out hour as integer, min_out minute as integer,

sec_out second as double,

swe_swe_time_equ returns a list with named entries: return status flag as integer,

e equation of time (day) as double and serr for error message as string.

swe_lmt_to_lat returns a list with named entries: return status flag as integer,

jd_lat Julian day number (LAT) (day) as double and serr for error message as string.

swe_lat_to_lmt returns a list with named entries: return status flag as integer,

jd_lmt Julian day number (LMT) (day) as double and serr for error message as string.

Details

swe_julday()

Convert calendar dates to the astronomical time scale which measures time in Julian day number.

swe_date_conversion()

Convert calendar dates to the astronomical time scale which measures time in Julian day number and checks if the calendar date is legal.

swe_revjul()

Compute year, month, day and hour from a Julian day number.

swe_utc_time_zone()

Convert local time to UTC and UTC to local time.

swe_utc_to_jd()

Convert UTC to Julian day number (UT and ET).

swe_jdet_to_utc()

Convert Julian day number (ET) into UTC.

swe_jdut1_to_utc()

Convert Julian day number (UT1) into UTC.

swe_time_equ()

Calculate equation of time (LAT-LMT).

swe_lmt_to_lat()

Convert Julian day number (LMT) into Julian day number (LAT).

swe_lat_to_lmt()

Convert Julian day number (LAT) into Julian day number (LMT).

See also

Section 7 in http://www.astro.com/swisseph/swephprg.htm. Remember that array indices start in R at 1, while in C they start at 0!

Examples

data(SE)
swe_julday(2000,1,1,12,SE$GREG_CAL)
#> [1] 2451545
swe_date_conversion(2000,1,1,12,"g")
#> $return
#> [1] 0
#> 
#> $jd
#> [1] 2451545
#> 
swe_revjul(2452500,SE$GREG_CAL)
#> $year
#> [1] 2002
#> 
#> $month
#> [1] 8
#> 
#> $day
#> [1] 13
#> 
#> $hour
#> [1] 12
#> 
swe_utc_time_zone(2000,1,1,12,5,1.2,2)
#> $year_out
#> [1] 2000
#> 
#> $month_out
#> [1] 1
#> 
#> $day_out
#> [1] 1
#> 
#> $hour_out
#> [1] 10
#> 
#> $min_out
#> [1] 5
#> 
#> $sec_out
#> [1] 1.2
#> 
swe_utc_to_jd(2000,1,1,0,12,3.4,SE$GREG_CAL)
#> $return
#> [1] 0
#> 
#> $dret
#> [1] 2451545 2451545
#> 
#> $serr
#> [1] ""
#> 
swe_jdet_to_utc(2452500,SE$GREG_CAL)
#> $year_out
#> [1] 2002
#> 
#> $month_out
#> [1] 8
#> 
#> $day_out
#> [1] 13
#> 
#> $hour_out
#> [1] 11
#> 
#> $min_out
#> [1] 58
#> 
#> $sec_out
#> [1] 55.816
#> 
swe_jdut1_to_utc(2452500,SE$GREG_CAL)
#> $year_out
#> [1] 2002
#> 
#> $month_out
#> [1] 8
#> 
#> $day_out
#> [1] 13
#> 
#> $hour_out
#> [1] 12
#> 
#> $min_out
#> [1] 0
#> 
#> $sec_out
#> [1] 0.2300933
#> 
swe_time_equ(2452500)
#> $return
#> [1] 0
#> 
#> $e
#> [1] -0.003387399
#> 
#> $serr
#> [1] ""
#> 
swe_lmt_to_lat(2452500,0)
#> $return
#> [1] 0
#> 
#> $jd_lat
#> [1] 2452500
#> 
#> $serr
#> [1] ""
#> 
swe_lat_to_lmt(2452500,0)
#> $return
#> [1] 0
#> 
#> $jd_lmt
#> [1] 2452500
#> 
#> $serr
#> [1] ""
#>