Skip to content

Commit 82db169

Browse files
committed
get rid of numpy warning
1 parent c0fcb9f commit 82db169

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

python/extpar_emiss_to_buffer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,10 @@
201201
emiss_mrat = np.empty((12, ke_tot, je_tot, ie_tot), dtype=mrat_meta.type)
202202

203203
for t in np.arange(12):
204-
emiss_mrat[t, :, :, :] = np.divide(emiss[t, :, :, :],
205-
emiss_max[:, :, :],
206-
where=emiss_max[:, :, :] != 0.0)
204+
np.divide(emiss[t, :, :, :],
205+
emiss_max[:, :, :],
206+
out=emiss_mrat[t, :, :, :],
207+
where=emiss_max[:, :, :] != 0.0)
207208
emiss_mrat[t, :, :, :] = np.where(emiss_max[:, :, :] <= 0.0, -1.0,
208209
emiss_mrat[t, :, :, :])
209210

python/extpar_ndvi_to_buffer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,10 @@
173173
ndvi_mrat = np.empty((12, ke_tot, je_tot, ie_tot), dtype=mrat_meta.type)
174174

175175
for t in np.arange(12):
176-
ndvi_mrat[t, :, :, :] = np.divide(ndvi[t, :, :, :],
177-
ndvi_max[:, :, :],
178-
where=ndvi_max[:, :, :] != 0.0)
176+
np.divide(ndvi[t, :, :, :],
177+
ndvi_max[:, :, :],
178+
out=ndvi_mrat[t, :, :, :],
179+
where=ndvi_max[:, :, :] != 0.0)
179180
ndvi_mrat[t, :, :, :] = np.where(ndvi_max[:, :, :] <= 0.0, -1.0,
180181
ndvi_mrat[t, :, :, :])
181182

0 commit comments

Comments
 (0)