Skip to content

Commit c9afd08

Browse files
MACarlsenCSSFrancis
authored andcommitted
fix for hemisphere='lower'
1 parent 9813725 commit c9afd08

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

orix/measure/pole_density_function.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def pole_density_function(
106106
elif len(args) == 2:
107107
# azimuth and polar angles
108108
v = Vector3d.from_polar(*args)
109+
109110
else:
110111
raise ValueError(
111112
"Accepts only one (Vector3d) or two (azimuth, polar)\
@@ -186,7 +187,7 @@ def pole_density_function(
186187
# Make plot grid
187188
azimuth_coords, polar_coords = _sample_S2_uv_mesh_coordinates(
188189
plot_resolution,
189-
hemisphere="upper",
190+
hemisphere=hemisphere,
190191
azimuth_endpoint=True,
191192
)
192193
azimuth_grid, polar_grid = np.meshgrid(

orix/tests/test_measure/test_measure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ def test_output_format(self):
6868
assert isinstance(hist2, np.ma.MaskedArray)
6969
assert hist2.mask.sum() > 0
7070

71+
hist3, (x3, y3) = pole_density_function(v, hemisphere="lower")
72+
assert hist3.shape[0] + 1 == x3.shape[0] == y3.shape[0]
73+
assert hist3.shape[1] + 1 == x3.shape[1] == y3.shape[1]
74+
assert isinstance(hist3, np.ma.MaskedArray)
75+
assert hist3.mask.sum() == 0
76+
7177
@pytest.mark.parametrize("resolution", [0.5, 1.0])
7278
def test_pole_density_function_mrd_norm(self, point_groups, resolution):
7379
pg = point_groups

0 commit comments

Comments
 (0)