| 1 |
use strictscip-perl cpan PGPLOT 2.36 strict/; use warningsscip-perl cpan PGPLOT 2.36 warnings/; |
| 2 |
use Test::Morescip-perl cpan PGPLOT 2.36 Test/More/; |
| 3 |
use Configscip-perl cpan PGPLOT 2.36 Config/; |
| 4 |
# Stop f77-linking causing spurious undefined symbols (alpha) |
| 5 |
$ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{'PERL_DL_NONLAZY'}=0 if $Configscip-perl cpan PGPLOT 2.36 main/`%Config`.{'osname'} eq "dec_osf"; |
| 6 |
requirescip-perl cpan PGPLOT 2.36 main/require(). PGPLOT; |
| 7 |
|
| 8 |
my $dev = $ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{PGPLOT_DEV} || '/NULL'; |
| 9 |
|
| 10 |
$ENVscip-perl cpan PGPLOT 2.36 main/`%ENV`.{PGPLOT_XW_WIDTH}=0.3; |
| 11 |
|
| 12 |
notescip-perl cpan PGPLOT 2.36 main/note(). "Testing some new PGPLOT 5.2.0 routines"; |
| 13 |
|
| 14 |
PGPLOT::pgqinfscip-perl cpan PGPLOT 2.36 PGPLOT/pgqinf().("VERSION", my $val, my $len); |
| 15 |
# Accept real PGPLOT >= 5.2.0, or giza >= 1.3 (pgaxis/pgtick added in 1.3.1); |
| 16 |
# giza reports a version string like "giza-1.5.0" which is not numeric. |
| 17 |
my $new_enough; |
| 18 |
if ($val =~ /^giza-?v?(\d+)\.(\d+)/i) { |
| 19 |
$new_enough = ($1scip-perl cpan PGPLOT 2.36 main/$1. > 1 || ($1scip-perl cpan PGPLOT 2.36 main/$1. == 1 && $2scip-perl cpan PGPLOT 2.36 main/$2. >= 3)); |
| 20 |
} else { |
| 21 |
(my $numver = $val) =~ s/\.//g; $numver =~ s/v//; |
| 22 |
$new_enough = ($numver =~ /^\d+$/ && $numver >= 520); |
| 23 |
} |
| 24 |
|
| 25 |
# Read in image (int*2) |
| 26 |
|
| 27 |
my $img=""; |
| 28 |
openscip-perl cpan PGPLOT 2.36 main/open().(my $fh,"test.img") || diescip-perl cpan PGPLOT 2.36 main/die(). "Data file test.img not found"; |
| 29 |
if($^Oscip-perl cpan PGPLOT 2.36 main/`$^O`. =~ /mswin32/i) {binmodescip-perl cpan PGPLOT 2.36 main/binmode().($fh)} |
| 30 |
readscip-perl cpan PGPLOT 2.36 main/read().($fh, $img, 32768); |
| 31 |
closescip-perl cpan PGPLOT 2.36 main/close().($fh) or diescip-perl cpan PGPLOT 2.36 main/die(). "can't close test.img: $!"; |
| 32 |
|
| 33 |
notescip-perl cpan PGPLOT 2.36 main/note(). lengthscip-perl cpan PGPLOT 2.36 main/length().($img)," bytes read"; |
| 34 |
|
| 35 |
my @image = unpackscip-perl cpan PGPLOT 2.36 main/unpack().("n*",$img); |
| 36 |
|
| 37 |
note $#imagescip-perl cpan PGPLOT 2.36 main/`$#image`.+1," element image stored"; |
| 38 |
|
| 39 |
PGPLOT::pgbeginscip-perl cpan PGPLOT 2.36 PGPLOT/pgbegin().(0,$dev,1,1); |
| 40 |
|
| 41 |
notescip-perl cpan PGPLOT 2.36 main/note(). "Plotting"; |
| 42 |
|
| 43 |
PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(3); |
| 44 |
PGPLOT::pgwnadscip-perl cpan PGPLOT 2.36 PGPLOT/pgwnad().(12000,13000,13000,12000); |
| 45 |
|
| 46 |
my @tr=(12000,8,0,12000,0,8); |
| 47 |
PGPLOT::pglabelscip-perl cpan PGPLOT 2.36 PGPLOT/pglabel().("\\ga","\\gd","Galaxy"); |
| 48 |
PGPLOT::pgtboxscip-perl cpan PGPLOT 2.36 PGPLOT/pgtbox().("ZYHBCNST",0,0,"ZYDBCNST",0,0); |
| 49 |
|
| 50 |
PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(4); PGPLOT::pgconfscip-perl cpan PGPLOT 2.36 PGPLOT/pgconf().(\@image, 128, 128, 1,128,1,128, 1000,2000, \@tr); |
| 51 |
PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(2); PGPLOT::pgconfscip-perl cpan PGPLOT 2.36 PGPLOT/pgconf().(\@image, 128, 128, 1,128,1,128, 2000,3000, \@tr); |
| 52 |
|
| 53 |
my @cont = (-1,1000,2000,3000,4000,5000); |
| 54 |
PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(7); |
| 55 |
PGPLOT::pgconsscip-perl cpan PGPLOT 2.36 PGPLOT/pgcons().(\@image, 128, 128, 1,128,1,128, \@cont, 6, \@tr); |
| 56 |
|
| 57 |
PGPLOT::pgsciscip-perl cpan PGPLOT 2.36 PGPLOT/pgsci().(1); |
| 58 |
PGPLOT::pgaxisscip-perl cpan PGPLOT 2.36 PGPLOT/pgaxis().('LN2',12500,12800,12900,12100,1,4,0,0, 1,2,0.5, -2,30); |
| 59 |
|
| 60 |
PGPLOT::pgtickscip-perl cpan PGPLOT 2.36 PGPLOT/pgtick().(12500,12800,12900,12100, 0.35, 3,5, 6,90,'pgperl!'); |
| 61 |
|
| 62 |
PGPLOT::pgqndtscip-perl cpan PGPLOT 2.36 PGPLOT/pgqndt().(my $ndrivers); |
| 63 |
|
| 64 |
notescip-perl cpan PGPLOT 2.36 main/note(). "Testing pgqdt() - $ndrivers drivers found"; |
| 65 |
for my $n (1..$ndrivers) { |
| 66 |
PGPLOT::pgqdtscip-perl cpan PGPLOT 2.36 PGPLOT/pgqdt().($n,my $type,my $tlen,my $descr,my $dlen,my $inter); |
| 67 |
notescip-perl cpan PGPLOT 2.36 main/note(). "$n: $type $tlen $descr $dlen $inter"; |
| 68 |
} |
| 69 |
|
| 70 |
PGPLOT::pgendscip-perl cpan PGPLOT 2.36 PGPLOT/pgend().(); |
| 71 |
|
| 72 |
pass; |
| 73 |
done_testing; |