Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated DataSet.to_reciprocalgrid() should call DataSet.to_reciprocal_grid() #285

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)
Loading