File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -129,16 +129,21 @@ def translate(self, dx):
129129 self .p1 += vec
130130 self .p2 += vec
131131
132- def measure (self , phantom , noise = False ):
133- """Return the probe measurement given phantom. When noise is > 0,
134- poisson noise is added to the returned measurement."""
132+ def measure (self , phantom , sigma = 0 ):
133+ """Return the probe measurement with optional Gaussian noise.
134+
135+ Parameters
136+ ----------
137+ sigma : float >= 0
138+ The standard deviation of the normally distributed noise.
139+ """
135140 newdata = 0
136141 for m in range (phantom .population ):
137142 # print("%s Measure feature %i" % (str(self), m))
138143 newdata += (beamintersect (self , phantom .feature [m ].geometry ) *
139144 phantom .feature [m ].mass_atten )
140- if noise > 0 :
141- newdata += newdata * noise * np .random .poisson ( 1 )
145+ if sigma > 0 :
146+ newdata += newdata * np .random .normal ( scale = sigma )
142147 self .record ()
143148 return newdata
144149
You can’t perform that action at this time.
0 commit comments