Skip to content

Commit

Permalink
applying latest review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilo9999 committed Mar 3, 2024
1 parent feb3d38 commit ac0ae99
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/icesat2_tracks/local_modules/m_general_ph3.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,13 @@ def power_imshow(
downscale_fac=None,
anomalie=False,
downscale_type=None,
fig_size=None,
fig_size=[10, 4],
nopower=False,
ax=None,
cbar=True,
):

shading = "gouraud" if shading else "flat"
fig_size = [10, 4] if fig_size else fig_size
if ax:
assert type(ax) is tuple, "put ax as tuple ax=(ax,F)"
self.F = ax[1]
Expand All @@ -445,11 +444,12 @@ def power_imshow(

ax_local.set_yscale("log", nonposy="clip")

if downscale_fac is not None:
if downscale_fac:
if downscale_type == "inter":
fn = []
for yr in np.arange(0, self.fs.size, downscale_fac):
fn.append(np.mean(self.fs[yr : yr + downscale_fac]))
fn = [
np.mean(self.fs[yr : yr + downscale_fac])
for yr in np.arange(0, self.fs.size, downscale_fac)
]
else:

ddn = np.empty((self.time.size - 1))
Expand All @@ -469,16 +469,13 @@ def power_imshow(
dd2 = ddn
fn = self.fs[fsn_p]

if nopower:
tt = tt
else:
if not nopower:
tt = tt[:-1]

else:
if nopower:
tt = tt
else:
if not nopower:
tt = tt[:-1]

dd2 = dd.T
fn = self.fs

Expand Down Expand Up @@ -560,13 +557,12 @@ def linear_imshow(
downscale_fac=None,
anomalie=False,
downscale_type=None,
fig_size=None,
fig_size=[10, 4],
nopower=False,
ax=None,
):

shading = "gouraud" if shading else "flat"
fig_size = [10, 4] if fig_size else fig_size
if ax:
assert type(ax) is tuple, "put ax as tuple ax=(ax,F)"
self.F = ax[1]
Expand Down Expand Up @@ -622,10 +618,9 @@ def linear_imshow(
tt = tt[:-1]

else:
if nopower:
tt = tt
else:
if not nopower:
tt = tt[:-1]

dd2 = dd.T
fn = self.fs

Expand Down Expand Up @@ -814,7 +809,6 @@ def set_timeaxis_days(ax, int1=1, int2=2, bymonthday=range(1, 32)):
# int1 interval of the major (labeld) days
# int2 intercal of the minor (only ticks) days

bymonthday = bymonthday if bymonthday is not None else range(1, 32)
Month = dates.MonthLocator()
Month_dfmt = dates.DateFormatter("%b/%y")
Day = dates.DayLocator(interval=int2, bymonthday=bymonthday)
Expand Down

0 comments on commit ac0ae99

Please sign in to comment.