Table of Contents
atRainMakerPlugin information
Using atRainMakerBefore we start I should point out that this calculation is rather intensive (read: slow), so as your first try with this plugin I recommend something unambitious, like a 512×512 map. Anyway, on to the calculation. The plugin splits the calculation into three parts:
This plugin has no user-interface, so each stage requires us to enter some simple scripts, which I've listed below. Quick example scriptDownload this script file, and put it in your L3DT script folder at:
Then:
This will generate the rain depth mask using some default settings, which you can change by editing the script file ('Scripts→Edit script'). Calculating rain flow mapsSelect the 'Scripts→New script' menu option, and enter the following code: calc.WM.rain <GetMap "HF"> <GetMap "WM"> 1 100 1 1 1 The function arguments for this script call are:
The CalcFlags argument is a bitfield combination, the values of which have the following meanings:
After you click OK in the script dialog, the plugin will start its calculation. Once the calculation is complete, you will now have a new maps in your project called 'Rain-avgdepth'. You can view this using the 'View→Show map' menu option, and you should see something like this: Filtering the flow mapsBefore we can apply the rain depth map to the water map, we must first do some processing. There are in fact a large number of different scaling and manipulation options you can apply, but in this case I'm going to do one simple thing: subtract the initial flood depth (1m). To do this, I enter the following script: calc.HF.ShiftMap <GetMap "Rain-avgdepth"> -1 true Applying the flow maps to the water mapThe final step is to bake the rain depth map onto the water map. To do this, use the following script: calc.WM.ApplyOverlayMax <GetMap "HF"> <GetMap "WM"> <GetMap "Rain-avgdepth"> true The map is now ready to be viewed in the main window, or in Sapphire.
If you don't like the result, you can undo using the 'Edit→Undo' menu option.
Putting it all togetherIf you want to do all that processing back-to-back and automagically, select 'Scripts→New script' in the menu and enter the following script: calc.WM.rain <GetMap "HF"> <GetMap "WM"> 1 100 1 1 1 calc.HF.ShiftMap <GetMap "Rain-avgdepth"> -1 true calc.WM.ApplyOverlayMax <GetMap "HF"> <GetMap "WM"> <GetMap "Rain-avgdepth"> true Import / ExportExportTo export the rain depth map, select the 'File→Export→Export map…' menu item, select the 'Rain-avgdepth' map, and export the map in whichever format you like. ImportTo re-import the rain depth map, use the 'File→Import→New map layer' menu item. To do listThere are many things still to do, but the most obvious one are:
Change log2012/08/06 — Added parameter validation, better logging, and proper support for virtual mosaic maps. 2012/07/30 — Updated example scripts for current release version of ZeoScript language. 2012/01/11 — Recompiled for API version 11.09. 2009/08/11 — Removed code for rendering in Sapphire, added 'cancel' button in progress box, updated backup behaviour, and updated scripts. 2007/08/02 — Uploaded. Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|