Skip to content

Commit d12121f

Browse files
committed
Small bugfixes for matlab compatibility
1 parent fb06b81 commit d12121f

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

PyStemmusScope/forcing_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def prepare_global_variables(data, input_path, config):
149149
'reference_height', 'canopy_height', 'DELT', 'sitename']
150150
matfiledata = {key: data[key] for key in matfile_vars}
151151

152-
matfiledata['Dur_tot'] = total_duration
152+
matfiledata['Dur_tot'] = float(total_duration) # Matlab expects a 'double'
153153

154154
hdf5storage.savemat(input_path / 'forcing_globals.mat', matfiledata, appendmat=False)
155155

PyStemmusScope/variable_conversion.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ def kpa_to_hpa(pressure):
3333
Raises:
3434
ValueError if the input pressure is not in [kPa]
3535
"""
36-
if pressure.units == 'kPa':
37-
return pressure * 10
38-
raise ValueError('Input pressure is not in [kPa]')
36+
return pressure * 10
3937

4038

4139
def pa_to_hpa(pressure):

0 commit comments

Comments
 (0)