-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a new case to try prepare_data script
- Loading branch information
1 parent
d18c904
commit 0db0480
Showing
8 changed files
with
178 additions
and
116 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
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 was deleted.
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,41 @@ | ||
""" | ||
Author: Wenyu Ouyang | ||
Date: 2024-03-25 09:21:56 | ||
LastEditTime: 2024-03-25 17:08:08 | ||
LastEditors: Wenyu Ouyang | ||
Description: Script for preparing data | ||
FilePath: \hydro-model-xaj\scripts\prepare_data.py | ||
Copyright (c) 2023-2024 Wenyu Ouyang. All rights reserved. | ||
""" | ||
|
||
from pathlib import Path | ||
import sys | ||
import os | ||
import argparse | ||
|
||
current_script_path = Path(os.path.realpath(__file__)) | ||
repo_root_dir = current_script_path.parent.parent | ||
sys.path.append(str(repo_root_dir)) | ||
from hydromodel.datasets.data_preprocess import process_and_save_data_as_nc | ||
|
||
|
||
def main(args): | ||
data_path = args.origin_data_dir | ||
|
||
if process_and_save_data_as_nc(data_path, save_folder=data_path): | ||
print("Data is ready!") | ||
else: | ||
print("Data format is incorrect! Please check the data.") | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Prepare data.") | ||
parser.add_argument( | ||
"--origin_data_dir", | ||
type=str, | ||
help="Path to your hydrological data", | ||
default="C:\\Users\\wenyu\\Downloads\\biliuhe", | ||
) | ||
|
||
args = parser.parse_args() | ||
main(args) |
This file was deleted.
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,9 @@ | ||
""" | ||
Author: Wenyu Ouyang | ||
Date: 2022-10-25 21:16:22 | ||
LastEditTime: 2024-03-25 14:59:43 | ||
LastEditors: Wenyu Ouyang | ||
Description: Test for data preprocess | ||
FilePath: \hydro-model-xaj\test\test_data_postprocess.py | ||
Copyright (c) 2021-2022 Wenyu Ouyang. All rights reserved. | ||
""" |
Oops, something went wrong.