On Mon, Aug 30, 2010 at 2:39 PM, P Kishor <[email protected]> wrote:
> This is driving me nuts...
>
> print "Info for lut : " . $lu->info . "\n";
> print "Info for year: " . $yr->info . "\n";
> $ypdl->wpic("model_output/$file", {LUT => $lut});
>
> prints...
>
>
> Info for lut : PDL: Byte D [3,256]
> Info for year: PDL: Byte D [252,189]
> PDL::index: invalid index -2147483648 (valid range 0..255) at
> /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/PDL/ImageRGB.pm
> line 147.
>
>
> As far as I can see, $yr has nothing funky in it. I used Craig's
> bigstring method to print out the bighonkingpdl, and it is mostly a
> bunch of zeroes.
>


wpic of a piddle without lut works fine. Trying to make a wpic of the
same piddle with a lut gives me the following error

    PDL::index: invalid index -2147483648 (valid range 0..255) at
/usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/PDL/ImageRGB.pm
line 147.

So, I decided to debug it as below (print output is shown immediately
after my print statement) In my program

    print "In my program\n" . "=" x 50 . "\n";
    my $foo = $lut->xchg(0,1);
    print "Info for piddle foo: " . $foo->info . "\n";

    my $bar = $pdl->dummy(0);
    print "Info for piddle bar: " . $bar->info . "\n";

    my $res = index($foo, $bar);
    print "Info for piddle res: " . $res->info . "\n";

and in ImageRGB.pm

    print "In ImageRGB.pm\n" . "=" x 50 . "\n";
    my $foo = $lut->xchg(0,1);
    print "Info for piddle foo: " . $foo->info . "\n";

    my $bar = $pdl->dummy(0);
    print "Info for piddle bar: " . $bar->info . "\n";

    my $res = index($foo, $bar);
    print "Info for piddle res: " . $res->info . "\n";

I get the following output


In my program
==================================================
Info for piddle foo: PDL: Byte D [256,3]
Info for piddle bar: PDL: Byte D [1,252,189]
Info for piddle res: PDL: Byte D [3,252,189]
In ImageRGB.pm
==================================================
Info for piddle foo: PDL: Byte D [256,3]
Info for piddle bar: PDL: Byte D [1,252,189]
Can't call method "info" without a package or object reference at
/usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/PDL/ImageRGB.pm
line 153.


Exactly the same piddles behave differently when inside ImageRGB. So,
what is it that I am doing wrong?




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

Reply via email to