Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
lee1043 committed Mar 18, 2024
1 parent c70405b commit d3ff5b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pcmdi_metrics/variability_mode/lib/eof_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,14 @@ def gain_pcs_fraction(full_field, eof_pattern, pcs, debug=False):
print("pcs: max, min:", np.max(pcs), np.min(pcs))

# Extend eof_pattern (add 3rd dimension as time then copy same 2d value for all time step)
# Matching dimension (add time axis)
reconstructed_field = genutil.grower(full_field, eof_pattern)[1]

# Matching dimension (add time axis)
# Reconstruct field
for t in range(0, len(pcs)):
reconstructed_field[t] = MV2.multiply(reconstructed_field[t], pcs[t])

# 2-2) Get variance of reconstructed field
# 2-2) Get variance of the reconstructed field
variance_partial = genutil.statistics.variance(reconstructed_field, axis="t")
variance_partial_area_ave = cdutil.averager(
variance_partial, axis="xy", weights="weighted"
Expand Down

0 comments on commit d3ff5b3

Please sign in to comment.