Skip to content

Commit

Permalink
Adding some changes missed in the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilo9999 committed Mar 5, 2024
1 parent 0713cf8 commit cdcbd40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/icesat2_tracks/ICEsat2_SI_tools/angle_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def likelyhood_func(
tot_var = z_error**2 + z_model**2

def simple_log_panelty(x, x0, sigma):
return -np.power((x - x0) / sigma, 2.0) / 2.0
return -((x - x0) / sigma) ** 2.0 / 2.0

# try ot get prior
if prior is not None:
Expand Down
13 changes: 7 additions & 6 deletions src/icesat2_tracks/ICEsat2_SI_tools/filter_regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pandas as pd
import matplotlib as plt


def process_single_stencil_set(
stancil_set, T2, key_var, key_x_coord, stancil_width, calc_stencil_stats
):
Expand Down Expand Up @@ -72,9 +73,9 @@ def track_pole_ward_file(hdf5_file, product="ALT03"):
";last lat =" + str(abs(T_lat[T_time.argmax()])),
)

_lhs = abs(T_lat[T_time.argmax()])
_lhs = abs(T_lat[T_time.argmax()])
_rhs = abs(T_lat[T_time.argmin()])
return _lhs > _rhs
return _lhs > _rhs


def track_type(T):
Expand All @@ -83,7 +84,7 @@ def track_type(T):
T is a pandas table
"""

max_lat = T["lats"].iloc[T["delta_time"].argmax()]
max_lat = T["lats"].iloc[T["delta_time"].argmax()]
min_lat = T["lats"].iloc[T["delta_time"].argmin()]
delta_lat = max_lat - min_lat
return delta_lat < 0
Expand Down Expand Up @@ -414,10 +415,10 @@ def calc_stencil_stats(istencil):

Tmedian = T2[i_mask].median()

Tmedian[key + "_weighted_mean"] = np.nan
Tmedian[key + "_mode"] = np.nan
Tmedian[f"{key}_weighted_mean"] = np.nan
Tmedian[f"{key}_mode"] = np.nan
Tmedian["N_photos"] = Nphoton
Tmedian[key + "_std"] = np.nan
Tmedian[f"{key}_std"] = np.nan

return istencil[1], Tmedian

Expand Down

0 comments on commit cdcbd40

Please sign in to comment.