Hi all,

I'm a PDL novice interested in processing instrument data which has
several codes for bad data. Since it seems that there can only be a
single bad data value, I can do this:

        my $work = $original->copy;
        
        for my $bv ( -9999, -8888, -7777 )
        {
            $work->inplace->setvaltobad($bv);
        }
        
        # process $work PDL, ignoring bad values

After processing I need to restore the values marked as BAD before
writing output. Using the above example, how can I copy from the
$original PDL the values corresponding to the BADs in the $work PDL? Of
course I could do it in a loop, but is there a PDL function like

        merge($a, $b, mask)
        Signature: (a(); b(); mask(); int [o]c())
        
        Copies values from $b if $mask is true, otherwise copies from
        $a.

Thanks.

Tod

-- 
Tod Hagan
Information Technologist
AIRMAP/Climate Change Research Center
Institute for the Study of Earth, Oceans, and Space
University of New Hampshire
Durham, NH 03824
Phone: 603-862-3116



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to