Hi,

I am having trouble using t_lookup in combination with map to transform
images.  I have a lookup table that describes the geometric distortions
of my astronomical images, and I wish to correct for it.

Here is a very simplified example of what I am trying to do:

  # Create image
  #
  my $image = sequence(128,128);

  # Create mock look-up table for a
  # simple shift
  #
  my $tx = my $ty = sequence(9) * 16;
  $tx = $tx->dummy(1,9) + 30;          # shift in x
  $ty = $ty->dummy(0,9) + 50;          # shift in y

  my $t = t_lookup(cat($tx,$ty),{scale=>8/128});

  # Try simple transformation
  #
  print $t->apply(pdl([[0,0],[10,40],[127,127]]));

This gives the expected output:

[
 [ 30  50]
 [ 40  90]
 [157 177]
]

However, when I try

  my $ii = $t->map($i,{pix=>1,flux=>1,method=>'linear'});

I can not make any sense of the output at all.  What am I missing here?
Could someone try this code out and see if you succeed?

Cheers,

  Rahman



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

Reply via email to