Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyowl committed Dec 13, 2023
1 parent ba573e1 commit 91f6c8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 4 additions & 7 deletions nemo/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1756,11 +1756,8 @@ def makeModelImage(shape, wcs, catalog, beamFileName, obsFreqGHz = None, GNFWPar
decDeg = row['decDeg'], beam = beam,
GNFWParams = GNFWParams, amplitude = y0ToInsert,
maxSizeDeg = maxSizeDeg, convolveWithBeam = True,
cosmoModel = cosmoModel, omap = modelMap)
# modelMap=modelMap+signalMap
if obsFreqGHz is not None:
modelMap=convertToDeltaT(modelMap, obsFrequencyGHz = obsFreqGHz,
TCMBAlpha = TCMBAlpha, z = z)
cosmoModel = cosmoModel, omap = modelMap,
obsFrequencyGHz = obsFreqGHz, TCMBAlpha = TCMBAlpha)
else:
# Sources - slower but more accurate way
for row in catalog:
Expand All @@ -1769,8 +1766,8 @@ def makeModelImage(shape, wcs, catalog, beamFileName, obsFreqGHz = None, GNFWPar
x, y=wcs.wcs2pix(row['RADeg'], row['decDeg'])
if (x >= x0 and x < x1 and y >= y0 and y < y1) == False:
continue
# degreesMap=np.ones(modelMap.shape, dtype = float)*1e6 # NOTE: never move this
degreesMap, xBounds, yBounds=makeDegreesDistanceMap(modelMap, wcs,
degreesMap=np.ones(modelMap.shape, dtype = float)*1e6 # NOTE: never move this
degreesMap, xBounds, yBounds=makeDegreesDistanceMap(degreesMap, wcs,
row['RADeg'], row['decDeg'],
maxSizeDeg)
signalMap=signals.makeBeamModelSignalMap(degreesMap, wcs, beam)*row['deltaT_c']
Expand Down
8 changes: 5 additions & 3 deletions nemo/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ def makeArnaudModelSignalMap(z, M500, shape, wcs, beam = None, RADeg = None, dec
elif painter == 'pixell': # New method - using Sigurd's object painter
signalMap=_paintSignalMap(shape, wcs, tckP, beam = beam, RADeg = RADeg, decDeg = decDeg,
amplitude = amplitude, maxSizeDeg = maxSizeDeg,
convolveWithBeam = convolveWithBeam, omap = omap)
convolveWithBeam = convolveWithBeam, omap = omap,
obsFrequencyGHz = obsFrequencyGHz, TCMBAlpha = TCMBAlpha, z = z)
else:
raise Exception("'painter' must be 'legacy' or 'pixell' (given '%s')." % (painter))

Expand All @@ -766,7 +767,7 @@ def makeArnaudModelSignalMap(z, M500, shape, wcs, beam = None, RADeg = None, dec
#------------------------------------------------------------------------------------------------------------
def makeBattagliaModelSignalMap(z, M500, shape, wcs, beam = None, RADeg = None, decDeg = None,\
GNFWParams = 'default', amplitude = None, maxSizeDeg = 15.0,\
convolveWithBeam = True, cosmoModel = None,\
convolveWithBeam = True, cosmoModel = None, omap = None,\
obsFrequencyGHz = None, TCMBAlpha = 0):
"""Makes a 2d signal only map containing a Battaglia+2012 model cluster (taking into account the redshift
evolution described in Table 1 and equation 11 there).
Expand Down Expand Up @@ -829,7 +830,8 @@ def makeBattagliaModelSignalMap(z, M500, shape, wcs, beam = None, RADeg = None,
tckP=signalDict['tckP']
return _paintSignalMap(shape, wcs, tckP, beam = beam, RADeg = RADeg, decDeg = decDeg,
amplitude = amplitude, maxSizeDeg = maxSizeDeg,
convolveWithBeam = convolveWithBeam)
convolveWithBeam = convolveWithBeam, omap = omap,
obsFrequencyGHz = obsFrequencyGHz, TCMBAlpha = TCMBAlpha, z = z)

return signalMap

Expand Down

0 comments on commit 91f6c8f

Please sign in to comment.