On Mon, Aug 30, 2010 at 9:24 AM, Douglas Burke <[email protected]> wrote: > On 8/27/10 10:46 AM, P Kishor wrote: >> So, can I instruct PDL to ignore cells with NaN, but not barf for >> other good cells? Note that I am already setting PDL to ignore BAD >> values (equal to -9999, in my case). >> > > Puneet, > > In case this hasn't already been answered, you can try setnantobad > > http://pdl.perl.org/PDLdocs/Bad.html#setnantobad > > This will replace Nan/Inf values with your bad value (so -9999 in this > case).
Oh, fantastic! We are fixing our model so it doesn't crap out NaNs, but the above is a sweet fix in the meantime. > > Note that there are two ways for PDL to treat bad values of > floating-point numbers, controlled by a compile-time flag. It can either > allow you to use an "in band" value (should be the default, and is > probably what you use, see the $PDL::Bad::UseNaN value), or it just uses > NaN/Inf as the bad value. > > See > > http://pdl.perl.org/PDLdocs/BadValues.html#handling_nan_values > > for some gory details. > > HTH, > Doug > > -- > > ------------------------------------------------------------------- > Doug Burke | http://hea-www.harvard.edu/~dburke/ > Harvard-Smithsonian | Email: [email protected] > Center for Astrophysics | Phone: (617) 496 7853 > 60 Garden Street MS-2 | Fax: (617) 495 7356 > Cambridge, MA 02138 | Office: B-440 > ------------------------------------------------------------------- > > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
