Skip to content

Commit 0f1765b

Browse files
committed
Leave is_mjo out if it is not yet in file
1 parent 3a4ac46 commit 0f1765b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lpt/masks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,10 +1248,12 @@ def calc_individual_lpt_masks(dt_begin, dt_end, interval_hours, prod='trmm'
12481248
encoding = {
12491249
'nlpt': {'dtype': 'i'}, 'nstitch': {'dtype': 'i'},
12501250
'nobj': {'dtype': 'i'}, 'nobj_stitched': {'dtype': 'i'},
1251-
'num_objects': {'dtype': 'i'},
1252-
'is_mjo': {'dtype': 'bool'}, 'is_mjo_stitched': {'dtype': 'bool'},
1253-
'is_mjo_eprop_stitched': {'dtype': 'bool'},
1251+
'num_objects': {'dtype': 'i'}
12541252
}
1253+
if 'is_mjo' in ds2:
1254+
encoding['is_mjo'] = {'dtype': 'bool'}
1255+
encoding['is_mjo_stitched'] = {'dtype': 'bool'}
1256+
encoding['is_mjo_eprop_stitched'] = {'dtype': 'bool'}
12551257

12561258
lpt.lptio.replace_nc_file_with_dataset(lpt_systems_file, ds2, encoding)
12571259

0 commit comments

Comments
 (0)