Skip to content

Commit

Permalink
Update profile_stratification.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jpolton authored May 14, 2024
1 parent 0d46d1a commit 5227549
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions coast/diagnostics/profile_stratification.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,15 @@ def calc_pea(

if not "density" in profile.dataset:
profile.construct_density(CT_AS=CT_AS, pot_dens=True)

# Update Zd_mask to exlude nan points
Zd_mask = Zd_mask.where(
np.isfinite(profile.dataset.variables["density"]), 0
)

if not "density_bar" in profile.dataset:
profile.construct_density(CT_AS=CT_AS, rhobar=True, Zd_mask=Zd_mask, pot_dens=True)
rho = profile.dataset.variables["density"].fillna(0) # density
Zd_mask = Zd_mask.where(
np.isfinite(profile.dataset.variables["density"]), 0
) # update Zd_mask to exclude nan pts
rhobar = profile.dataset.variables["density_bar"] # density with depth-mean T and S

pot_energy_anom = (
Expand Down

0 comments on commit 5227549

Please sign in to comment.