Skip to content

Commit

Permalink
minor bugfixes to delineation
Browse files Browse the repository at this point in the history
  • Loading branch information
wknoben committed Apr 11, 2023
1 parent bd84ccd commit 5eb6e30
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 32 deletions.
22 changes: 13 additions & 9 deletions 4_data_structure_prep/2_prepare_data_folders.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"id": "d620051d",
"metadata": {},
"outputs": [],
Expand All @@ -35,7 +35,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 2,
"id": "0bd4a19f",
"metadata": {},
"outputs": [],
Expand All @@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 3,
"id": "4855e428",
"metadata": {},
"outputs": [],
Expand All @@ -68,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 4,
"id": "5a6d6877",
"metadata": {},
"outputs": [],
Expand All @@ -80,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 5,
"id": "e9904766",
"metadata": {},
"outputs": [],
Expand All @@ -97,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 6,
"id": "4a2e8e25",
"metadata": {},
"outputs": [],
Expand All @@ -121,7 +121,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 7,
"id": "4d6ca6ad",
"metadata": {},
"outputs": [],
Expand All @@ -148,8 +148,12 @@
" # 2. Copy reference shape to destination if available\n",
" if row['Country'] == 'USA':\n",
" \n",
" # Account for the missing leading zeroes in the ref_camels_us shape, because this column is stored as integers (not str)\n",
" station_id_in_existing_file = row['Station_id']\n",
" if station_id_in_existing_file[0] == '0': station_id_in_existing_file = station_id_in_existing_file[1:]\n",
" \n",
" # Check if a reference shape exists, and process if so\n",
" mask = ref_camels_us['hru_id'].astype('str') == row['Station_id'] # ref_camels_us['hru_id'] is type Int. Make Str for matching\n",
" mask = ref_camels_us['hru_id'].astype('str') == station_id_in_existing_file # ref_camels_us['hru_id'] is type Int. Make Str for matching\n",
" if any(mask): \n",
" basin,src = cs.process_camels_us_ref_shape(ref_camels_us,mask) # Returns: basin shape in EPSG:4326\n",
" \n",
Expand Down Expand Up @@ -253,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 42,
"id": "d3b144aa",
"metadata": {},
"outputs": [],
Expand Down
57 changes: 47 additions & 10 deletions 5_basin_delineation/4_make_merged_shape_of_lumped_basins.ipynb

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions 5_basin_delineation/99_delineate_basins_one_by_one.ipynb

Large diffs are not rendered by default.

0 comments on commit 5eb6e30

Please sign in to comment.