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



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

Reply via email to