#!/usr/local/bin/perl # PERL program to generate PostScript and GIF Hurricane maps. Runs IDL to # generate the maps and puts them in $RootPath directory (if it exists). # Copyright (C) 1996 Thomas R. Metcalf # # This software is provided "as is" and is subject to change without # notice. No warranty of any kind is made with regard to this software, # including, but not limited to, the implied warranties of # merchantability and fitness for a particular purpose. The author shall # not be liable for any errors or for direct, indirect, special, # incidental or consequential damages in connection with the furnishing, # performance, or use of this software: use it at your own risk. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # #setpriority(0,0,getpriority(0,0)+4); # nice the process $RootPath = "/data1/WWW/Tropical"; $DPath = "$RootPath/Data"; $TFile = "$RootPath/Data/tropical_all"; # CAREFUL! Gets overwritten!! $TMaps = "$RootPath/Bin/TMaps"; $rcp = "/usr/ucb/rcp"; $CAT = "/usr/bin/cat"; if (! -d "$RootPath") {die "$RootPath does not exist";} # directory exists? # Get names of data files to use for storm archives opendir(DATADIR,"$DPath"); #@stormfiles = grep(/^\w+\-\d\d$/,readdir(DATADIR)); @stormfiles = grep(/^tropical\d\d$/,readdir(DATADIR)); closedir(DATADIR); grep($_ = "$DPath/".$_,@stormfiles); # add root to file names @stormfiles = sort { -M $b <=> -M $a } @stormfiles; open(CFILE, ">$TFile") or die "Can't open $TFile"; foreach $sfile (@stormfiles) { open(SFILE, $sfile) or die "Can't open $sfile"; while () {printf CFILE $_;} close(SFILE); } close(CFILE); $ENV{'IDL_DEVICE'}='PS'; $ENV{'IDL_DIR'}='/usr/local/lib/idl'; $idlprogram = <<"IDLEND"; !path = ":/data1/WWW/Tropical/Bin/IDL:" + !path + ":/usr/local/lib/idl/lib:/usr/local/lib/idl/astron/pro:/solar/idl:" !quiet=0 set_plot,"z" retall ;loadct,13 ctrainbow tvlct,r,g,b,/get r(0)=0 & r(!d.table_size-1)=255 g(0)=0 & g(!d.table_size-1)=255 b(0)=0 & b(!d.table_size-1)=255 tvlct,r,g,b tropical,database=database,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/nep.all.gif",a,r,g,b tropical,database=database,/atlantic,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/atl.all.gif",a,r,g,b tropical,database=database,/nwpacific,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/nwp.all.gif",a,r,g,b tropical,database=database,/swpacific,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/swp.all.gif",a,r,g,b tropical,database=database,/sepacific,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/sep.all.gif",a,r,g,b tropical,database=database,/nindian,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/nin.all.gif",a,r,g,b tropical,database=database,/sindian,file="$TFile",mapdir="$TMaps",/noedge,/all,/nonames,/nodates retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/sin.all.gif",a,r,g,b tropical,/nogrid,/nodates,/world,database=database,file="$TFile",mapdir="$TMaps",xsize=885,ysize=350,/noedge,/all,/nonames retall a = tvrd() tvlct,r,g,b,/get write_gif,"$RootPath/Gif/wld.all.gif",a,r,g,b exit IDLEND system("/usr/bin/echo '$idlprogram' | /usr/local/lib/idl/bin/idl");