<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hey all,</div>I have a weird question addressed to experts of both NCL and Python. <div class=""><br class=""></div><div class="">In my effort to speed up a NCL script which computes the Moist Static Energy of updraft points and of the environment in a LES model simulation of diurnal convection, I've tried to translate the entire script into Python. I was interested to see whether Python was faster than NCL: long story short, it's not :) The problem is that my data is really big (72 x 150 x 1280000 points) so that a single assignment a = file->var takes approx. 40 minutes. A single plot takes about 3 hours to be produced. And I'm using no single loop! :) </div><div class=""><br class=""></div><div class="">But let's come to the problem. I have to select updrafts, which I defined as grid points having a vertical velocity of at least 1 m/s and a cloud water content of at least 1E-4 kg/kg. For these points I want to construct a vertical profile of moist static energy. Thus, it seems to me that using the where function was going to be my best shot. This is what I tried to do to select the grid points:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class=""> w_cloud=where(qc.gt.th_qc .and. w.ge.1, mse, mse@_FillValue)</font></div><div class=""><font face="Menlo" class=""> w_envir=where(qc.le.th_qc .or. w.lt.1, mse, mse@_FillValue)</font></div></div><div class=""><br class=""></div><div class="">And then averaged over time and space to get a single vertical profile (I know that NCL will take care of the missing values using these operations). The result is not bad..</div><div class=""><br class=""></div><div class=""></div></body></html>