From bc0169104b7327e120b12ee77e84f942d6f5d6db Mon Sep 17 00:00:00 2001 From: sepehrkrz Date: Tue, 14 Nov 2023 19:12:42 +0000 Subject: [PATCH] Version 0.2.0 --- .ipynb_checkpoints/setup-checkpoint.py | 2 +- .../.ipynb_checkpoints/urlgennwm-checkpoint.py | 7 +++++-- nwmurl/__pycache__/urlgennwm.cpython-310.pyc | Bin 0 -> 10143 bytes nwmurl/urlgennwm.py | 13 ++++++++----- setup.py | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 nwmurl/__pycache__/urlgennwm.cpython-310.pyc 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 0000000000000000000000000000000000000000..eb5bfadd19ea841a9c8a44c372f5850a84d8c1e1 GIT binary patch literal 10143 zcmbVSTZ|jmd7c>#hr{7zx%Z1MresSt6KSc7BP+HdTec+IvAw>mY*k}B^oVD6ml8Q# zof)pY#IQ-a4kRN8;sSjsECbR*fG7ouq7Qv(3-qCApZeg3q{RRRTI6YgKBTZ4w?bX@ z`_Ig9hbykrmIVLvpL726pZkA1Y!?cKgwNvNE!w|&L6Uw=ndB#r%rp48U0ITt#N?*b zl1*7ATxlvT#Z+1;Gu2W}Rg|Tg>6T_{0#}H zUd6zMoS#*QPMVDGTU z*|$J33G4)W0@xI*u#@cD>`C?%JH@`kPP3=kGwjSQ!<=T%vgg=Yc8;BA&$Ab9Y32-j zk$soFbW1U3*~{z|wjjnhhkjpWuYuPtrqb7*1$=!;V{foUl zy~Qp9+narz)!6T`OTZsu>Y`M6ZaP-wKlxVe&*J!-*FsUYvMw;>C#3ZAgxTdyZ zUAGzy(^&1;+-vhjyYQFr}6rdFV9Mg(p`Dsu2fNi%$mhnqwWPd zkcP9`@%R+T1i1G^b*0_1t5@1<>y}eJYk5}fOucTqZgsigRh{dt4sXT@&}G{}+5GBy zkag{*UH8CpKXpta&}BY{WXI9*3F>x|01beKwrsb;?G0 zbizAM*a?uY>jc%`=y$RYSRmDDv*XVQkRpDx((VcXlYQwn#Nr+KW9bv6m-n@gCEpNu zfu;NuQ$JQ&+DEOge=IT0SAb;&mI0=+4C*yMjS~HnVz21uP?|?B>lXwpf|mwiV07CT zRvK=3spHhWM%yXl+_9$ZmRGrrOHcb{v$BV~Sw=+}Cut3b$1OL!a>Mc3WpBkUTdS+h zM%}vHw9DAYGDYOnIr%wCB4j?Q>TbC&Ij^5 z@Z+qTns@5=(-U?G6vJ z*xzMtt*)$xt-SSBv|3uh^p+a$n^|yjJ4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z2XLtD>;)VB;yFou`1RDC=M8X{t8_u4oF{ZIy-;Tct+Y5ZuD@yk?*s zwbn%&LvYf;7hJW{*VK{C8FLD$g}oW^qLM9M8h8{bG2X*Y z4m{V8&qZgNE`<9F0P$ug-;qCrZ5+PdeJHWiO&Jl3vM*hMuYVQTO}y3J#LL~y6ujs3 zO~ikh_KDV0or4kWiHJ7MPYj{W2-*_U1>f^Gq#N=L31*b>~>KgooyKH^!_eV`mU68hQ-f1dIxNxr)( z{`*0fi(Jys(W2t$ny=gBg~tzYeW&+darOF6?;M=o?!lyowR0qZKZA~W2LOXQAO=BQ z;GvxyJN`ogBw+Y=sV)W063T)fP?_ldO<=#K?n$W9H5gOo;EK)R(v@Tdj+>5)O~;cH zWu25m{2_HidEt_ga`2@dT$&!7nx5jPdMRJUmZp1YUq|pL)64i;PxBFax~jOxkm40j zq^T&y3!%uTqZF@%BAL!b!w?KEL%rIE`d0!3kP%0O@`cRM4Vo(oZ+=|WHxz%-5R1Hh-``Y|Ce;!-a->KFJ4OUQU*N& zO@cSH6lssGud0y5Q|~K7B%k`Fo*NoF_z_s+2JELn4FL#5QE5e4Sisv7eME4!BA>66 z!+#ld$iPylxiBNhco4CxAd6rK{*}^hy24Jtji=Wdv9e@|m>FymMV&%xM3^bUIN3`a z_7Nbe7t2pqI?zu+=HX9Mr?JkG z`*VQ2Gyw%96tg-^g=qh-6qDuJf0huI!Dgtss^sGu;|pV2KLC}LG4NINxO^+sew*Z@ h-7~UEifW-U2k4D^%8|I0@ul>A>HCJR>@EKGe*g|@zz_fc literal 0 HcmV?d00001 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(