-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated script - loose unsuable basins
- Loading branch information
Jesus Perez Curbelo (ame805)
committed
May 28, 2024
1 parent
1912856
commit d168a4b
Showing
11 changed files
with
6,511 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,16 @@ | ||
#!/bin/bash | ||
|
||
#SBATCH --account=hpc_c_giws_spiteri | ||
#SBATCH --job-name=camels_spat2nh | ||
#SBATCH --time=2-00:00:00 | ||
#SBATCH --ntasks=1 | ||
#SBATCH --cpus-per-task=32 | ||
#SBATCH --mem=64G | ||
#SBATCH --output=camels_spat2nh-%j.out | ||
|
||
module load python/3.11.5 | ||
|
||
# Path to your virtual environment's activation script | ||
source venv-camelsspat/bin/activate | ||
|
||
python3 camels_spat2nh.py |
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,37 @@ | ||
import os | ||
import sys | ||
import pandas as pd | ||
from pathlib import Path | ||
|
||
from utils.utils import load_util_data, get_unusable_basins | ||
|
||
# Get the root directory of the project with Path | ||
ROOT_DIR = Path(__file__).resolve().parents[0] | ||
|
||
if __name__ == '__main__': | ||
|
||
print(ROOT_DIR) | ||
print(os.listdir(ROOT_DIR)) | ||
|
||
# camels_spat2nh() | ||
data_dir, data_gen = load_util_data(str(ROOT_DIR)) | ||
|
||
# Load Unusable basins | ||
unusuable_basins = get_unusable_basins(data_dir['data_dir_camels_spat_nh'], data_gen['camels_spat_unusable']) | ||
|
||
# # Load files in data_dir['data_dir_camels_spat'] / 'attributes' | ||
# attributes_dir = Path(data_dir['data_dir_camels_spat']) / 'attributes' | ||
|
||
# # Loas 1st file in attributes_dir | ||
# file = sorted(os.listdir(attributes_dir))[0] | ||
# df = pd.read_csv(attributes_dir / file) | ||
# print(df.head()) | ||
|
||
att_file_dir = Path(data_dir['data_dir_camels_spat']) / 'camels_spat_attributes.csv' | ||
df = pd.read_csv(att_file_dir) | ||
print(df.head()) | ||
|
||
# Copy attribute file to ROOT_DIR / 'data' | ||
att_file_dir_out = ROOT_DIR / 'data' / 'camels_spat_attributes.csv' | ||
df.to_csv(att_file_dir_out, index=False) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.