<div dir="ltr">Before doing the division, you need to use the where function to set 0 values to a fill values.  Then, they will be ignored.<div><br></div><div>For example,</div><div><br></div><div><p style="color:rgb(0,0,0);font-family:Times;font-size:medium">Perhaps you want to set psi to _FillValue wherever it is equal to 0 before you do the calculation:<br></p><p style="color:rgb(0,0,0);font-family:Times;font-size:medium">  psi = where(psi.ne.0,psi,psi@_FillValue), <br></p>Then</div><div><br></div><div>Y = X/psi should work.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 5, 2019 at 12:21 PM Karin Meier-Fleischer via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">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 bgcolor="#FFFFFF">
    Hi Atul,<br>
    <br>
    do you want to calculate the avg and the stddev on the longitude
    coordinate? The functions dim_avg and dim_stddev do the calculations
    on the right- most dimension. If you want to do it on the time
    dimension then you should use dim_avg_n and dim_stddev_n functions.<br>
    <br>
    To prevent division by 0 you can use the where function. Searching
    the internet will give you some ncl-talk answers to this issue.<br>
    <br>
    -Karin<br>
    <br>
    <br>
    <div>Am 05.12.19 um 10:51 schrieb Atul Saini
      via ncl-talk:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div><font size="4">Hi NCL,</font></div>
        <div><font size="4">              I am trying to plot the map
            showing calculate gridwise coefficient of variation but it
            is not getting plotted and one error is Division by 0, Can't
            continue. Please help!</font><br>
        </div>
        <div>
          <div>
            <div dir="ltr">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr">
                                    <div>
                                      <div dir="ltr">
                                        <div>
                                          <div dir="ltr">
                                            <div>
                                              <div dir="ltr">
                                                <div>
                                                  <div dir="ltr">
                                                    <div>
                                                      <div dir="ltr">
                                                        <div>
                                                          <div><font size="4"><br>
                                                          </font></div>
                                                          <div><font size="4">Please
                                                          find the
                                                          script file
                                                          and data file
                                                          attached.</font></div>
                                                          <div><font size="4">Please
                                                          help, it's
                                                          urgent.<br>
                                                          </font></div>
                                                          <div><font size="4"><br>
                                                          </font></div>
                                                          <div><font size="4">Regards,</font></div>
                                                          <div><br>
                                                          </div>
                                                          <div><img src="https://docs.google.com/uc?export=download&id=1flpEpH50fxgPRxFvuyiLu2A70K0UoFx-&revid=0Byj9ykpbAx3od3R4N016WWh0MnlGQ1JHUTg4Nk5HVmVMS2ZNPQ" width="304" height="116"><br>
                                                          </div>
                                                          <div>                          
                                                          <br>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
ncl-talk mailing list
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></pre>
    </blockquote>
    <br>
  </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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Associate Scientist, Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>