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

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

> 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.


> --
> 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

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.