Skip to content

Commit

Permalink
Blacked
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray authored and plaplant committed Oct 17, 2019
1 parent a0ec9e7 commit f443450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion RIMEz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ def JD2era_tot(JD):
theta = 2 * np.pi * (0.7790572732640 + 1.00273781191135448 * D_U)
return theta


def era2JD(era, nearby_JD):
def f(jd):
return era - JD2era_tot(jd)

JD_out = optimize.newton(f, nearby_JD, tol=1e-8)
return JD_out


def era_tot2JD(theta):
"""
Parameters
Expand All @@ -196,10 +198,11 @@ def era_tot2JD(theta):
"""
b = 1.00273781191135448
a = 0.7790572732640
D_U = (( theta / 2 / np.pi ) - a) / b
D_U = ((theta / 2 / np.pi) - a) / b
JD = D_U + 2451545.0
return JD


def get_rotations_realistic(era_axis, JD_INIT, array_location):
p1 = np.array([1.0, 0.0, 0.0])
p2 = np.array([0.0, 1.0, 0.0])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"numpy",
"numba",
"cffi",
'astropy',
"astropy",
"h5py",
"scipy",
"healpy",
Expand Down

0 comments on commit f443450

Please sign in to comment.