[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20030619: Contouring point data + image enhancement



>From: "Kwan-yin Kong" <address@hidden>
>Organization: CCNY
>Keywords: 200306171633.h5HGXmLd000512 McIDAS DSSERVE 

Kwan-yin,

re: command running in McIDAS command mode but not in Unix shell

>      I see.  It's the escape character again.  Thanks.


>      About the contouring issue that I brought up 
>yesterday: what I've learned earlier is that I need to 
>modify the keyword to LLINC=.1 .1 in the PTCON command in 
>order to produce satisfactorily accurate surface isotherms 
>(I am focusing on the New York area in a less than 
>3-degree-latitude rectangle).

It turns out that you can use the LLINC= keyword with SFCCON also.
There are a number of keywords that SFCCON supports that are not
explictly called out in the online or User Guide documentation.  I am
not sure why this is the case.  Just in case you didn't know, SFCCON is
simply an interface that is designed to make running PTCON easier.
SFCCON simply runs PTCON with enough input to make things simple.

>By the way, is there a 
>keyword that allow you to increase the thickness of 
>contour lines?

There is no keyword that will change the line thickness, but there is a
command that you can run to set the value.  Run GD before your command
AND after your command to set the contour lines to what you want and
then back again.  GD changes the system defaults until they are reset
by another GD invocation or by someone fiddling with the User Common
values where the values are stored.

>      Today, I find that the image enhancement script that 
>I have been running is running strangely.  In the UNIX 
>script, I have a sequence of EU MAKE commands to enhance a 
>displayed IR image.  But now, only the last EU MAKE 
>actually executes.  The prior ones apparently does 
>nothing.

If this was running correctly before and is now not running correctly,
I would think that some system resource has been used to near
depletion.  The first thing I would check the list of shared memory
segments being used on the machine.  If there are a LOT of ones
still allocated for processes that have ended, they need to be
cleaned up.  I think we have been over the shared memory segment issue
before, so I won't talk too much about it other than to say that you
use the 'ipcs' command to list shared memory segments in use and 'ipcrm'
to remove shared memory segments.  In addition, you may have to remove
the ~/.mctmp subdirectories that would have been created by McIDAS
when the shared memory segments were first allocated.

>Before this happened I have saved the 
>enhancement into IR-KONG1.ET.  The strange thing is if I 
>do a EU REST IR-KONG1, it enhances the image correctly. 

So, why not simply create the enhancement you want to use and
use it in the IMGDISP invocation or use EU REST to restore it
to the frame with the image?  This would be a lot quicker.

> But if I let the script re-do the EU sequence, I get a 
>gray scale similar to EU=IMAGE.ET but only the last EU 
>MAKE makes the enhancement.  I am sending you the entire 
>script below.

Again, if the script was working and is now not working AND you
didn't change anything, then I would suspect a system resource depletion.

The only comment I would make about your script is a recommendation
to not begin numbers with a '0' as some shells might interpret the
numbers to be octal instead of decimal.  For instance,

change:

   eu.k MAKE 000 138 040 250 040 250 040 250

to:

   eu.k MAKE 000 138 40 250 40 250 40 250

Changing 000 to 0 will do nothing since an octal 0 is the same as a
decimal and hexidecimal 0.

>#!/bin/sh
>#  Purpose:
>#  (1)Display GOES-8 IR image centered at a specified 
>lat/lon 
>#  for a particular date and a range of hours.  Then save
>#  them as GIF files with the date and time stamps as 
>#  filenames.  (2)Overlaid fronts, isobars, and surface
>#  wind vectors onto the images and save the composite
>#  as another GIF file.  See 'Script invocation' below.
>#
>if [ -z "$8" ] || [ "$3" -gt "$4" ] then
>   if [ "$3" -gt "$4" ]
>     then echo "SCRIPT TERMINATED: (start hour) > (end hour)"
>   fi
>   echo 'Script invocation:'
>   echo
>   echo 'savimage+ _ _ _ _ _ _ _ _ _'
>   echo '          | | | | | | | | |   the dataset name for point data (e.g. 
> METAR)'
>   echo '          | | | | | | | | --> Enter nothing for default datasets 
> (which are'
>   echo '          | | | | | | | |     RTPTSRC/SFCHOURLY and RTPTSRC/SHIPBUOY)'
>   echo '          | | | | | | | --> set dimension of image, e.g."800x1120"'
>   echo '          | | | | | | ----> longitude (W is positive)'
>   echo '          | | | | | ------> latitude (N is positive)'
>   echo '          | | | | -----> A string attached to the front of GIF 
> filename'
>   echo '          | | | -------> end hour'
>   echo '          | | ---------> start hour'
>   echo '          | -----------> enter the date in the format YY/MM/DD'
>   echo '          -------------> name of ADDE image dataset (RTIMAGES/GE-IR)'
>   echo
>   echo 'GIF files are saved with the following filenames.'
>   echo '-> For image set (1), ${PF}yyyymmdd-hh.GIF'
>   echo '-> For image set (2), ${PF}SFCyyyymmdd-hh.GIF'
>   echo 'where ${PF} is the prefix string given by the sixth user input.'
>   echo
>   echo 'Suggested input entries for saving the Sub-tropical Atlantic section'
>   echo 'on 13 MAY 2003 from 00Z to 23Z:'
>   echo
>   echo '   savimage+ RTIMAGES/GE-IR 03/05/13 0 23 ${DIR}IRatl 25 60 1000x1200'
>   echo
>   echo 'where ${DIR} is the directory in which the GIF is to be saved.'
>exit 0
>fi
>
>PTDAT=$9
># set the default surface and bouy dataset names to
># RTPTSRC/SFCHOURLY and RTPTSRC/SHIPBUOY if the ninth 
>entry is empty
>if [ -z "$PTDAT" ]
>then
>   PTDAT="RTPTSRC/SFCHOURLY RTPTSRC/SHIPBUOY"
>fi
>
># umask
>umask 002
>
># Storing input variables
>DS=$1 
>DD=$2 
>BH=$3
>EH=$4
>PF=$5
>LA=$6
>LO=$7
>DIM=$8
>
># The following is a loop set up to run a series of McIDAS commands.
># to display images and surface data from the beginning hour $BH
># through the ending hour $EH.  The advance frequency is one hour.
># Variable $H is an index used for advancing the time hourly.
># (1)Display image at the specified date and time;
># (2)Draw a medium resolution map on top;
># (3)Save this image as a GIF file (IRyyyymmdd-hhZ.GIF);
># (4)Draw fronts on the image;
># (5)Draw sea-level isobars on top;
># (6)Plot wind vectors on top;
># (7)Then save this image as another GIF file (IRSFCyyyymmdd-hhZ.GIF).
>
>echo $EH | bc > eh.txt; read EH < eh.txt; rm -f eh.txt
>echo $BH | bc > bh.txt; read H < bh.txt; rm -f bh.txt
>#pwd > pwd.txt; read DIR < pwd.txt; rm -f pwd.txt
>
>while [ $H -le $EH ] ; do
># Exporting input variables for use in mcenv
>export YY MM DD H PF LA LO
>echo; echo "======Begin processing "$H"Z image and data on 
>$DD======"
>mcenv -f $DIM -i 84 << EOF
>   imgdisp.k $DS 1 LAT=$LA $LO DAY=$DD TIM=$H:00 $H:16
>   eu.k MAKE 000 138 040 250 040 250 040 250
>   eu.k MAKE 113 174 185 240 185 50 185 50
>   eu.k MAKE 175 185 GREEN YELLOW
>   eu.k MAKE 186 205 YELLOW BROWN
>   eu.k MAKE 206 215 BROWN RED
>   eu.k MAKE 216 235 MAROON WHITE
>   eu.k MAKE 236 254 WHITE BLACK
>   eu.k MAKE 255 255 WHITE
>   map.k H 8
>   gu.k MAKE 8 BLACK
>   bar.k 1 SU=IRTEMP X COL=8 ORIENT=VER
>   run.k 1 1 $PF FILE=SAVIMAGE
>   eu.k MAKE 000 174 040 220 040 220 040 220
>#  eu.k MAKE 113 114 PINK
>   eu.k MAKE 175 215 220 070 220 000 220 070
>   eu.k MAKE 216 235 NAVY WHITE
>   sfcplot.k WXS OLAY FRAME BLANK=NO LSIZE=6 COL=4 DAT=$PTDAT
>   sfccon.k PMSL OLAY FRAME OUT=CON GRIDF=132 BLANK=NO LSIZE=6 COL=2 DAT=$PTDAT
>   frntdisp.k OLAY TIME=FRAME SF=YES
>   sfcplot.k WXS OLAY FRAME BLANK=NO LSIZE=6 COL=4 DAT=$PTDAT
>   sfcplot.k WINDV OLAY FRAME BLANK=NO LSIZE=6 COL=3 DAT=$PTDAT
>   run.k 1 1 ${PF}SFC FILE=SAVIMAGE
>exit
>EOF
># The following line advances $H by one
>echo $H"+1" | bc > ans.txt; read H < ans.txt; rm -f 
>ans.txt
>done

Tom