logo       

Re: PDL::Transform->map: msg#00003

Subject: Re: PDL::Transform->map
On Wed, 2006-10-11 at 20:14 -0600, zowie wrote:
> On Oct 11, 2006, at 2:15 PM, Rahman Amanullah wrote:
> > Hello!
> >
> > I would imagine that the output PDL from this code ($o) would be
> > identical to the input ($i):
> >
> >     use PDL;
> >     use PDL::Transform;
> >     my $i = sequence(5,5) + sequence(5,5)->transpose;
> >     my $o = $i->map(t_identity, 
> > {pix=>1,phot=>'flux',method=>'sample'});
> 
> Drat, drat, drat -- it appears to be a half-pixel error in the pix=>1  
> code.  (if you use 'linear' as a method, you can see that the  
> sampling is happening at pixel intersections rather than centers).   
> I'll check-in a fix into the CVS soon.

Thanks! This seems to be working now!

> By the way, "phot=>'flux'" won't actually do anything unless you are  
> using the Gaussian or Hanning methods.  That's because flux  
> conservation works by measuring the determinant of the Jacobian of  
> the transformation, and only the Gaussian and Hanning methods bother  
> to find the Jacobian.

I am probably still misunderstanding something. I tried to do the
following:

  my $i = sequence(100,100) + sequence(100,100)->transpose;
  $i /= $i->sum;
  my $ts = t_linear(Scale=>1/10);
  my $o = $ts->map($i,{pix=>1,phot=>1,method=>'j'});
  print $i->sum, "\n";
  print $o->sum, "\n";

For "method=>'j'" and "method=>'g'" I get

  Use of uninitialized value in numeric lt (<)
at /usr/local/lib/perl5/site_perl/5.8.8/i686-linux/PDL/Core.pm line
1972, <DATA> line 387.
  Use of uninitialized value in subroutine entry
at /usr/local/lib/perl5/site_perl/5.8.8/i686-linux/PDL/Core.pm line
1974, <DATA> line 387.
  1
  1.57143060984982

A increase with 57%!!!

With "method=>'h'" I get a 22% increase. Perhaps the error message is
the reason for this?

I am using the latest CVS version of PDL.

-- 
__________________________________________________________
Rahman Amanullah,                         +46 8 553 786 61
Stockholm University                         ICQ: 62860758
Stockholm Centre for Physics,                    17d 50m E
Astronomy & Biotechnology                        59d 26m N

PGP/GPG key ID: 0x3C229C80


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe