diff --git a/.ipynb_checkpoints/setup-checkpoint.py b/.ipynb_checkpoints/setup-checkpoint.py index 00a4651..1575d34 100644 --- a/.ipynb_checkpoints/setup-checkpoint.py +++ b/.ipynb_checkpoints/setup-checkpoint.py @@ -33,7 +33,7 @@ """ # Other information -VERSION = "0.1.8" +VERSION = "0.2.0" DESCRIPTION = "URL generator tool for National Water Model data" setup( diff --git a/nwmurl/.ipynb_checkpoints/urlgennwm-checkpoint.py b/nwmurl/.ipynb_checkpoints/urlgennwm-checkpoint.py index cc9786b..7207bc7 100644 --- a/nwmurl/.ipynb_checkpoints/urlgennwm-checkpoint.py +++ b/nwmurl/.ipynb_checkpoints/urlgennwm-checkpoint.py @@ -483,7 +483,7 @@ def create_file_list( def generate_url_retro(date, file_type, urlbase_prefix, retrospective_var_types=None): year_txt = date.strftime("%Y") date_txt = date.strftime("%Y%m%d%H") - + if "forcing" in file_type and date.year < 2007: url = f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}00.LDASIN_DOMAIN1" elif "forcing" in file_type and date.year >= 2007: @@ -493,7 +493,10 @@ def generate_url_retro(date, file_type, urlbase_prefix, retrospective_var_types= f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}00{type}" for type in retrospective_var_types ] - + + if urlbase_prefix == "https://ciroh-nwm-zarr-retrospective-data-copy.s3.amazonaws.com/noaa-nwm-retrospective-2-1-zarr-pds/": + for url in url: + url = url + ".json" return url diff --git a/nwmurl/__pycache__/urlgennwm.cpython-310.pyc b/nwmurl/__pycache__/urlgennwm.cpython-310.pyc new file mode 100644 index 0000000..eb5bfad Binary files /dev/null and b/nwmurl/__pycache__/urlgennwm.cpython-310.pyc differ diff --git a/nwmurl/urlgennwm.py b/nwmurl/urlgennwm.py index 1268270..7207bc7 100644 --- a/nwmurl/urlgennwm.py +++ b/nwmurl/urlgennwm.py @@ -483,7 +483,7 @@ def create_file_list( def generate_url_retro(date, file_type, urlbase_prefix, retrospective_var_types=None): year_txt = date.strftime("%Y") date_txt = date.strftime("%Y%m%d%H") - + if "forcing" in file_type and date.year < 2007: url = f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}00.LDASIN_DOMAIN1" elif "forcing" in file_type and date.year >= 2007: @@ -493,7 +493,10 @@ def generate_url_retro(date, file_type, urlbase_prefix, retrospective_var_types= f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}00{type}" for type in retrospective_var_types ] - + + if urlbase_prefix == "https://ciroh-nwm-zarr-retrospective-data-copy.s3.amazonaws.com/noaa-nwm-retrospective-2-1-zarr-pds/": + for url in url: + url = url + ".json" return url @@ -565,7 +568,7 @@ def generate_urls_operational( if write_to_file == True: if os.path.exists("filenamelist.txt"): os.remove("filenamelist.txt") - with open("filenamelist.txt", "wt") as file: - for item in file_list: - file.write(f"{item}\n") + with open("filenamelist.txt", "wt") as file: + for item in file_list: + file.write(f"{item}\n") return file_list diff --git a/setup.py b/setup.py index 627b764..1575d34 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ """ # Other information -VERSION = "0.1.9" +VERSION = "0.2.0" DESCRIPTION = "URL generator tool for National Water Model data" setup(