-
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.
jupyter notebook for editing saved cascade npz files to change the bi…
…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.
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
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 | ||
} |