Skip to content

Commit

Permalink
Analysis script, environment
Browse files Browse the repository at this point in the history
  • Loading branch information
fakufaku committed Apr 17, 2020
1 parent 225ce12 commit 4ccf4eb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
29 changes: 29 additions & 0 deletions analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import json
import pandas as pd
import argparse
from pathlib import Path
import numpy as np

if __name__ == "__main__":

parser = argparse.ArgumentParser(description="Sparse minimum distortion simulation results analaysis")
parser.add_argument("results_dir", type=Path, help="Location of simulation results")
args = parser.parse_args()


with open(args.results_dir / "data.json") as f:
data = json.load(f)

with open(args.results_dir / "parameters.json") as f:
params = json.load(f)

# concatenate all the results
results = []
for r in data:
results += r

for r in results:
for metric in ["sdr", "sir"]:
r[metric] = np.mean(r[metric])

df = pd.DataFrame(results)
10 changes: 10 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: sparse_projection_back
dependencies:
- numpy
- scipy
- pandas
- matplotlib
- pip
- seaborn
- pip:
- repsimtools
4 changes: 2 additions & 2 deletions process.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def process(args, config):
# minimum distortion
lo, hi, step = config["minimum_distortion"]["p_list"]
kwargs = config["minimum_distortion"]["kwargs"]
for p in np.arange(lo, hi, step):
for q in np.arange(p, hi, step):
for p in np.arange(lo, hi + step, step):
for q in np.arange(p, hi + step, step):
t["p"], t["q"], t["proj_algo"] = (
f"{p:.1f}",
f"{q:.1f}",
Expand Down

0 comments on commit 4ccf4eb

Please sign in to comment.