#!/afs/isis/pkg/isis/bin/perl # Last modified: Time-stamp: <2005-01-13 17:20:28 lstearns> # # script to run matlab in an automater mode to maintain # processed data files. # #---------------------------------------------------------------------- #HEY TEMPORARILY CHANGED MATLAB PATH #-LPS 2005.01.13 # if debugging requested print messages to STDOUT if (grep /[debug|DEBUG|d]/, @ARGV) { $debug = 1; } # set the group system("newgrp seacoos"); # date/time manipulation library # use lib "/scratch/sabsoon/lib/site_perl"; use lib "/opt/local/seacoos/lib/site_perl"; use Net::FTP; # date/time manipulation library use Date::Manip; # print Date and Time and version of perl + patchlevel /1000 $now=&UnixDate(&ParseDate("today"), "%Y:%m:%d %H:%M:%S"); if ($debug) { print "\n==== Starting: $now ==== Perl Version: $]\n"; } $logs = "/opt/local/seacoos/log"; $matl = "/opt/local/seacoos/matlab"; #---------------------------------------------------------------------- #$bp = "/afs/isis/pkg/matlab/bin/"; $bp = "/afs/isis/pkg/matlab-65R13SP/bin/"; #---------------------------------------------------------------------- # get current directory $cwd = `pwd`; # start stop-watch for cummulative times $starttime = time; chdir "$matl/proc2latest"; # %ENV is a hash (associative array) containg environment variables. # set environment variable MATUSER for use with MATLAB startup.m file $ENV{MATUSER} = "none"; if ($debug) { print "MATUSER should be set to $ENV{MATUSER}\n"; } # set environment variable DISPLAY for use with MATLAB under script in tcsh $ENV{DISPLAY} = "nemo.isis.unc.edu:0.0"; if ($debug) { print "DISPLAY should be set to $ENV{DISPLAY}\n"; } # matlab license file accesses license on sonoma at NCSC # $ENV{LM_LICENSE_FILE} = "1715\@sonoma.ncsc.org"; # process raw data, be sure to include -nojvm for MATLAB v6.1 system("$bp/matlab -nojvm -nosplash < $matl/proc2latest/run_proc2latest.m >> $logs/mat_proc2latest.log") && die "run_proc2latest failed"; # return to original directory on local computer chdir "$cwd"; # stop stop-watch $cummtime = time - $starttime; if ($debug) { print "Total script time = $cummtime (seconds).\n"; }