Skip to content

Commit 8eb4805

Browse files
committed
Remove dead code
1 parent 296776c commit 8eb4805

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

metsim/metsim.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,6 @@ def run_slice(self):
472472
for index, mask_val in np.ndenumerate(self.domain['mask'].values):
473473
if mask_val > 0:
474474
locs = {d: i for d, i in zip(self.domain['mask'].dims, index)}
475-
if self.params['prec_type'].upper() in ['TRIANGLE', 'MIX']:
476-
# add variables for triangle precipitation disgregation
477-
# method to parameters
478-
params['dur'], params['t_pk'] = (
479-
add_prec_tri_vars(self.domain.isel(**locs)))
480475
else:
481476
continue
482477

@@ -837,52 +832,3 @@ def __exit__(self, *args):
837832
@property
838833
def locked(self):
839834
return False
840-
841-
842-
def add_prec_tri_vars(domain):
843-
"""
844-
Check that variables for triangle precipitation method exist and have
845-
values that are within allowable ranges. Return these variables.
846-
847-
Parameters
848-
----------
849-
domain:
850-
Dataset of domain variables for given location.
851-
852-
Returns
853-
-------
854-
dur
855-
Array of climatological monthly storm durations. [minutes]
856-
t_pk
857-
Array of climatological monthly times to storm peaks. [minutes]
858-
"""
859-
# Check that variables exist
860-
try:
861-
dur = domain['dur']
862-
except Exception as e:
863-
raise e("Storm duration and time to peak values are "
864-
"required in the domain file for the triangle "
865-
"preciptation disagregation method.")
866-
try:
867-
t_pk = domain['t_pk']
868-
except Exception as e:
869-
raise e("Storm duration and time to peak values are "
870-
"required in the domain file for the triangle "
871-
"preciptation disagregation method.")
872-
873-
# Check that variable values are within allowable ranges.
874-
day_length = cnst.MIN_PER_HOUR * cnst.HOURS_PER_DAY
875-
dur_zero_test = dur <= 0
876-
dur_day_test = dur > day_length
877-
if dur_zero_test.any() or dur_day_test.any():
878-
raise ValueError('Storm duration must be greater than 0 and less than',
879-
day_length, '(i.e. the day length in minutes)')
880-
881-
t_pk_zero_test = t_pk < 0
882-
t_pk_day_test = t_pk > day_length
883-
if t_pk_zero_test.any() or t_pk_day_test.any():
884-
raise ValueError('Storm time to peak must be greater than or equal to '
885-
'0, and less than', day_length,
886-
'(i.e. the end of a day)')
887-
888-
return dur, t_pk

0 commit comments

Comments
 (0)