Skip to content

Commit

Permalink
Merge pull request #179 from brown-ccv/feat-logger/5-replace-print-lo…
Browse files Browse the repository at this point in the history
…gger-local_modules

chore: logging 5 - remove prints from local_modules directory
  • Loading branch information
hollandjg authored Mar 22, 2024
2 parents 2d0bff2 + 2c472f8 commit b032621
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 168 deletions.
11 changes: 6 additions & 5 deletions src/icesat2waves/local_modules/jonswap_gamma.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

import logging
from scipy.constants import g

from lmfit import minimize, Parameters
import copy
import matplotlib.pyplot as plt
import numpy as np

_logger = logging.getLogger(__name__)

#
def normalize_time(time):
Expand Down Expand Up @@ -96,7 +97,7 @@ def JONSWAP_bulk(f, floc=0.04, famp=1e-2, gamma=3.3, peak_std=1e-1):

delta = np.exp(-((w - wp) ** 2) / (2 * peak_std**2 * wp**2))
peak_factor = gamma**delta

# units of m^2 / Hz
return alpha * w ** (-5) * np.exp(-stretch * (w / wp) ** -4) * peak_factor

Expand Down Expand Up @@ -127,7 +128,7 @@ def pierson_moskowitz_fetch_limit(f, X, U):
alpha = 0.076 * (g * X / U**2) ** (-0.22)

wp = 7.0 * np.pi * (g / U) * (g * X / U**2) ** (-0.33)
print("wp=" + str(wp))
_logger.debug("wp=%s", wp)

sigma_p = 0.07
sigma_pp = 0.09
Expand Down Expand Up @@ -170,7 +171,7 @@ def JONSWAP_default(f, X, U, gamma=3.3):

return (
alpha * g**2.0 * w ** (-5.0) * np.exp(-5.0 / 4.0 * (w / wp) ** -4) * peak_factor
) # Hz**-5 m**2 /s**4 = m**2 sec
) # Hz**-5 m**2 /s**4 = m**2 sec


""" add function for X_tilde(X, U10), alpha(f_max, U10) and f_max(U10, X_tilde) or f_max(U, X)"""
Expand Down Expand Up @@ -730,7 +731,7 @@ def reg_func(p0, pi, p_err_unit):
vd[k] = I * np.random.rand()

Jm = Jm_regulizer(vd, priors)
print(Jm)
_logger.debug("Jm from regulizer: %s", Jm)



Expand Down
5 changes: 2 additions & 3 deletions src/icesat2waves/local_modules/m_colormanager_ph3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division

from matplotlib.colors import LinearSegmentedColormap
Expand Down Expand Up @@ -54,7 +53,7 @@ class color:
def __init__(self, path=None, name=None):
self.white=(1,1,1)
if (path is not None) & (name is not None):
_logger.debug("color theme: %s", name)
_logger.debug('color theme: %s', name)
try:
theme=json_load(name, path)
for k, v in theme.items():
Expand Down Expand Up @@ -173,7 +172,7 @@ def colormaps(self,n, gamma=None):

def show(self):
for key in self.__dict__.keys():
_logger.debug(key)
_logger.debug("key: %s", key)

_logger.debug(' rels dict keys:')
for key in self.rels.keys():
Expand Down
Loading

0 comments on commit b032621

Please sign in to comment.