Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Jan 12, 2024
1 parent 03407f9 commit 37a89bf
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 96 deletions.
7 changes: 5 additions & 2 deletions spf/dataset/spf_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
)


def pi_norm(x):
return ((x + np.pi) % (2 * np.pi)) - np.pi


# from Stackoverflow
def yaml_as_dict(my_file):
my_dict = {}
Expand Down Expand Up @@ -314,7 +318,6 @@ def get_yaml_config(self):
def __init__(
self,
root_dir,
yaml_config_fn=None,
snapshots_in_session=128,
nsources=1,
step_size=1,
Expand Down Expand Up @@ -419,7 +422,7 @@ def __getitem__(self, idx):
tx_positions_at_t - rx_position_at_t[:, None]
) # broadcast over nsource dimension
# diffs=(batchsize, nsources, 2)
source_theta_at_t = (
source_theta_at_t = pi_norm(
np.arctan2(diffs[:, 0, [0]], diffs[:, 0, [1]]) - rx_orientation_at_t
) # rotation to the right around x=0, y+

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
parser.add_argument("--session-idx", type=int, required=True)
parser.add_argument("--steps", type=int, required=False, default=3)
parser.add_argument("--step-size", type=int, required=False, default=16)
parser.add_argument("-c", "--yaml-config", type=str, required=True)
parser.add_argument("--duration", type=int, required=False, default=50)
parser.add_argument(
"--output_prefix", type=str, required=False, default="session_output"
Expand All @@ -23,7 +22,6 @@
snapshots_in_session=args.snapshots_in_session,
nsources=1,
step_size=args.step_size,
# yaml_config_fn=args.yaml_config,
)
print(ds)
print("DSLEN", ds.len)
Expand Down
Loading

0 comments on commit 37a89bf

Please sign in to comment.