# How to build a custom raster mosaic operator?

I'm trying to find a way to build a custom raster mosaic operator. When I Mosaic different raster to a new raster ArcMap lets u chose between "first", "last", "max" etc. I need a operator that chooses not the maximum cell value but the second highest cell value. F.e. if I add 3 overlapping rasters, which contain values from 1 to 3, I want the resulting raster to be 2 instead of 3 (max) in the overlapping area. I thought this would be easily doable with a map algebra expression in the raster calculator, but can't make it work. So I was thinking a python tool, but I can't seem to get a good start. I checked out rastertonumpyarry and this might even work. But since the raster to new mosaic tool is already almost doing what I want (except for the "second highest cell value operator") I was hoping to find an easier way. Any ideas?

1. Calculate the second highest value into a new column, using Field Calculator Python expression like: `sorted([ !att1! , !att2! , !att3! , !att4! ])[-2]`