Skip to content

Commit

Permalink
fix: check if proton current coord exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jokasimr committed Dec 17, 2024
1 parent 4a373d1 commit a112f15
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ess/amor/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ def add_masks(
wbins[0],
wbins[-1],
)
# Take inverse and use >= because we want to mask nan values
da.bins.masks['proton_current_too_low'] = ~(
da.bins.coords['proton_current'] >= da.coords['median_proton_current'] / 2
)
if 'proton_current' in da.bins.coords:
# Take inverse and use >= because we want to mask nan values
da.bins.masks['proton_current_too_low'] = ~(
da.bins.coords['proton_current'] >= da.coords['median_proton_current'] / 2
)
return da


Expand Down

0 comments on commit a112f15

Please sign in to comment.