Create a layer file consisting of your new tif, named 'c.lyr' and place it in the same directory (i.e. c:\data\c.lyr)
Then run this inside the map document:
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
for df in arcpy.mapping.ListDataFrames(mxd):
for refLayer in arcpy.mapping.ListLayers(mxd, "*b.tif", df):
mosaic = arcpy.mapping.Layer(u'C:\\data\\c.lyr')
arcpy.mapping.InsertLayer(df, refLayer, mosaic, "BEFORE")
mosaic.visible = refLayer.visible
mosaic.brightness = refLayer.brightness
mosaic.contrast = refLayer.contrast
mosaic.transparency = refLayer.transparency
mosaic.name = refLayer.name
arcpy.mapping.RemoveLayer(df, refLayer)
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
del mxd, df
try:
del refLayer, mosaic
except:
pass
finally:
print u'TIF updated!'
Or if you prefer a function:
def UpdateTIF(mxd, old, new):
#mxd: path to mxd to update
#old: wildcard matching pattern for the old source
#new: layer file referencing new source
import arcpy
mxd = arcpy.mapping.MapDocument(mxd)
for df in arcpy.mapping.ListDataFrames(mxd):
for refLayer in arcpy.mapping.ListLayers(mxd, old, df):
mosaic = arcpy.mapping.Layer(new)
arcpy.mapping.InsertLayer(df, refLayer, mosaic, "BEFORE")
mosaic.visible = refLayer.visible
mosaic.brightness = refLayer.brightness
mosaic.contrast = refLayer.contrast
mosaic.transparency = refLayer.transparency
mosaic.name = refLayer.name
arcpy.mapping.RemoveLayer(df, refLayer)
del mxd, df
try:
del refLayer, mosaic
except:
pass
finally:
print u'TIF updated!'
Execute this with a call like:
UpdateTIF('C:\\data\\a.mxd', '*b.tif', 'C:\\data\\c.lyr')