Skip to content

Commit 34eef06

Browse files
committed
Choose sources instead of using all
1 parent 62ba345 commit 34eef06

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

opendrift_leeway_webgui/simulation.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,26 @@ def main():
8585
args = parser.parse_args()
8686

8787
simulation = Leeway(loglevel=50)
88-
sources = [
88+
89+
local_sources = [
8990
os.path.join(INPUTDIR, data_file)
9091
for data_file in os.listdir(INPUTDIR)
9192
if data_file.endswith(".nc")
9293
]
93-
94-
if not args.no_web:
94+
if local_sources:
95+
sources = local_sources
96+
elif not args.no_web:
9597
if "COPERNICUSMARINE_SERVICE_USERNAME" in os.environ:
9698
print("Using CMEMS")
97-
sources.append("cmems_mod_med_phy-cur_anfc_4.2km_PT15M-i")
98-
sources.append("cmems_mod_glo_phy_anfc_merged-uv_PT1H-i")
99-
sources.extend(
100-
(
101-
"https://tds.hycom.org/thredds/dodsC/GLBy0.08/latest",
102-
"https://pae-paha.pacioos.hawaii.edu/thredds/dodsC/ncep_global/NCEP_Global_Atmospheric_Model_best.ncd",
103-
)
104-
)
99+
sources = [
100+
"cmems_mod_med_phy-cur_anfc_4.2km_PT15M-i",
101+
"cmems_mod_glo_phy_anfc_merged-uv_PT1H-i"
102+
]
103+
else:
104+
sources = [
105+
"https://tds.hycom.org/thredds/dodsC/GLBy0.08/latest",
106+
"https://pae-paha.pacioos.hawaii.edu/thredds/dodsC/ncep_global/NCEP_Global_Atmospheric_Model_best.ncd",
107+
]
105108

106109
print("Using sources:\n - {}".format("\n - ".join(sources)))
107110

0 commit comments

Comments
 (0)