NCAR

 view release on metacpan or  search on metacpan

test/stex03.t  view on Meta::CPAN

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test;
BEGIN { plan tests => 1 };
use NCAR;
ok(1); # If we made it this far, we're ok.;

#########################

# Insert your test code below, the Test module is use()ed here so read
# its man page ( perldoc Test ) for help writing this test script.
unlink( 'gmeta' );

use PDL;
use NCAR::Test qw( bndary gendat drawcl );
use strict;
   
&NCAR::gopks( 6, 1 );
&NCAR::gopwk( 1, 2, 1 );
&NCAR::gacwk( 1 );
my $IDM;
#
# Example STEX03 draws a uniform southwesterly field on ten
# different EZMAP projections. A streamline representation overlays
# a rendering using vectors. Polar input mode is employed: all members
# of the U array, representing magnitude, are set to 1.0, while the
# V array contains the directional component, -135.0 degrees.
#
# All projections use the maximum possible extent of the globe, except
# except for frame 3, a Lambert Conical projection, for which a full
# globe projection is impossible.
#
#  
my ( $M, $N ) = ( 25, 25 );
my $A = zeroes float, $N, $M;
my $B = zeroes float, $N, $M;
my $WRK = zeroes float, $M*$N*2;
#
#     Generate the polar input mode component arrays.
#
for my $I ( 1 .. $M ) {
  for my $J ( 1 .. $N ) {
    set( $A, $J-1, $I-1, 1 );
    set( $B, $J-1, $I-1, -135 );
  }
}
#
# Set up a GKS color table
#
&DFCLRS();
#
# Do 10 different EZMAP projections, with Vectors and Streamlines
# superimposed
#
for my $I ( 1 .. 10 ) {
#
# Draw the map projections
#
  if( $I == 3 ) {
    &NCAR::supmap (3,0.,80.,70.,
                   float( [ 90., 0 ] ),
		   float( [ 80., 0 ] ),
		   float( [  0., 0 ] ),
		   float( [  0., 0 ] ),
		   2,20,4,0,my $IERS);
  } else {
    &NCAR::supmap ($I,0.,0.,0.,
                   float( [ 0., 0 ] ),
		   float( [ 0., 0 ] ),
		   float( [ 0., 0 ] ),
		   float( [ 0., 0 ] ),
		   1,20,2,0,my $IERS);
  }
#
# Set the Vectors coordinate parameters appropriately for a full
# globe polar input mode dataset projected using EZMAP
#
  &NCAR::vvseti('MAP -- Mapping Flag', 1);
  &NCAR::vvseti('SET -- Set Call Flag', 0);
  &NCAR::vvsetr('XC1 -- Lower X Bound', -180.0);
  &NCAR::vvsetr('XCM -- Upper X Bound', 180.0);
  &NCAR::vvsetr('YC1 -- Lower Y Bound', -90.0);
  &NCAR::vvsetr('YCN -- Upper Y Bound', 90.0);
  &NCAR::vvseti('PLR -- Vector Polar Flag', 1);



( run in 2.923 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )