Skip to content
Snippets Groups Projects
Commit 4a04270f authored by lkugler's avatar lkugler
Browse files

fix

parent 78196a4f
Branches
Tags
No related merge requests found
......@@ -434,9 +434,8 @@ def is_assim_error_parametrized(obscfg):
else:
return False
def get_parametrized_error(obscfg, df_obs):
"""Calculate the parametrized error for an ObsRecord
This can be all observations or just a subset of all
def get_parametrized_error(obscfg):
"""Calculate the parametrized error for an ObsConfig (one obs type)
Args
obscfg ()
......@@ -449,6 +448,8 @@ def get_parametrized_error(obscfg, df_obs):
# run obs operator (through filter program)
# creates obs_seq.final containing truth & prior Hx
run_Hx(time, obscfg)
osf = obsseq.ObsSeq(cluster.dartrundir + "/obs_seq.final")
df_obs = osf.df
if hasattr(exp, "superob_km"):
print("superobbing to", exp.superob_km, "km")
......@@ -554,8 +555,7 @@ if __name__ == "__main__":
mask_kind = oso.df.kind == kind
if is_assim_error_parametrized(obscfg):
assim_err = get_parametrized_error(obscfg, oso.df[mask_kind])
assim_err = get_parametrized_error(obscfg)
oso.df[mask_kind] = assim_err**2
else:
......@@ -566,6 +566,8 @@ if __name__ == "__main__":
print(" 3) assimilate ")
archive_osq_out(time)
set_DART_nml()
assimilate()
archive_filteroutput(time)
......
......@@ -379,7 +379,7 @@ class ObsSeq(object):
x, y, z, z_coord = lines[line_loc].split()
out["loc3d"] = float(x), float(y), float(z), int(z_coord)
out["kind"] = int(lines[line_kind].strip())
out["metadata"] = lines[line_kind + 1 : -3]
out["metadata"] = lines[line_kind + 1 : -2]
out["time"] = tuple(lines[-2].split())
out["variance"] = float(lines[-1].strip())
return out
......@@ -406,8 +406,7 @@ class ObsSeq(object):
return list_of_obsdict
def to_pandas(self):
"""Create xr.Dataset containing observations
Variables = observation types
"""Create pd.DataFrame with rows=observations
"""
obs_dict_list = self.obs_to_dict()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment