Skip to content

Commit

Permalink
Substituted for proper call
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSalinas98 authored Mar 14, 2024
1 parent fe895af commit 94b206b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xmipptomo/protocols/protocol_phantom_tomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def _addTomogram(self, index, acq, xT, yT, zT, boxSize, desc):

rot, tilt, psi = self._getRandomAngles()

posIndex = np.random.randint(0, len(positions))
rng = np.random.default_rng()
posIndex = rng.integers(len(positions))
pos = positions[posIndex]
del positions[posIndex]

Expand Down Expand Up @@ -256,9 +257,10 @@ def getParticleShape(self, boxSize, i, pos, rot, tilt, psi, alternative=False):
def _getRandomAngles(self):
""" Returns random rot, tilt, psi in range"""

rot = np.random.randint(self.rotmin.get(), self.rotmax.get())
tilt = np.random.randint(self.tiltmin.get(), self.tiltmax.get())
psi = np.random.randint(self.psimin.get(), self.psimax.get())
rng = np.random.default_rng()
rot = rng.integers(self.rotmin.get(), self.rotmax.get())
tilt = rng.integers(self.tiltmin.get(), self.tiltmax.get())
psi = rng.integers(self.psimin.get(), self.psimax.get()

# Get the random values
return rot, tilt, psi
Expand Down

0 comments on commit 94b206b

Please sign in to comment.