[Thread Prev][Thread Next][Index]

stereographic plots ?


We put up a LAS-server and wanted to produce maps also in polar stereographic projection. So I added stereo-operation in the custom.pl file (please see the end of this message). The operation works all right, but loses much of the flexibility of the normal draw operation, like plot modification.

I guess there's probably a much better way to do this, but since I am not familiar with e.g. Ferret scripts can't see it right away. Is there e.g. a Ferret template that could do this ? Or more convenient perl-methods ?

Our site is at http://hamish.cims.nyu.edu/las/ . Thanks.


# Custom Perl include file
# Add your Perl customizations here
package LAS::Server;
add_mime('stereo','image/gif');    #Add a new mime type for 'test' op

package LAS::Server::Ferret;

sub stereo {
    my $self = shift;
    my $props = $self->{props};
    my $size = $props->{size} ? $props->{size} : "0.5";
    my $aspect = $self->aspectRatio;
    my $var = $props->{variable_name};
    my $dataset = $props->{dataset_name};
    my $view = $props->{view};
    if ( $view =~ /xy/ ) {

	my $time = $props->{jnl_t}->[0];
	my $level = $props->{jnl_z}->[0];
	my @vars = @{$self->{vars}};
	my $longname = $vars[0]->getLongName;
	$self->command("set win/asp=$aspect");
	$self->command(qq{SET grid $var});
	$self->command("GO mp_stereographic_north 25 90"); 
	$self->command("GO mp_aspect"); 
	$self->command(qq{FILL/NOAXES/NOLAB $var, x_page, y_page});
	$self->command("GO mp_land"); 
	$self->command("GO mp_graticule"); 
        $self->command(qq{LABEL/NOUSER 3.7 7.6 0 0 0.15 $dataset,});
	$self->command(qq{LABEL/NOUSER 3.7 7.1 0 0 0.15 $longname, $time, z=$level});
    } else {
	die "Polar plot works only for xy-data."
    # Generate the image


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement