Skip to content

Commit 2db6254

Browse files
committed
Fill Nan
1 parent 4fc2815 commit 2db6254

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/access_mopper/configurations.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,14 @@ def cmorise(self, file_paths, compound_name, cmor_dataset_json, mip_table):
140140
cmor_axes.append(cmor_axis)
141141

142142
# Define CMOR variable
143-
cmorVar = cmor.variable(cmor_name, variable_units, cmor_axes, positive=positive)
143+
missing = 1e20
144+
cmorVar = cmor.variable(
145+
cmor_name,
146+
variable_units,
147+
cmor_axes,
148+
positive=positive,
149+
missing_value=missing
150+
)
144151

145152
# Write data to CMOR
146153
cmor.write(cmorVar, data, ntimes_passed=len(time_numeric))
@@ -266,7 +273,14 @@ def cmorise_ocean(self, file_paths, compound_name, cmor_dataset_json, mip_table)
266273
cmor_axes.append(cmor_axis)
267274

268275
# Define CMOR variable
269-
cmorVar = cmor.variable(cmor_name, variable_units, cmor_axes, positive=positive)
276+
missing = 1e20
277+
cmorVar = cmor.variable(
278+
cmor_name,
279+
variable_units,
280+
cmor_axes,
281+
positive=positive,
282+
missing_value=missing
283+
)
270284

271285
# Write data to CMOR
272286
data = np.moveaxis(data, 0, -1)
@@ -436,7 +450,7 @@ def cmorise(self, file_paths, compound_name, cmor_dataset_json, mip_table):
436450
data = np.transpose(data, (2, 3, 1, 0))
437451

438452
# Define CMOR variable
439-
missing = np.nan
453+
missing = 1e20
440454
cmorVar = cmor.variable(
441455
cmor_name,
442456
variable_units,

0 commit comments

Comments
 (0)