Python Forum
Trouble on importing function from astropy library
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble on importing function from astropy library
#5
Completely defined, now!
Output:
[<Quantity 0.034465 arcsec>, <Quantity 0.483674 arcsec>]
# -------- tempo8.py ---------------
from astropy.time import Time
from astropy.utils import iers
t = Time('2007-04-05 12:00:0.0', format='iso', scale='utc', precision=6)
#
iers_b = iers.IERS_B.open()
print (iers_b.ut1_utc(t))
t.delta_ut1_utc = iers_b.ut1_utc(t)
print(t.delta_ut1_utc)
print(t.ut1.iso, t.ut1.mjd)
print(t.utc.iso, t.utc.mjd)
#
print (t.utc.iso, t.utc.mjd) 
print (t.utc.jd1, t.utc.jd2)
#
j1=float(t.utc.jd1)
j2=float(t.utc.jd2)
#
print (iers_b.pm_xy(j1,j2))    # appropriate command ... WOW!

#---------- OUTPUT ----------
# -0.07209225 s
# -0.07209225
# 2007-04-05 11:59:59.927908 54195.4999991656
# 2007-04-05 12:00:00.000000 54195.5
# 2007-04-05 12:00:00.000000 54195.5
# 2454196.0 0.0
# [<Quantity 0.034465 arcsec>, <Quantity 0.483674 arcsec>]
# -----------------------------
Reply


Messages In This Thread
RE: Trouble on importing function from astropy library - by samsonite - Mar-21-2019, 12:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function (which accesses a library) from another file mouse9095 4 833 Jun-07-2023, 08:55 PM
Last Post: deanhystad
  python standard way of importing library mg24 1 915 Nov-15-2022, 01:41 AM
Last Post: deanhystad
  Problem with importing python-telegram library into the project gandonio 1 1,583 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Run a Function?: Trouble with Online Python Course webmanoffesto 3 1,012 Aug-18-2022, 10:14 PM
Last Post: deanhystad
  How to use a function from third party library? rrowhe4d 2 1,871 Aug-31-2021, 04:30 PM
Last Post: Larz60+
  Override a library function that is not in __all__ Weird 7 3,295 Aug-23-2021, 05:03 PM
Last Post: Larz60+
  Importing a function from another file runs the old lines also dedesssse 6 2,575 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  python library not defined in user defined function johnEmScott 2 3,885 May-30-2020, 04:14 AM
Last Post: DT2000
  importing same python library in multiple custom module escape_freedom13 6 3,844 May-10-2020, 07:01 PM
Last Post: escape_freedom13
  Trouble with list function Eggman72 2 1,747 Mar-23-2020, 09:36 PM
Last Post: Eggman72

Forum Jump:

User Panel Messages

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