[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20030922: how to display loop of images in a webpage
- Subject: 20030922: how to display loop of images in a webpage
- Date: Fri, 26 Sep 2003 11:57:47 -0600
>From: sridhar duggireddy <address@hidden>
>Organization: USF
>Keywords: 200309221908.h8MJ8Yk1002673 McIDAS GIF web page display
Hi Sridhar,
I am sorry it took so long for me to get to your question, but this
week has been overly hectic.
>I have a small question. I am from University of South Florida and
>working under Dr. Arlene Laing.
My memory isn't that bad yet :-)
>I am trying to display loop of images using AniS.class java
>applet. I had written that applet code in my shell script. But it is not
>working.
Can you explain exactly what is not working? Also, can you remind me
of the URL for your web page (I seem to remember http://metlab.cas.usf.edu)?
Thanks.
>As u know my shell scripts are in cgi-bin file. When I tried to
>display the same applet in another html page which is not in this
>directory it is working. What might be the problem?
I will have to understand more of exactly what is not working before I can
respond.
>I am sending the code also. Please see it..
The way that the site mcdemo.unidata.ucar.edu uses the AniS.class applet
is:
-- index.html --
...
<h3>Imagery</h3>
<ul>
<li><a href=images/GETOPO.GIF>Latest GOES-East Infrared/Topography Composite
image</a>
<ul>
<li><a href=images/GEFRONT.GIF>Same image overlain with fronts</a>
<li><a href=getopoloop.html>Loop of GOES-East IR/Topography images</a>
(Javaapplet)
<li><a href=images/GE-IR.TXT>McIDAS BATCH file used to generate these
images </a><p>
</ul>
<li><a href=images/GOESWIR.GIF>Latest GOES-West Infrared/Topography Composite
image</a>
<ul>
<li><a href=images/GWFRONT.GIF>Same image overlain with fronts</a>
<li><a href=images/GW-IR.TXT>McIDAS BATCH file used to generate this
image</a><p>
</ul>
<li>GOES-East/West Composites
...
So, the page has a line that has a hyperlink to an html file that runs the
applet:
<li><a href=getopoloop.html>Loop of GOES-East IR/Topography images</a>
which points to another getopoloop.html, and it consists of:
<HTML>
<HEAD>
<TITLE> GOES-East IR/TOPO Composite Image Loop </TITLE>
</HEAD>
<BODY>
<CENTER>
<h2> GOES-East IR/TOPO Composite Image Loop </h2>
</CENTER>
<APPLET code="AniS.class" width=640 height=570>
<PARAM name="basename" value="images/getopo">
<PARAM name="controls" value="startstop, step, speed, refresh, toggle">
<PARAM name="num_frames" value="10">
<strong> You need a Java-enabled browser to view this applet </strong>
</APPLET>
</BODY>
</HTML>
The images from the loop that this applet is loading are all contained
in a subdirectory 'images/getopo'.
I think that you are attempting to do more-or-less the same thing in
your CGI script, but I know more if I looked at the results of the
CGI (so I need the URL).
>Thanks,
>Sridhar.
------------- regional_loop1.cgi -------------
#!/bin/sh
set -f
# This is the shell script used to generate the loop of Regional Images.
cd /usr/local/apps/php-apache/cgi-bin
CAT=/bin/cat
echo "Content-type:text/html"
echo "Pragma:no-cache"
echo ""
PATH=/bin:/usr/local/sbin:/sbin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/apps/php-apache/cgi-bin:.
export PATH
exec 2>> /dev/null
if [ -x $CAT ]; then
$CAT << BOT
<title> USF McIDAS Regional Images</title>
<body><br>
<center><img src="/sridhara/deptlogo1.gif"></center>
<a href="http://metlab.cas.usf.edu/sridhara/regional.php">Back</a>
<center><h2>Regional Images</h2></center>
BOT
# call another shell script here.
echo \<pre\>
/usr/local/apps/php-apache/cgi-bin/regional_loop1.csh $QUERY_STRING
echo \<pre\>
http://metlab.cas.usf.edu/sridhara/mcidas/gifs/applet.html
else
echo cannot find cat on this system.
exit
fi
$CAT << EOT
<center>
<APPLET archive="/sridhara/mcidas/gifs/aniscode.zip"
code="/sridhara/mcidas/gifs/AniS.class" width=500
height=500>
<PARAM name="controls" value="startstop,firstlast,speed,step,looprock">
<PARAM name="filenames"
value="reg_frame1.gif,reg_frame2.gif,reg_frame3.gif,reg_frame4.gif">
</APPLET>
<a href="/sridhara/mcidas/gifs/applet.html">Click
here to view the loop</a>
</center>
</pre>
</BODY>
EOT
------------- regional_loop1.cgi -------------
------------- regional_loop1.csh -------------
#!/bin/csh -f
#------------------------------------------------------------------------------
#
# Name: regional_loop.csh
#
# Purpose: This script generates satellite images of GINI satellite data
# using McIDAS
#
# Usage: regional_loop.csh args
#
#------------------------------------------------------------------------------
#
# Environment variables needed to run McIDAS
#
#echo Content-type:text/html
setenv WEBHOME /usr/local/apps/php-apache/htdocs
setenv HOME $WEBHOME/sridhara/mcidas
setenv MYDATA $HOME/data
setenv MYBIN $HOME/bin
setenv MYGIFS $HOME/gifs
setenv MCHOME /home/mcidas
setenv MCDATA $MCHOME/data
setenv MCHELP $MCHOME/help
setenv MCPATH ${MYDATA}:${MCDATA}:${MCHELP}
setenv MCBIN $MCHOME/bin
setenv MCTABLE_WRITE $MYDATA/MCTABLE.TXT
setenv MCTABLE_READ "$MCTABLE_WRITE;$MCDATA/ADDESITE.TXT"
cd $MYDATA
#
# Now, the PATH
#
setenv PATH
${MCBIN}:/usr/bin:/etc:/usr/sbin:/usr/ucb:/bin:/usr/X11R6/bin:/sbin:/usr/local/bin
#
# Protect our resources
#
limit cputime 30
#
# Split apart command line parameters
#
#echo $1 was passed to gen_mcidas_sat
#
# ADDE dataset group/descriptor
#
set type=`echo $1 | cut -f1 -d"&" | cut -f2 -d"=" | sed 's/%2F/\//'`
set test=`echo $type | grep WV`
if ( "$test" == "" ) then
set enh="EU=IMAGE"
else
set enh="EU=H20"
endif
set test=`echo $type | grep VIS`
if ( "$test" == "" ) then
set test=`echo $type | grep WV`
if ( "$test" == "" ) then
set str="SU=IRTEMP"
else
set str="SU=H20TEMP"
endif
else
set str="SU=X"
endif
# If the type is florida
if ( "$type" == "GINIEAST/GE1KVIS" ) then
set ident="STATION=TBW"
set mag="MAG=-2 -2"
set file="FILE=OUTLUSAM"
endif
#If the type is Continental US
if ( "$type" == "GINICOMP/GSN8KVIS" ) then
set ident="LINELE=600 850"
set mag="MAG=-1 -1"
set file="VH"
endif
#If the type is Caribbean visible
if ( "$type" == "RTIMAGES/GE-VIS" ) then
set ident="LINELE=820 830"
set mag="MAG=-1 -1"
set file="FILE=OUTLUSAM"
endif
#If the type is North America Visible
if ( "$type" == "NAGINICOMP/GSN8KVIS" ) then
set type="GINICOMP/GSN8KVIS"
set ident="LINELE=504 768"
set mag="MAG=-2 -2"
set file="FILE=OUTLHRES"
endif
set geom="480x640"
# call another shell script here.
mcenv -g 32 -i 128 -f 10 $MYBIN/regional_loop "$type.0" "$ident" "$mag" "$file"
$str > /dev/null
#
# server which file to load
#
# NB: the on-the-fly generated web page's HOME directory is
# /usr/local/apps/php-apache/htdocs
#
#echo "<center>"
#echo "<APPLET
#archive="/home/webadmin/htdocs/sridhara/mcidas/gifs/aniscode.zip"
#code="/home/webadmin/htdocs/sridhara/mcidas/gifs/AniS.class"
#codebase="/home/webadmin/htdocs/sridhara/mcidas/gifs/" width=500
#height=500>"
#echo "<PARAM name="controls" value="startstop,fitstlast">"
#echo "<PARAM name="filenames"
#value="reg_frame1.gif,reg_frame2.gif,reg_frame3.gif">"
#echo "</APPLET>"
#echo "</center>"
exit
------------- regional_loop1.csh -------------
Tom