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

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

Reply via email to