#! /bin/sh # $Id: js_secchi_png.cgi,v 1.8 2017/09/12 15:17:16 mcnutt Exp $ # # $Log: js_secchi_png.cgi,v $ # Revision 1.8 2017/09/12 15:17:16 mcnutt # added rdiff and star options # # Revision 1.7 2015/07/30 16:41:04 nathan # add year subdir # # Revision 1.6 2013/11/22 22:08:22 nathan # fix cor1-b tdir # # Revision 1.5 2012/08/24 16:41:46 nathan # Do not print input with error message # # Revision 1.4 2012/08/22 18:42:13 nathan # link fix # # Revision 1.3 2012/08/22 18:01:44 nathan # use png instead of jpeg; for COR2 use type db only # # Revision 1.2 2012/08/22 17:55:33 nathan # use one default EXT definition instead of defining for each tel # # Created: 03 Jan 2008 - D. Wang # 22may08, nbr - fixed cor2 directory links # # #if [ $# -lt 3 ]; then #echo "Purpose: Generate HTML with Javascript to show PNG images" #echo "Usage: $0 file_type tele speed frames yyyymmdd" #echo "Example: $0 512 COR2A 10 50 20071231 " #echo " " #echo "File_type: 1024 512 256 " #echo "tele: COR2A EUVIA171 EUVIA195 EUVIA284 EUVIA304 HI1A HI2A" #echo " COR2B EUVIB171 EUVIB195 EUVIB284 EUVIB304 HI1B HI2B" #echo "speed: 10" #echo "frames: 50" #echo "yyyymmdd: 20071231" #exit #fi echo "Content-type: text/html" echo #### Start Configure ##### # WWW root directory without a trailing slash wwwroot='/www/secchi-www' # Put the GIF directory here gifroot="$wwwroot/png" # Put the jumpURL here jumpURL=http://secchi.nrl.navy.mil EXT='.png' #### End Configure ##### #POST method SZ=2 MAX_FRAMES=50 SIZE=80 file_type=512 tele=COR2A observ=A speed=10 read form_arg #echo "Input arg: $form_arg" #echo tele=`echo $form_arg | cut -c6-9 | tr 'A-Z' 'a-z'` observ=`echo $form_arg | cut -c18 ` file_type=`echo $form_arg | cut -c30-32 | tr 'A-Z' 'a-z'` YYYYMMDD=`echo $form_arg | cut -c42-49 | tr 'A-Z' 'a-z'` YYYY=`echo $YYYYMMDD | cut -c1-4 | tr 'A-Z' 'a-z'` HHSTART=`echo $form_arg | cut -c59-60 | tr 'A-Z' 'a-z'` HHEND=`echo $form_arg | cut -c68-69 | tr 'A-Z' 'a-z'` HHSTART=`expr $HHSTART + 0` HHEND=`expr $HHEND + 0` #GET method #echo $tele $observ $imagesize $yyyymmdd #file_type=$1 #tele=$2 #speed=$3 #MAX_FRAMES=$4 #YYYYMMDD=$5 #echo "

