Mar-03-2019, 06:34 AM
Been installed
Here my trial code:
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-2400001Nothing 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