Skip to content

Commit

Permalink
Merge pull request #379 from maxwell-zweig/interp2d-deprecation
Browse files Browse the repository at this point in the history
Interp2d deprecation closes #332
  • Loading branch information
dsavransky authored Jun 25, 2024
2 parents 028a0ac + ec49939 commit af8c5c3
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 113 deletions.
9 changes: 6 additions & 3 deletions EXOSIMS/Observatory/SotoStarshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ def __init__(self, orbit_datapath=None, f_nStars=10, **specs):
ang, unq = np.unique(ang, return_index=True)
dV = dV[:, unq]

# create dV 2D interpolant
self.dV_interp = interp.interp2d(dt, ang, dV.T, kind="linear")
# create dV 2D interpolant -- assuming further that x, y are scalars.
# Matching linear interpolation.
r = interp.RectBivariateSpline(dt, ang, dV, kx=1, ky=1)
self.dV_interp = lambda x, y: r(x, y)[0]

# self.dV_interp = interp.interp2d(dt, ang, dV.T)

def generate_dVMap(self, TL, old_sInd, sInds, currentTime):
"""Creates dV map for an occulter slewing between targets.
Expand Down Expand Up @@ -272,7 +276,6 @@ def calculate_dV(self, TL, old_sInd, sInds, sd, slewTimes, tmpCurrentTimeAbs):
for t in range(len(slewTimes.T)):
dV[i, t] = self.dV_interp(slewTimes[i, t], sd[i].to("deg"))
dV[badSlews_i, badSlew_j] = np.Inf

return dV * u.m / u.s

def impulsiveSlew_dV(self, dt, TL, nA, N, tA):
Expand Down
Loading

0 comments on commit af8c5c3

Please sign in to comment.