Skip to content
Browse files

Merge branch 'master' into #27

  • Loading branch information...
2 parents ebd05df + d157a1f commit d245f29aec4eeea91f5644753981279720417713 @barnabytprowe barnabytprowe committed Apr 6, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 galsim/noise.py
View
8 galsim/noise.py
@@ -20,8 +20,9 @@ def addGaussian(Image, uniform, mean=0., sigma=1.):
"""
g = galsim.GaussianDeviate(uniform, mean=mean, sigma=sigma)
imtype = Image.array.dtype.type
- Image += galsim.Image[imtype]( np.array([g() for i in xrange(np.product(Image.array.shape))],
- dtype=imtype).reshape(Image.array.shape) )
+ Image += galsim.Image[imtype](np.array([g() for i in xrange(np.product(Image.array.shape))],
+ dtype=imtype).reshape(Image.array.shape),
+ xMin=Image.getXMin(), yMin=Image.getYMin)
return Image
def addPoisson(Image, uniform, gain=1.):
@@ -44,7 +45,8 @@ def addPoisson(Image, uniform, gain=1.):
imtype = Image.array.dtype.type
elist = list(Image.array.flatten('C') * gain)
Image += galsim.Image[imtype](np.array([poissonwithmean(p, elecs) / gain for elecs in elist],
- dtype=imtype).reshape(Image.array.shape, order='C')) \
+ dtype=imtype).reshape(Image.array.shape, order='C'),
+ xMin=Image.getXmin(), yMin=Image.getYMin()) \
- Image # Barney note: need to understand image operations better, couldn't get
# other assignment to work on output after leaving function scope
return Image

0 comments on commit d245f29

Please sign in to comment.
Something went wrong with that request. Please try again.