Skip to content

Commit

Permalink
Merge pull request #315 from neutrinoceros/rfc/find_iphi
Browse files Browse the repository at this point in the history
RFC: simplify GasField.find_iphi
  • Loading branch information
neutrinoceros authored Apr 7, 2024
2 parents 734200f + a5f2f11 commit 2de5ae1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nonos/api/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,8 @@ def find_imid(self, altitude=None):

def find_iphi(self, phi=0):
if self.native_geometry in ("polar", "spherical"):
return find_nearest(self.coords.phi, phi) % self.coords.phimed.shape[0]
mod = len(self.coords.phi) - 1
return find_nearest(self.coords.phi, phi) % mod

def _load_planet(
self,
Expand Down

0 comments on commit 2de5ae1

Please sign in to comment.