Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
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
4 changes: 3 additions & 1 deletion utide/confidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ def _confidence(coef, cnstit, opt, t, e, tin, elor, xraw, xmod, W, m, B,
varcov_mCw[c, :2, :2] = Duu

if not opt.white:
Duu = Puu[c] * Duu / np.trace(Duu)
Duu = Puu[c] * Duu

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trailing space after Duu.

if np.trace(Duu) != 0. :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a whitespace before :.

Duu = Duu / np.trace(Duu)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't compute np.trace twice and we can do the Duu division in place:

trace = np.trace(Duu)
if trace != 0. :
    Duu /= trace

varcov_mCc[c, :2, :2] = Duu

if not opt.twodim:
Expand Down
4 changes: 3 additions & 1 deletion utide/harmonics.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def FUV(t, tref, lind, lat, ngflgs):

astro, ader = ut_astron(tt)

if abs(lat) < 5:
if lat == 0:
lat = 5
elif abs(lat) < 5:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lat = np.sign(lat) * 5

slat = np.sin(np.deg2rad(lat))
Expand Down