[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #BWP-558582]: Testing for NaNs in formulas

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [IDV #BWP-558582]: Testing for NaNs in formulas
  • Date: Tue, 05 Feb 2013 16:02:15 -0700

> Hello IDV support,
> 
> While we use IDV for analyzing WRF output where there aren't any NaNs,
> we're also attempting to use it to analyze real-world data gathered during
> field campaigns. The real-world data has NaNs.
> 
> The 7.3.0 
> Formulas<http://www.unidata.ucar.edu/software/idv/docs/userguide/tools/Formulas.html>page
> has no information about handling NaNs. I know in theory what I need
> to do; according to the Using Python with
> VisAD<http://www.ssec.wisc.edu/~tomw/visadtutor/index.html>page on the
> VisAD site, if
> Double(x).isNan(): is the proper method to test for NaNs.
> 
> I've tried many combinations of formulas and Jython library code without
> success. Could you please provide an example of a simple IDV formula that
> accounts for NaNs?
> 
> Thanks.
> 

Hi Tod,
    If you want to call java function Dounble.isNaN inside your jython library, 
you need to add import java.math at the top of your library. Such as:

import java.math

def isNaN(a)
    return Double.isNaN(a)


Let us know if you have problem.


Yuan


    
> --
> Tod Hagan <address@hidden>
> 
> 251 Morse Hall
> Earth Systems Research Center
> Institute for the Study of Earth, Oceans, and Space
> University of New Hampshire
> 8 College Road
> Durham, NH 03824-3525
> 
> 


Ticket Details
===================
Ticket ID: BWP-558582
Department: Support IDV
Priority: Normal
Status: Closed