Skip to content

Commit 96b77ad

Browse files
Update src/perturbIC.py
Co-authored-by: Davide Marchegiani <[email protected]>
1 parent c548352 commit 96b77ad

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/perturbIC.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,26 +124,23 @@ def create_perturbation(amplitude, random_generator, shape, nullify_poles = True
124124
return perturbation
125125

126126

127-
def do_perturb(field, surface_stash_code):
127+
def is_field_to_perturb(field, stash_to_perturb):
128128
"""
129-
This function checks to make sure that the correct field is used (surface temperature)
130-
129+
Check if the field STASH itemcode correspond to the one to perturb.
130+
131131
Parameters
132132
----------
133-
134-
field : mule fields Object
135-
Holds the entire umfile including metadata and datai
136-
137-
surface_stash_code : int
133+
field : mule.Field
134+
Field to check.
135+
stash_to_perturb: int
136+
STASH itemcode to perturb.
138137
139138
Returns
140139
----------
141-
boolean - True if this is the correct data to be perturbed. False for all other item code
140+
bool
141+
Returns True if the field STASH itemcode corresponds to the one to perturb.
142142
"""
143-
if field.lbuser4 == surface_stash_code:
144-
return True
145-
else:
146-
return False
143+
return field.lbuser4 == stash_to_perturb
147144

148145
class SetAdditionOperator(mule.DataOperator):
149146
"""

0 commit comments

Comments
 (0)