diff --git a/DSSAT_WTH.py b/DSSAT_WTH.py index 1cb3c5c..ee88373 100644 --- a/DSSAT_WTH.py +++ b/DSSAT_WTH.py @@ -11,9 +11,9 @@ import shutil import pandas as pd from datetime import datetime, date, timedelta -from chirps import * +from .CHIRPS import * import joblib -from getnasap import nasa, nasachirps +from .getnasap import nasa, nasachirps def dssat_wth(in_file, startDate, endDate, out_dir): s1 = datetime.now() diff --git a/__init__.py b/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/__main__.py b/__main__.py index 07d9d38..a4927cc 100644 --- a/__main__.py +++ b/__main__.py @@ -8,8 +8,8 @@ import sys import argparse -from dssat_wth import dssat_wth -from update_wth import update_wth +from .DSSAT_WTH import dssat_wth +from .update_wth import update_wth def main(): parser = argparse.ArgumentParser() @@ -34,4 +34,4 @@ def main(): update_wth(args.in_file, args.in_dir, args.out_dir) if __name__ == "__main__": - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/__pycache__/CHIRPS.cpython-39.pyc b/__pycache__/CHIRPS.cpython-39.pyc new file mode 100644 index 0000000..0035523 Binary files /dev/null and b/__pycache__/CHIRPS.cpython-39.pyc differ diff --git a/__pycache__/DSSAT_WTH.cpython-39.pyc b/__pycache__/DSSAT_WTH.cpython-39.pyc new file mode 100644 index 0000000..717179b Binary files /dev/null and b/__pycache__/DSSAT_WTH.cpython-39.pyc differ diff --git a/__pycache__/__init__.cpython-39.pyc b/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..268b294 Binary files /dev/null and b/__pycache__/__init__.cpython-39.pyc differ diff --git a/__pycache__/__main__.cpython-39.pyc b/__pycache__/__main__.cpython-39.pyc new file mode 100644 index 0000000..7b55c68 Binary files /dev/null and b/__pycache__/__main__.cpython-39.pyc differ diff --git a/__pycache__/getnasap.cpython-39.pyc b/__pycache__/getnasap.cpython-39.pyc new file mode 100644 index 0000000..1ec5330 Binary files /dev/null and b/__pycache__/getnasap.cpython-39.pyc differ diff --git a/__pycache__/main.cpython-39.pyc b/__pycache__/main.cpython-39.pyc new file mode 100644 index 0000000..bca1250 Binary files /dev/null and b/__pycache__/main.cpython-39.pyc differ diff --git a/__pycache__/update_wth.cpython-39.pyc b/__pycache__/update_wth.cpython-39.pyc new file mode 100644 index 0000000..787fc9c Binary files /dev/null and b/__pycache__/update_wth.cpython-39.pyc differ diff --git a/getnasap.py b/getnasap.py index b76a60f..cf88504 100644 --- a/getnasap.py +++ b/getnasap.py @@ -95,7 +95,7 @@ def check_files(user_input, nasa_outdir): return False #Function to check that all NASAPOWER files requested are downloaded. -def get_data2(user_input, cf): +def get_data2(user_input, cf, startDate, endDate, nasa_outdir): if cf[2] < cf[1]: print(cf[1] - cf[2], "missing file(s):", cf[0]) @@ -121,7 +121,7 @@ def nasa(user_input, startDate, endDate, nasa_outdir): get_data(user_input, startDate, endDate, nasa_outdir) cf = check_files(user_input, nasa_outdir) #To check that all files requested were downloaded. if cf: - get_data2(user_input, cf) + get_data2(user_input, cf, startDate, endDate, nasa_outdir) if check_files(user_input, nasa_outdir): print('Program terminated. Please check manually NASAPOWER server response.') sys.exit(1) diff --git a/update_wth.py b/update_wth.py index b162931..c3a907d 100644 --- a/update_wth.py +++ b/update_wth.py @@ -11,9 +11,9 @@ import shutil import pandas as pd from datetime import datetime, date, timedelta -from chirps import * +from .CHIRPS import * import joblib -from getnasap import nasa, nasachirps +from .getnasap import nasa, nasachirps #Select requested (.WTH) files from historical repository and copy them to a new folder. def sel_wthfiles(in_file, in_dir, outdir_hist):