<div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">This includes all time steps. But, in the file that I sent, I want to <b>count the number of gridpoints in each time step</b> with rainfall above 0. I have to include this in the time filter. Specifically, these two conditions: the area averaged rainfall is > 0 <b><i>and</i></b> at least 80% of the total gridpoints have rainfall > 0.</div><div dir="ltr"><br></div><div>Over the region I specified (rain_region), it has 40 x 30 x 10 (ntim x nlat x nlon).</div><div>The above command you gave results to 5830.</div><div>I can get a similar result by just doing this: <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Menlo;font-size:11px">a = num(rain_region.gt.0)</span></div>
<div dir="ltr"><div><br></div><div>Sincerely,</div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 10, 2019 at 12:02 AM Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com">rashidcomsis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Yes, there can be several ways of counting grid points with rainfall above 0:</div><div><br></div><div>e.g. say your variable name is "precp"</div><div><br></div><div>oneD = ndtooned(precip)</div><div><br></div><div> nVal = dimsizes(ind(oneD.gt.0))</div><div><br></div><div>nVal is the number of time precip is greater than 0. Does this makes sense, let me know if does not.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 9, 2019 at 11:36 AM Lyndz via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr" class="gmail-m_-4812331830161380845gmail-m_5494544575195008608gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear NCL experts, </div><div><br></div><div>I would like to filter the dates in a NetCDF file when the following conditions are met:</div><div>(a) Area averaged rainfall is greater than 0.</div><div><br></div><div>Area:</div><div> latS = 12.5</div> latN = 20.0<br> lonL = 120.0<br> lonR = 122.5</div><div dir="ltr"><br><div>(b) At least 80% of the grid points within the specified area satisfies (a).</div><div><br></div><div>Attached in this email is the script that I am currently working on.</div><div>The sample data can be accessed here:</div><div><a href="https://www.dropbox.com/s/spfnwb4rhwjo90o/aphro_1979_AMJ.nc?dl=0" target="_blank">https://www.dropbox.com/s/spfnwb4rhwjo90o/aphro_1979_AMJ.nc?dl=0</a><br></div><div><br></div><div><br></div><div><b>[Problem]</b></div><div>I was able to do the condition (a) but is there a way to count the number of grid points with rainfall above 0 over the specified region? How can I add this as another condition for the date filter?</div><div><br></div><div>The time filter is like this:</div><div><br></div><div> rain_threshold = 0<br> rain_aave=wgt_areaave_Wrap(rain_region,1.0,1.0,0)<br> printVarSummary(rain_aave)<br> n_thres = ind(rain_aave .gt. rain_threshold) ;time indices<br> print(n_thres)<br> print("=====")<br></div><div><br></div><div>I'll appreciate any guidance about this. </div><div><br></div><div>Sincerely,</div><div>Lyndz</div><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>