Ambient occlusion for terrain

It’s lovely! I have been putting off working on this for my terrain and i get to enjoy it anyways. :smiley: Is there a way to grab the ambient occlusion as a texture or PNMImage with python so I can combine it easily with my shader?