$file_type $tele $observ $speed $MAX_FRAMES $YYYYMMDD $HHSTART $HHEND" case $file_type in '102') SZDIR='1024' SZ=2 ;; '512') SZDIR='512' SZ=1 MAX_FRAMES=72 ;; '256') SZDIR='256' MAX_FRAMES=144 speed=20 SZ=0 ;; esac tele=`echo $tele | tr '[a-z]' '[A-Z]'` # KB Edit to force upper-case if [ $observ = 'A' ] ; then case $tele in 'COR1') TYPE='SECCHI-A COR1' TDIR="a/cor1" TTS='c1A' EXT='.jpg';; 'C1RD') TYPE='SECCHI-A COR1_RDIF' TDIR="a/cor1_rdif" TTS='c1A' SZDIR='512';; 'COR2') TYPE='SECCHI-A COR2' TDIR="a/cor" TTS='dbc2A';; 'C2RD') TYPE='SECCHI-A COR2_RDIF' TDIR="a/cor2_rdif" TTS='rdDc2A' SZDIR='512';; 'C2TB') TYPE='SECCHI-A COR2_TBR' TDIR="a/cor2_tbr" TTS='tbc2A';; 'E195') TYPE='SECCHI-A EUVI 195A' TDIR='a/euvi' TTS='19euA';; '195R') TYPE='SECCHI-A EUVI 195A' TDIR='a/euvi_rdif' TTS='19rdeuA' SZDIR='512';; 'E284') TYPE='SECCHI-A EUVI 284A' TDIR='a/euvi' TTS='28euA';; 'E304') TYPE='SECCHI-A EUVI 304A' TDIR='a/euvi' TTS='30euA';; 'E171') TYPE='SECCHI-A EUVI 171A' TDIR='a/euvi' TTS='17euA';; 'HI-1') TYPE='SECCHI-A HI-1' TDIR='a/hi' TTS='h1A';; 'HI1S') TYPE='SECCHI-A HI-1 Stars' TDIR='a/hi_stars' TTS='h1A';; 'HI1R') TYPE='SECCHI-A HI-1 SREM' TDIR='a/hi_srem' TTS='SRh1A' SZDIR='512';; 'HI-2') TYPE='SECCHI-A HI-2' TDIR='a/hi' TTS='h2A';; 'HI2S') TYPE='SECCHI-A HI-2 Stars' TDIR='a/hi_stars' TTS='h2A';; 'HI2R') TYPE='SECCHI-A HI-2 SREM' TDIR='a/hi_srem' TTS='SRh2A' SZDIR='512';; esac else case $tele in 'COR1') TYPE='SECCHI-B COR1' TDIR="b/cor1" TTS='c1B' EXT='.jpg';; 'C1RD') TYPE='SECCHI-B COR1_RDIF' TDIR="b/cor1_rdif" TTS='c1B' SZDIR='512';; 'COR2') TYPE='SECCHI-B COR2' TDIR="b/cor" TTS='dbc2B';; 'C2RD') TYPE='SECCHI-B COR2_RDIF' TDIR="b/cor2_rdif" TTS='rdDc2B' SZDIR='512';; 'C2TB') TYPE='SECCHI-B COR2_TBR' TDIR="b/cor2_tbr" TTS='tbc2B';; 'E195') TYPE='SECCHI-B EUVI 195B' TDIR='b/euvi' TTS='19euB';; '195R') TYPE='SECCHI-B EUVI 195B' TDIR='b/euvi_rdif' TTS='19rdeuB' SZDIR='512';; 'E284') TYPE='SECCHI-B EUVI 284B' TDIR='b/euvi' TTS='28euB';; 'E304') TYPE='SECCHI-B EUVI 304B' TDIR='b/euvi' TTS='30euB';; 'E171') TYPE='SECCHI-B EUVI 171B' TDIR='b/euvi' TTS='17euB';; 'HI-1') TYPE='SECCHI-B HI-1' TDIR='b/hi' TTS='h1B';; 'HI1S') TYPE='SECCHI-B HI-1 Stars' TDIR='b/hi_stars' TTS='h1B';; 'HI1R') TYPE='SECCHI-B HI-1 SREM' TDIR='b/hi_srem' TTS='SRh1B' SZDIR='512';; 'HI-2') TYPE='SECCHI-B HI-2' TDIR='b/hi' TTS='h2B';; 'HI2S') TYPE='SECCHI-B HI-2 Stars' TDIR='b/hi_stars' TTS='h2B';; 'HI2R') TYPE='SECCHI-B HI-2 SREM' TDIR='b/hi_srem' TTS='SRh2B' SZDIR='512';; esac fi case $SZ in '0') WIDTH=256 ; HEIGHT=256 ; MULT=1 ;; '1') WIDTH=512 ; HEIGHT=512 ; MULT=4 ;; '2') WIDTH=1024 ; HEIGHT=1024; MULT=18 ;; esac #echo "

$file_type $tele $SIZE $DIR $MULT $TYPE $SZ $TDIR $EXT" #echo "

$gifroot/$TDIR/$YYYYMMDD/$SZDIR/*$EXT" HHRANGE=`expr $HHEND - $HHSTART` #echo "

HHRANGE=$HHRANGE" if [ $HHRANGE -le 0 ] ; then echo "

Error: Hour Range Incorrect - Start Hour $HHSTART must be before End Hour $HHEND

No directory found! Please check that the input date is in YYYYMMDD format.

There is nominally a two day delay from present for download and processing before images are available for the movie tool." echo "

See the SECCHI Image Gallery link for available dates" rm /tmp/$$slideshow exit fi #echo "

$HHCOUNT $HHCOUNTTEN $HHCOUNTONE" HHCOUNT=`expr $HHCOUNT + 1` done NUM=`cat /tmp/$$slideshow | wc -l` #echo "

NUM=$NUM" wait sleep 1 SKIPSOME=0 MANYIMG=1 NUMLOAD=`expr $NUM + 0` NUMORIG=`expr $NUM + 0` if [ $NUM -gt $MAX_FRAMES ] ; then MANYIMG=`expr $NUM / $MAX_FRAMES` fi if [ $MANYIMG -ge 2 ] ; then NUMLOAD=`expr $MANYIMG \* $MAX_FRAMES` NUM=$MAX_FRAMES fi #echo "

NUMORIG=$NUMORIG NUM=$NUM NUMLOAD=$NUMLOAD MAX_FRAMES=$MAX_FRAMES MANYIMG=$MANYIMG" if [ $NUM -eq 0 ] ; then echo "

No frames found! Please check that the input date is in YYYYMMDD format.

There is nominally a two day delay from present for download and processing before images are ready for the movie tool." echo "

See the SECCHI Image Gallery link for available dates." echo "

SECCHI images are available starting in March 2007" rm /tmp/$$slideshow exit fi if [ $NUM -gt 0 ]; then #echo $NUM $SIZE #TOTAL_SIZE=`expr $NUM \* $SIZE` #TOTAL_SIZE=`expr $TOTAL_SIZE \* $MULT` DATE=`/bin/date -u` echo "

$TYPE " echo "Showing $NUM of $NUMORIG frames" echo "

" echo "More SECCHI information:

" echo "SECCHI Javascript Movie Page" echo "SECCHI Home Page" echo "