Skip to content

Commit

Permalink
fixes for MARS access protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshawkes committed Mar 5, 2024
1 parent 16fab94 commit b6d8d2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions polytope_server/common/datasource/mars.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,23 @@ def __init__(self, config):

self.mars_binary = config.get("binary", "mars")

self.protocol = config.get("protocol", "dhs")

if self.protocol == "remote":
# need to set FDB5 config in a <path>/etc/fdb/config.yaml
self.fdb_config = config.get("fdb_config", {})
self.fdb_home = self.tmp_dir + "/fdb-home"
os.makedirs(self.fdb_home + "/etc/fdb/", exist_ok=True)
with open(self.fdb_home + "/etc/fdb/config.yaml", "w") as f:
yaml.dump(self.fdb_config, f)

# Write the mars config
if "config" in config:
self.mars_config = config.get("config", {})

if self.protocol == "remote":
self.mars_config[0]["home"] = self.fdb_home

self.mars_home = self.tmp_dir + "/mars-home"
os.makedirs(self.mars_home + "/etc/mars-client/", exist_ok=True)
with open(self.mars_home + "/etc/mars-client/databases.yaml", "w") as f:
Expand Down
1 change: 1 addition & 0 deletions polytope_server/common/datasource/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(self, config):
"date": {"merge": {"with": "time", "linkers": ["T", "00"]}},
"step": {"type_change": "int"},
"number": {"type_change": "int"},
"longitude" : {"cyclic": [0, 360]},
}

logging.info("Set up gribjump")
Expand Down

0 comments on commit b6d8d2f

Please sign in to comment.