#! /opt/local/bin/perl -P ;# Usage: lrefl [yymmddhh] [elev_index] ;# where yymmddhh is given in UT and elev_index ranges from 1 to 4 ;# #include "/home/disk/stormy/marka/nexrad/chmin.pl" #include "/home/disk/stormy/marka/nexrad/expmin.pl" if( ($pos = rindex($0, "/")) >= $[ ) { $command = substr($0, $pos+1); } else { $command = $0; } $radar = "ATX"; for( $i=0; $i <= $#ARGV; $i++ ) { if( $ARGV[$i] =~ /RTX|P/i ) { $radar = "RTX"; splice( @ARGV, $i, 1 ); last; } } if ( $command =~ /lrefl/ ) { $type = "BREF"; } elsif( $command =~ /lbref/ ) { $type = "BREF"; } elsif( $command =~ /test.pl/ ) { $type = "BREF"; } elsif( $command =~ /lvelo/ ) { $type = "VEL"; } elsif( $command =~ /lvel/ ) { $type = "VEL"; } elsif( $command =~ /lcref/ ) { $type = "CREF"; } elsif( $command =~ /llref/ ) { $type = "LREF"; } elsif( $command =~ /lpre1/ ) { $type = "PRE1"; } elsif( $command =~ /lpre3/ ) { $type = "PRE3"; } elsif( $command =~ /lpret/ ) { $type = "PRET"; } elsif( $command =~ /ltops/ ) { $type = "TOPS"; } elsif( $command =~ /lvil/ ) { $type = "VIL"; } if( $ARGV[0] =~ m/-[hH]/ ) { system( "cat /home/disk/stormy/marka/nexrad/radar.help | more" ); exit 0; } $duration = 120; # Default value $timestep = 1; # Default value if( $ARGV[0] eq "-d" ) { $ARGV[1] =~ m#([\d\.]+)/?([\d\.]*)#; $duration = $1 * 60; $timestep = $2 * 60; shift; shift; } if( $ARGV[0] =~ m/^[xX]$/ ) { $ARGV[0] = ""; } $ARGV[0] =~ m#([^/]*)/?([^/]*)/?([^/]*)#; $end = $1; if( $2 ) { $duration = $2 * 60; } if( $3 ) { $timestep = $3 * 60; } $duration =~ s/\.\d*$//; $timestep =~ s/\.\d*$//; if( $timestep <= 10 ) { $timestep = 1; } else { $timestep -= 5; } if( $type =~ /BREF|VEL|LREF/ ) { if( $#ARGV < 1 ) { # Elevation_index not specified on command line if( -e "$ENV{'HOME'}/.camano_radar" ) { open( RES, "<$ENV{'HOME'}/.camano_radar" ); while( ) { if( m#elevation_index.*:\s*([\.\d]+)# ) { $elev = $1; } } close RES; } } elsif( $ARGV[1] =~ /[1234]/ ) { $elev = $ARGV[1]; } if( !$elev ) { $elev = 1; } } else { # elevation_index undefined for remainder of commands $elev = ""; } $dir = "/usr/local/ldm/images/nexrad/$radar/$type$elev"; $end = &expandtime_min( $end, "0." ); # $end is ending time of radar loop $begin = &changetime_min( $end, -1 * $duration ); # print "$duration---$timestep\n$begin--$end\n"; for( $time=$end; $time>$begin; ) { if( -e "$dir/$time.gif" ) { $looptimes = "$dir/$time.gif " . $looptimes; $time = &changetime_min( $time, -1 * $timestep ); } else { $time = &changetime_min( $time, -1 ); } } # print "$looptimes\n\n"; exit 0; if( $looptimes =~ m#^([/\w\.]+) (([/\w\.]+ )+)([/\w\.]+) $# ) { $time_first = $1; $looptimes = $2; $time_last = $4; # system( "xloop -nsc -pause 1.5 -in $times" ); system("xanim -geom +100+100 +Ca +Sr +j2000 $time_first +j100 $looptimes +j2000 $time_last 2>/dev/null"); # system("xanim +Ca +SS1.5 +j2000 $time_first +j100 $looptimes +j2000 $time_last"); } else { print "Insufficient images available to loop.\n"; } exit 0;