Python Forum
Library (julian), lack of usage information
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Library (julian), lack of usage information
#1
Been installed julian from here: https://pypi.org/project/julian/ and got the related julian-0.14 package from Download files at lefside of the webpage, I realized that it works properly only when the back calculation julian.from_jd is carried out inside the same script of direct procedure julian.from_jd, as shown below:
# ------- jul1.py --------
import julian
import datetime
mjd = 58370.50847222222
dt = julian.from_jd(mjd, fmt='mjd')
print(dt)
#
jd = julian.to_jd(dt + datetime.timedelta(hours=12), fmt='jd')
print(jd-2400001)

# ------- OUTPUTS -----------
# 2018-09-09 12:12:12.000012
# 58370.50847222237
# My remark: mjd back calculation= jd-2400001
Nothing is said by the library author (lack of usage information) about calendar date string format in case the problem is formulated independentely: given date (2018-09-09) and time (12:12:12.0000), find mjd.

Here my trial code:
# ------- jul2.py --------
import julian
from datetime import datetime
#
#dt = '2007-09-29 18:43:11.999982'
#dt = datetime(year=2007, day=29, month=9)
#
jd = julian.to_jd(datetime(year=2007,month=9,day=29,hours=18,minutes=43,seconds=12.000), fmt='jd')
print(jd)
and error
Error:
C:\Training>python jul2.py Traceback (most recent call last): File "jul2.py", line 8, in <module> jd = julian.to_jd(datetime(year=2007,month=9,day=29,hours=18,minutes=43,seconds=12.000), fmt='jd') TypeError: 'hours' is an invalid keyword argument for this function
Before asking info to the author, I'ld like to get help from forum. Thanks in advance
Reply


Messages In This Thread
Library (julian), lack of usage information - by samsonite - Mar-03-2019, 06:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Questions regarding usage of pandas library Pala 5 1,084 Apr-26-2023, 10:21 PM
Last Post: deanhystad
  Lack of understanding "graphX, = ax.plot" easayed 1 2,298 Dec-21-2018, 11:08 PM
Last Post: micseydel
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,812 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020