Commit f87af58a authored by Chris Jewell's avatar Chris Jewell
Browse files

Merge branch 'add-summaries' into 'master'

Added daily absolute incidence and incidence per 100k to summary_longformat.py

See merge request !28
parents 1144f1ec b8347746
...@@ -108,12 +108,23 @@ def summary_longformat(input_files, output_file): ...@@ -108,12 +108,23 @@ def summary_longformat(input_files, output_file):
insample_df["value_name"] = "insample14_Cases" insample_df["value_name"] = "insample14_Cases"
df = pd.concat([df, insample_df], axis="index") df = pd.concat([df, insample_df], axis="index")
# Medium term incidence # Medium term absolute incidence
medium_term = xarray.open_dataset(input_files[3]) medium_term = xarray.open_dataset(input_files[3])
medium_df = xarray2summarydf( medium_df = xarray2summarydf(
medium_term["events"][..., 2].reset_coords(drop=True) medium_term["events"][..., 2].reset_coords(drop=True)
) )
medium_df["value_name"] = "Cases" medium_df["value_name"] = "absolute_incidence"
df = pd.concat([df, medium_df], axis="index")
# Medium term incidence per 100k
medium_df = xarray2summarydf(
(
medium_term["events"][..., 2].reset_coords(drop=True)
/ data["N"][np.newaxis, :, np.newaxis]
)
* 100000
)
medium_df["value_name"] = "incidence_per_100k"
df = pd.concat([df, medium_df], axis="index") df = pd.concat([df, medium_df], axis="index")
# Weekly incidence per 100k # Weekly incidence per 100k
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment