Skip to content

Commit

Permalink
fix to transform.pd (see Changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig DeForest committed Aug 14, 2006
1 parent ef6590b commit 2bcccd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CED 13-AUg-2006
- Minor fixes to Transform -- t_fits CI_J header notation;
also: dims copied between params and main object in
t_spherical and t_projective.
CHM 11-Aug-2006
- Added Astro::FITS::Header as a PREREQ_PM in main Makefile.PL
- Added to DEPENDENCY file list
Expand Down
9 changes: 6 additions & 3 deletions Lib/Transform/transform.pd
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ sub t_fits {

for my $h(@hgrab) {
$h =~ m/CP(\d{1,3})_(\d{1,3})/; # Should always match
$cpm->(($1),($2)) .= $hdr->{h};
$cpm->(($1-1),($2-1)) .= $hdr->{h};
}
print "PDL::Transform::FITS: Detected CPi_j matrix: \n",$cpm,"\n"
if($PDL::Transform::debug && @hgrab);
Expand Down Expand Up @@ -3293,7 +3293,7 @@ sub t_projective {
### Set options...


$me->{params}->{idim} = _opt($o,['d','dim','Dim']);
$me->{params}->{idim} = $me->{idim} = _opt($o,['d','dim','Dim']);

my $matrix;
if(defined ($matrix=_opt($o,['m','matrix','Matrix']))) {
Expand All @@ -3304,6 +3304,8 @@ sub t_projective {
$me->{params}->{idim} = $matrix->dim(0)-1
unless(defined($me->{params}->{idim}));

$me->{idim} = $me->{params}->{idim};

die "t_projective: matrix not compatible with given dimension (should be N+1xN+1)\n"
unless($me->{params}->{idim}==$matrix->dim(0)-1);

Expand Down Expand Up @@ -3343,7 +3345,8 @@ sub t_projective {

$me->{params}->{idim} = 2 unless defined $me->{params}->{idim};
$me->{params}->{odim} = $me->{params}->{idim};

$me->{idim} = $me->{params}->{idim};
$me->{odim} = $me->{params}->{odim};

$me->{func} = sub {
my($data,$o) = @_;
Expand Down

0 comments on commit 2bcccd0

Please sign in to comment.