fix: probability of occupancy fixed

This commit is contained in:
Deepak Mallubhotla 2022-05-26 12:49:45 -05:00
parent b48bb67605
commit 01f905a237
Signed by: deepak
GPG Key ID: BEBAEBF28083E022
2 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ class LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel(DipoleModel):
theta = 2 * numpy.pi * rng.random(shape) theta = 2 * numpy.pi * rng.random(shape)
phi = numpy.arccos(2 * rng.random(shape) - 1) phi = numpy.arccos(2 * rng.random(shape) - 1)
p_mask = rng.binomial(1, 0.5, shape) p_mask = rng.binomial(1, self.prob_occupancy, shape)
p_magnitude = self.pfixed * p_mask p_magnitude = self.pfixed * p_mask
px = p_magnitude * numpy.cos(theta) * numpy.sin(phi) px = p_magnitude * numpy.cos(theta) * numpy.sin(phi)

View File

@ -103,7 +103,7 @@ class RandomCountMultipleDipoleFixedMagnitudeModel(DipoleModel):
theta = 2 * numpy.pi * rng.random(shape) theta = 2 * numpy.pi * rng.random(shape)
phi = numpy.arccos(2 * rng.random(shape) - 1) phi = numpy.arccos(2 * rng.random(shape) - 1)
p_mask = rng.binomial(1, 0.5, shape) p_mask = rng.binomial(1, self.prob_occupancy, shape)
p_magnitude = self.pfixed * p_mask p_magnitude = self.pfixed * p_mask
px = p_magnitude * numpy.cos(theta) * numpy.sin(phi) px = p_magnitude * numpy.cos(theta) * numpy.sin(phi)