Skip to content

Commit

Permalink
rename theta to colatitude in geo coord handler
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishavlin committed May 6, 2024
1 parent 1cea43b commit 433c81f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions yt/geometry/coordinates/geographic_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,22 +325,22 @@ def convert_to_cartesian(self, coord):
lon = self.axis_id["longitude"]
lat = self.axis_id["latitude"]
r = factor * coord[:, rad] + offset
theta = _lat_to_theta(coord[:, lat])
colatitude = _latitude_to_colatitude(coord[:, lat])
phi = coord[:, lon] * np.pi / 180
nc = np.zeros_like(coord)
# r, theta, phi
nc[:, lat] = np.cos(phi) * np.sin(theta) * r
nc[:, lon] = np.sin(phi) * np.sin(theta) * r
nc[:, rad] = np.cos(theta) * r
nc[:, lat] = np.cos(phi) * np.sin(colatitude) * r
nc[:, lon] = np.sin(phi) * np.sin(colatitude) * r
nc[:, rad] = np.cos(colatitude) * r
else:
a, b, c = coord
theta = _lat_to_theta(b)
colatitude = _latitude_to_colatitude(b)
phi = a * np.pi / 180
r = factor * c + offset
nc = (
np.cos(phi) * np.sin(theta) * r,
np.sin(phi) * np.sin(theta) * r,
np.cos(theta) * r,
np.cos(phi) * np.sin(colatitude) * r,
np.sin(phi) * np.sin(colatitude) * r,
np.cos(colatitude) * r,
)
return nc

Expand Down Expand Up @@ -572,7 +572,7 @@ def sanitize_width(self, axis, width, depth):
return width


def _lat_to_theta(lat_vals):
def _latitude_to_colatitude(lat_vals):
# convert latitude to theta, accounting for units,
# including the case where the units are code_length
# due to how yt stores the domain_center units for
Expand Down

0 comments on commit 433c81f

Please sign in to comment.