-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from TerrainBento/barnhark/update_after_refactor
Barnhark/update after refactor
- Loading branch information
Showing
13 changed files
with
855 additions
and
3,189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 72 additions & 73 deletions
145
coupled_process_elements/model_basicCh_steady_solution.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
172 changes: 91 additions & 81 deletions
172
coupled_process_elements/model_basicRt_steady_solution.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
152 changes: 79 additions & 73 deletions
152
coupled_process_elements/model_basicVs_steady_solution.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
144 changes: 74 additions & 70 deletions
144
coupled_process_elements/model_basic_steady_solution.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
137 changes: 69 additions & 68 deletions
137
coupled_process_elements/model_basic_var_m_steady_solution.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from terrainbento import Basic\n", | ||
"\n", | ||
"params = {\n", | ||
" # create the Clock.\n", | ||
" \"clock\": {\"start\": 0, \n", | ||
" \"step\": 10,\n", | ||
" \"stop\": 1e5},\n", | ||
" \n", | ||
" # Create the Grid.\n", | ||
" \"grid\": {\"grid\": {\"RasterModelGrid\":[(200, 320), {\"xy_spacing\": 10}]},\n", | ||
" \"fields\": {\"at_node\": {\"topographic__elevation\":{\"random\":[{\"where\":\"CORE_NODE\"}]}}}},\n", | ||
" \n", | ||
" # Set up Boundary Handlers\n", | ||
" \"boundary_handlers\":{\"NotCoreNodeBaselevelHandler\": {\"modify_core_nodes\": True, \n", | ||
" \"lowering_rate\": -0.001}},\n", | ||
" # Parameters that control output.\n", | ||
" \"output_interval\": 1e3, \n", | ||
" \"save_first_timestep\": True,\n", | ||
" \"fields\":[\"topographic__elevation\"],\n", | ||
" \n", | ||
" # Parameters that control process and rates.\n", | ||
" \"water_erodability\" : 0.001,\n", | ||
" \"m_sp\" : 0.5,\n", | ||
" \"n_sp\" : 1.0, \n", | ||
" \"regolith_transport_parameter\" : 0.2, \n", | ||
" }\n", | ||
"\n", | ||
"model = Basic.from_dict(params)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"model.run()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"<Figure size 432x288 with 0 Axes>" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"from landlab import imshow_grid\n", | ||
"\n", | ||
"filenames = []\n", | ||
"ds = model.to_xarray_dataset()\n", | ||
"for i in range(ds.topographic__elevation.shape[0]):\n", | ||
" filename = \"temp_output.\"+str(i)+\".png\"\n", | ||
" imshow_grid(model.grid, \n", | ||
" ds.topographic__elevation.values[i, :, :], \n", | ||
" cmap=\"viridis\", \n", | ||
" limits=(0, 12), \n", | ||
" output=filename)\n", | ||
" filenames.append(filename)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"import imageio\n", | ||
"with imageio.get_writer(\"terrainbento_example.gif\", mode=\"I\") as writer:\n", | ||
" for filename in filenames:\n", | ||
" image = imageio.imread(filename)\n", | ||
" writer.append_data(image)\n", | ||
" os.remove(filename)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"model.remove_output_netcdfs()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.8" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.