Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bnb/dev #98

Merged
merged 10 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test for windstats
  • Loading branch information
bnb32 committed Oct 5, 2022
commit a543a1c92648752a9486b2b5d3a26d7b91b8a167
2 changes: 1 addition & 1 deletion sup3r/qa/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def ws_ramp_rate_dist(u, v, bins=50, range=None, diff_max=10, t_steps=1,
msg = (f'Received t_steps={t_steps} for ramp rate calculation but data '
f'only has {u.shape[-1]} time steps')
assert t_steps < u.shape[-1], msg
ws = np.sqrt(u**2 + v**2)
ws = np.hypot(u, v)
diffs = (ws[..., t_steps:] - ws[..., :-t_steps]).flatten()
diffs /= scale
diffs = diffs[(np.abs(diffs) < diff_max)]
Expand Down
2 changes: 1 addition & 1 deletion sup3r/utilities/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def invert_uv(u, v, lat_lon):
v_rot = np.sin(theta)[:, :, np.newaxis] * u
v_rot += np.cos(theta)[:, :, np.newaxis] * v

ws = np.sqrt(u_rot**2 + v_rot**2)
ws = np.hypot(u_rot, v_rot)
wd = (np.degrees(np.arctan2(u_rot, v_rot)) + 360) % 360

if invert_lat:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ def test_stats():
max_workers=1, ramp_rate_t_step=1)
with Sup3rWindStats(*args, **kwargs) as qa:
qa.run()

assert os.path.exists(qa_fp)

with open(qa_fp, 'rb') as fh:
qa_out = pickle.load(fh)
assert 'lr_100m' in qa_out
Expand Down