#!/usr/local/bin/perl # Update the IVM HTML documents to reflect the current images setpriority(0,0,getpriority(0,0)+6); # nice the process ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime; $year+=1900; ++$yday; ++$mon; if (length($mon) < 2) {$mon = "0".$mon;} if (length($mday) < 2) {$mday = "0".$mday;} if (length($hour) < 2) {$hour = "0".$hour;} if (length($min) < 2) {$min = "0".$min;} if (length($sec) < 2) {$sec = "0".$sec;} $now = "
$year-$mon-$mday $hour:$min:$sec UT
"; if (@ARGV < 1) {die "Please specify a directory @ARGV ... dies at";} $RootPath = "$ENV{'WEB_ROOT'}/IVM/".$ARGV[0]; $WWWRoot = "/IVM/".$ARGV[0]; if (! -d "$RootPath") {print STDERR "$RootPath does not exist"; exit;} # directory exists? # Read directory opendir(GIFDIR,"$RootPath"); # Read directory @giffiles = grep(/(ivm\.gif)$/i,readdir(GIFDIR)); closedir(GIFDIR); if (@giffiles >= 1) { grep($_ = "$WWWRoot/".$_,@giffiles); # Add root to file names grep($_ = substr($_,0,length($_)-4),@giffiles); # Get rid of the .gif } # Sort the list of gif files by file name sub by_file_name { (reverse(split(m|/|,$a)))[0] cmp (reverse(split(m|/|,$b)))[0]; } @giffiles = sort by_file_name @giffiles; # Set HTML Header and Footer $html_header = <<"HEADER_END"; Imaging Vector Magnetograph: $ARGV[0] HEADER_END $html_legend = <<"LEGEND_END"; During the Max Millenium Observing Campaign #6, the IVM is doing imaging polarimetry in H alpha. These plots are the intensity of the brightest pixel in the field, normalized in some way against the continuum brightness. The intensity scale has little meaning, and the plots probably shouldn't be intercompared, but they do show which flares were observed by the IVM. LEGEND_END $html_footer = <<"FOOTER_END";
Home Back

webmaster\@kukui.ifa.hawaii.edu

Last Update: $now FOOTER_END # Generate the HTML file print "$html_header\n"; if (@giffiles < 1) { # No gif files in the directory print "

No Data $ARGV[0]

\n\n"; } else { print "

IVM Magnetograms from $ARGV[0]

\n"; print "$html_legend\n"; print "
\n"; print "\n"; $column = 0; foreach $file (@giffiles) { if ($column == 0) { print "\n"; } @file_path = split(m|/|,$file); print "\n"; if (++$column >= 3) { $column = 0; print "\n"; } } if ($column != 0) { print "\n"; } print "
\"\"\n"; print "
$file_path[$#file_path]
\n\n"; } print "$html_footer\n"; exit;