Hi, Puneet,
BAD value marking is in-band. That means you have to specify one of the
possible values for your storage class that will be the BAD value. For
example, if you are storing unsigned bytes (PDL class "byte"), you could
make 255 the BAD value, with valid data points having values between 0
and
254. If that doesn't work for you, you must upgrade to a larger storage
class (e.g. ushort) so that you can make the BAD value be out of the
range
of valid values for your data (using the "badvalue" method).
One way to create your PDL full of BAD is:
$data = PDL->new_from_specification(byte, $size);
$data->badflag(1);
$data->badvalue(pdl(byte, 255));
$data .= 255;
On Jul 5, 2010, at 10:08 PM, P Kishor wrote:
> This is in support of an earlier question I had asked -- imagine I
> have a byte piddle $a with, say, 1000 elements. I don't have all the
> values yet that will go into the piddle -- I am going to get the
> values for different positions in the piddle at different times. So, I
> get $a->at(3) today, and $a->at(549) tomorrow and so on. All
> legitimate values fall between 0 and 255 inclusive, or could also be
> null values. How do I start putting together my piddle so that when I
> have all the values, I have a well-formed piddle with all the values
> in correct order?
>
> I could create a fake 1000 element piddle, and then, set the correct
> values when I get them. However, I can't create my fake piddle with
> any number between 0 and 255, nor can I use a null value. If I use a
> value above 255, or use something like -999, then it won't be a byte
> piddle.
>
> So, I thought, I could exploit BAD values. I could create a 1000
> element piddle filled with BAD values, and then, as I get the real
> values, turn those positions in the piddle on to the correct values.
>
> Is this a reasonable strategy? If yes, how do I create a byte piddle
> filled with BAD values? Do I use setbadat?
>
>
> --
> Puneet Kishor
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl