Skip to content

Commit

Permalink
jupyter notebook for editing saved cascade npz files to change the bi…
Browse files Browse the repository at this point in the history
…g arrays to empty arrays
  • Loading branch information
Lexi Van Blunk committed Jul 21, 2023
1 parent ad96185 commit 353dfe3
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions notebooks/post-thesis/deleting_big_variables.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "6dafbb1e",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "81049edd",
"metadata": {},
"outputs": [],
"source": [
"for storm_num in range(51,52):\n",
" datadir = \"C:/Users/Lexi/PycharmProjects/CASCADE/cascade/data/outwash_data/storms/slope0pt03/run_output/r025/outwash0/\"\n",
" filename = \"config4_outwash0_startyr1_interval20yrs_Slope0pt03_{0}.npz\".format(storm_num)\n",
" data = datadir + filename\n",
" outwash = np.load(data, allow_pickle=True)\n",
" out_obj = outwash[\"cascade\"][0]\n",
" out_obj.outwash[0]._flows = []\n",
" out_obj.outwash[0]._velocities = []\n",
" out_obj.outwash[0]._final_bay_levels = []\n",
" out_obj.outwash[0]._discharge = []\n",
" out_obj.outwash[0]._elevation_change = []\n",
" out_obj.outwash[0]._underwater_array = []\n",
" out_obj.outwash[0]._downhill_array = []\n",
" out_obj.outwash[0]._endcell_array = []\n",
" out_obj.outwash[0]._initial_discharge = []\n",
" save_dir = datadir\n",
" out_obj.save(save_dir)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0c20d251",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 353dfe3

Please sign in to comment.