Hi Craig, As noted just now in a separate message, the identity function isn’t going away. There was a long-standing (see https://perlmonks.org/?node_id=683514 – from 2008) bug in PDL::Transform which was fixed on the git version in https://github.com/PDLPorters/pdl/commit/ab5b39bd51d1e6761e6dd2f482cbcc7c68ab368a but has not yet been released. Ingo is not seeing the bug because he is using PDL from git. Paul is almost certainly using a CPAN version from 2008 or later.
I will be releasing PDL very soon which ought to fix this. Best regards, Ed From: Craig DeForest<mailto:defor...@boulder.swri.edu> Sent: 19 October 2022 15:54 To: Paul Goodall<mailto:paul.thomas.good...@gmail.com> Cc: pdl-general@lists.sourceforge.net<mailto:pdl-general@lists.sourceforge.net> Subject: Re: [Pdl-general] PDL::Tranform issues Hi, Paul, This looks like a linking error. The t_linear constructor makes use of an identity matrix generator, which is (was?) exported into the loading module as part of PDL::MatrixOps (used to be part of the whole “use PDL” sequence). That occurs on or around line 2796 of transform.pd, and again a few lines later (line 2811 in my copy). It’s possible that with recent cleanup of the various libraries and export lists, “identity” is no longer being exported into the PDL::Transform::Linear package on load. A good way to fix that would be to make sure that PDL::Transform::Linear explicitly uses PDL::MatrixOps and explicitly asks for identity() to be exported. Cheers, Craig On Oct 18, 2022, at 9:09 PM, Paul Goodall <paul.thomas.good...@gmail.com<mailto:paul.thomas.good...@gmail.com>> wrote: Hi Ingo, With or without the curly braces - it's the same for me. Also - the error happens before the map stage, during the call to 't_linear'. I will write a simple Bilinear Interpolation myself, I would have just preferred to use the in-built capability in 'PDL::Transform'. --- pdl> use PDL::Transform; pdl> $im = rfits "m51.fits" Reading IMAGE data... BITPIX = -32 size = 262144 pixels Reading 1048576 bytes BSCALE = 1 && BZERO = 0 pdl> $tr = t_linear({rot=>30}); Undefined subroutine &PDL::Transform::Linear::identity called at transform.pd line 2729. pdl> $tr = t_linear(rot=>30); Undefined subroutine &PDL::Transform::Linear::identity called at transform.pd line 2729. --- cheers, Paul On 18 Oct 2022, at 10:05 am, Ingo Schmid <ingo...@gmx.at<mailto:ingo...@gmx.at>> wrote: Dear Paul, first, I think you do not need the curly { } around rot. Second, map needs $tr and $im. You can call it $tr->map($im) or $im->map($tr), as far as I know. With these changes, it works for me. use PDL; #use PDL::IO::; use PDL::Transform; use PDL::Graphics::Gnuplot; $im = rfits('/data/ingo/git/PDL/pdl-code/m51.fits'); $tr = t_linear({rot=>30}); print $Tr; $im1 = $tr->map($im); gplot {out=>'i1.png',term=>'png',},with=>'image',$im; gplot {out=>'i2.png',term=>'png',},with=>'image',$im1; Ingo On 10/18/22 07:52, Paul Goodall wrote: Hi perldl peeps, I'm trying to do something that should be really simple, but it seems I'm falling over at the first hurdle. I've replicated the error in it's simplest form from the example given in the docs as follows, and I've highlighted the offending line. ---- use PDL<https://metacpan.org/pod/PDL::Transform>; use PDL::IO::Image<https://metacpan.org/pod/PDL::Transform>; use PDL::Transform<https://metacpan.org/pod/PDL::Transform>; $im = rfits('m51.fits'); $tr = t_linear({rot=>30}); $im1 = $tr->map($tr); --- And I'm hit with this one: > Undefined subroutine &PDL::Transform::Linear::identity called at transform.pd > line 2729. I'm using PDL v2.080 on Ubuntu 20.04 (focal). This feels like it's something that has been solved a million times, but I can't seem to find the solution. Am I looking at the wrong Docs or doing something obviously silly? cheers, Paul _______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net<mailto:pdl-general@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/pdl-general _______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net<mailto:pdl-general@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/pdl-general _______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net<mailto:pdl-general@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/pdl-general
_______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general