Skip to content

Commit

Permalink
Deprecated DataSet.to_reciprocalgrid() should call `DataSet.to_reci…
Browse files Browse the repository at this point in the history
…procal_grid()`
  • Loading branch information
JBGreisman committed Dec 4, 2024
1 parent 01286d8 commit 75c0466
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions reciprocalspaceship/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1585,24 +1585,6 @@ def to_reciprocalgrid(self, key, sample_rate=3.0, dmin=None, gridsize=None):
warnings.simplefilter("always")
warnings.warn(message, DeprecationWarning)

if dmin is not None:
ds = self.loc[self.compute_dHKL().dHKL >= dmin, [key]]
else:
ds = self.loc[:, [key]]

if gridsize is None:
gridsize = self.get_reciprocal_grid_size(dmin=dmin, sample_rate=sample_rate)

# Set up P1 unit cell
p1 = ds.expand_to_p1()
p1 = p1.expand_anomalous()

# Get data and indices
data = p1[key].to_numpy()
H = p1.get_hkls()

# Populate grid
grid = np.zeros(gridsize, dtype=data.dtype)
grid[H[:, 0], H[:, 1], H[:, 2]] = data

return grid
return self.to_reciprocal_grid(
key, sample_rate=sample_rate, dmin=dmin, grid_size=gridsize
)

0 comments on commit 75c0466

Please sign in to comment.