>From: weather <address@hidden> >Organization: NMSU/NSBF >Keywords: 199904230345.VAA06168 McIDAS scripts Robert, >I have been successful at producing a cgi script that will let you input >various choices and produce model images on the fly(for Alaska in this case). Cool. >It works fine, except I wanted to add the capability of placing a cursor >and marking it with text, because I would like to be able to do this with >balloon positions (i.e. pc.k E 31:47 95:32 za.k 5 7 C "bal"). I know >the first " is necessary for ZA, anf the shell is expecting the closing ". >I can live with the extra ". Actually, what you should do is to escape the quote. Try: pc.k E 31:47 95:32 za.k 5 7 C \"bal Escaping the quote will allow it to be passed to the command being executed. Closing the quote will stop the shell from complaining, but it will not do what you desire. >I cannot get the text to be written to the image. Here is the meat of the >script below(without the McIDAS environment stuff). When I run this same >script as a standard Bourne shell script with values for each variable, >the LAT/LON is shown correctly for PAFB in the text output and I get >za.k DONE, but there is nothing on the image other than the map and >contours. The reason you get no annotation is that the effective command that is being run is: za.k 5 7 C The annotation field is blank, so nothing gets written. It is unfortunate that ZA does not warn you that you havn't entered text to be used in the annotation, but that is what is going on. >I am sure I just don't >understand how McIDAS or X-window behaves outside of the McIDAS session, >but is there anyway to get this to work? Try escaping the quote and removing the trailing quote. >(Try not to laugh at my primitive shell programming attempts). I never would. You should see some of my beginning (and current) attempts at writing shell scripts :-( >You can run the script at: >http://wxmcidas.nsbf.nasa.gov/akmod.html( I have removed the redirect for >the text output) Please let me know if escaping the quote wasn't all that was needed in your script. >DATE=`date +%Y%j` >export DATE >if [ $WWW_dat = date ] >then > DAT=$DATE >else > if [ $WWW_dat = dat1 ] > then > DAT=`expr $DATE - 1` > fi >fi >export DAT >case "$WWW_prm" in > P) TIMES=0 > export TIMES;; > Z) TIMES=0 > export TIMES;; > T) TIMES=0 > export TIMES > UNIT=C > export UNIT;; > RH) TIMES=0 > export TIMES;; > WINDB) TIMES=0 > export TIMES > UNIT=KT > export UNIT;; > PCP) TIMES=0 > export TIMES;; > W) TIMES=1 > export TIMES; >esac >case "$WWW_drv" in > SPD) TIMES=0 > export TIMES > UNIT=KT > export UNIT;; > VOR) TIMES=5 > export TIMES; >esac > >MCPATH=$MCPATH PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH mcenv << 'EOF' >2>/dev /null 1>&2 >rm /var/http/demo/public/images/mod*.gif >grddisp.k RTGRIDS/$WWW_sat TIME=$WWW_mot PARAM=$WWW_prm DERIVE=$WWW_drv >LEV=$WWW_lev TDA=CAL CINT=$WWW_int DAY=$DAT FHOUR=$WWW_tim DASH=NEG >POWER=$TIMES UNIT=$UNIT >pc.k L PAFB >za.k 5 7 C "PAFB" >svgif.k 1 >/var/http/demo/public/images/mod$WWW_sat$WWW_mot$WWW_prm$WWW_drv$UNIT$WWW_lev$WWW_int$WWW_tim.gif > >EOF >/var/http/demo/cgi-bin/testmod > ># Done If you were putting up satellite imagery, I would recommend that you give the mcenv invocation a '-i n' flag so the imagery could have more ('n' number) than the default 48 colors. Other than that, I believe that if you simply change za.k 5 7 C "PAFB" to za.k 5 7 C \"PAFB you should be all set. I am looking at your other inquiry and will respond when I have something to report. Tom >From address@hidden Sun Apr 25 17:59:02 1999 Thanks Tom, It works now! Thanks for the tip on satellite imagery. I wondered why my images did not look as sharp as they should. My problem with doing satellite loops for Alaska of course is the fact that it is at the top of the image. I toyed with the idea of remapping all of the AREA files as they came in, but I decided I was too low on disk space to do that and everything else I wanted to do. So I decided to remap the images on request and build the loop. The ability to do RTIMAGES/GW-IR, GW-IR.-1, -2, etc is handy. It takes a little while to generate, but it is not too bad(should be faster on psnldm). Now I can add the capability of placing balloon position on the image via user input. That is pretty amazing.
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.