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

19990407: mcenv and making enhancement tables



>From: Craig Motell <address@hidden>
>Organization: University of Hawaii
>Keywords: 199904072157.PAA22947 McIDAS-X mcenv EU

Craig,

This eamil contains responses to two of your inquiries.  My comments
are interspersed throughout your original text.

>Dear Support I have script which works well. This script creates
>a new satellite AREA for me based on the differences between
>GOES bands 4 and 5 from AREA0007 and AREA0008 to create AREA0009
>(AREA0009 is just channels 4 - 5). 
>
>When I try to add the "bar.k" command all heck breaks out.
>
>The trick is that I want to automate my product creation, then add
>color enhancement, color bar, lat/lon. mapping, etc. 
>
>Below is my script (comments deleted):
>-------------------------------------------------------
>#!/bin/csh -xvf
>#
>set path = ( /home/sapo/cmotell /usr/local/bin /usr/local/SUNWspro/bin /usr/bi
> n /usr/ccs/bin /usr/bin /usr/X/bin /export/sapo2/mcidas/bin . )
>
>setenv MPATH /export/sapo2/mcidas
>setenv MCDATA ${MPATH}/workdata
>setenv MCPATH ${MCDATA}:${MPATH}/data
>
>mcenv -f 480x640 << 'EOF'
>wv.k 7 8 11 
>imgdisp.k PRODUCT/IMAGES 1                     "problem starts here!!!!
>bar.k 1 ORIENT=HOR LINT=15 LSIZE=6 COLOR=5
>exit
>'EOF'                              "user's guide uses EOF without [Aquotes
>exit 0
>
>
>-------------------------------------------------------
>Runtime results:
>------------------------------------------------------
>
>Opened area:  7
>Opened area:  8
>wv.k: FINISHED FILE=AREAOUT.A01
> Creating NAV files
>wv.k: FINISHED FILE=AREAOUT.ALT
>wv.k: FINISHED FILE=AREAOUT.ALN
>Done
>mcserv: illegal option -- R
>Usage is: mcserv [-diqrv] [-p portnum]
> 
>-d  become a daemon (sets -q)
>-q  quiet mode
>-r  use rhost based authentication
>-f  force ftp authentication
>-v  verbose mode
>-p  to specify a port number to listen
>imgdisp.k: done
>bar.k: Cannot find dataset name or image
>
>---------------------------------------------------------------------
>
>I have tried following examples. 

The error you are seeing is apparently being caused by running imgdisp.k
not bar.k.  I have seen this once before.  In that case, there was a typo
in the ~mcidas/.mcenv file.  The other site's problem was a space
between an '=' sign and the values on the right hand side.  For
instance, the following syntax is incorrect in Bourne shell scripts:

MCPATH= /home/mcidas/workdata:/home/mcidas/data:/home/mcidas/help
       ^__ the space is the culprit

The following is the correct syntax:

MCPATH=/home/mcidas/workdata:/home/mcidas/data:/home/mcidas/help

The first thing to check is the integrity of your ~/.mcenv file.

>Question:
>Can you tell me how to handle Mcidas commands that require "tv frames"
>while working outsite the mcidas environment? Or said differently,
>can you see a problem in my above script?

The problem is not in your script.  It is probably in your .mcenv file.
My comment assumes that the PRODUCT/IMAGES dataset is going through
the remote ADDE server (i.e. if you do a 'DATALOC PRODUCT' from the
account you are running the command in, you will not see it being
resolved as a 'LOCAL-DATA' dataset.

One other quick word of advice on these scripts.  If your environment
uses the Unidata recommendations for REDIRECTions and your dataset
is 'LOCAL-DATA', then you should 'cd' to the user's McIDAS working
directory first.  This way the REDIRECTions will make sense to the
instance of 'mcenv' that is run.  Unidata recommended REDIRECTions
contain constructs like:

REDIRECT ADD STRTABLE .
REDIRECT ADD LWPATH.NAM .
 etc.

Here the '.' refers to the current working directory.  If you do not
'cd ~user/mcidas/data' first, then these files may not be found
depending on what directory is current when the script is run.

>From address@hidden  Wed Apr  7 21:53:55 1999

>In the directory /home/mcidas/data thee are lots of lookup
>or color enhancment tables (e.g., RADAR.ET).

>These files are binary. I looked through source code but couldn't
>find the program that would convert an ASCII palette (i.e.,
>color lookup table) to the binary format required by mcidas.

>Question: 1) Is there a way to make your own enhancement tables
>to use with EU REST command?

The EU command is still the application to look toward.  EU MAKE
"sets the enhancement" (see online help for EU).

The easiest way to generate a McIDAS BATCH script that will setup
your enhancement table is to:

o use EU TABLE to list out an enhancement that has some similarity with
  the one you want to create

o specify the DEV=T fname keyword on the EU LIST incvocation above
  to save the output into an ASCII TEXT file

o cd to your McIDAS working directory (that is where the text file will
  be created)

o use your favorite text editor and add the EU MAKE invocations to
  the beginning of each line

Here is a quickie example:

EU TABLE RADAR DEV=T ENHANCE.BAT

The contents of ENHANCE.BAT will look like:

 Brightness  Blue      Green      Red
  min max   min max   min max   min max
  --- ---   --- ---   --- ---   --- ---
    0  18     0   0     0   0     0   0
   19  29     0   0   150 150     0   0
   30  30   127 127   127 127   127 127
   31  38     0   0   150 150     0   0
   39  49     0   0   152 152     0   0
   50  51     0   0   255 152     0   0
   52  56     0   0   152 152     0   0
   57  69     0   0   255 255     0   0
   70  90     0   0   150 150     0   0
   91  94     0   0   255 255     0   0
   95 132   255 255     0   0     0   0
  133 171     0   0   255 255   255 255
  172 209     0   0     0   0   255 255
  210 215     0   0     0   0   252 252
  216 227   252 252   252 252   252 252
  228 247   255 255   255 255   255 255
  248 252   252 252   252 252   252 252
  253 255     0   0     0   0     0   0
SEE: Done...EOF Encountered.

Edit this file and:

o delete the first three lines (Brightness...; min max...; --- --- ...)
 
o add EU MAKE to the beginning of each line:

EU MAKE    0  18     0   0     0   0     0   0
EU MAKE   19  29     0   0   150 150     0   0
EU MAKE   30  30   127 127   127 127   127 127
EU MAKE   31  38     0   0   150 150     0   0
EU MAKE   39  49     0   0   152 152     0   0
EU MAKE   50  51     0   0   255 152     0   0
EU MAKE   52  56     0   0   152 152     0   0
EU MAKE   57  69     0   0   255 255     0   0
EU MAKE   70  90     0   0   150 150     0   0
EU MAKE   91  94     0   0   255 255     0   0
EU MAKE   95 132   255 255     0   0     0   0
EU MAKE  133 171     0   0   255 255   255 255
EU MAKE  172 209     0   0     0   0   255 255
EU MAKE  210 215     0   0     0   0   252 252
EU MAKE  216 227   252 252   252 252   252 252
EU MAKE  228 247   255 255   255 255   255 255
EU MAKE  248 252   252 252   252 252   252 252
EU MAKE  253 255     0   0     0   0     0   0

Now you have a BATCH file that can recreate the RADAR enhancement.  Then
you need to adjust the min/max brightness levels (columns 3 and 4) and
corresponding Blue Green and Red gun values (columns 5,6  7,8  9,10)
to the values you desire.

You set the color levels in a frame displaying the image of interest
by running BATCH:

BATCH "ENHANCE.BAT

Once you have edited ENHANCE.BAT to your satisfaction and restored the
values to a frame, you can create the new enhancement by once again
using the EU command:

EU SAVE <enhancement_name>

NOTE:  You should NOT overwrite an enhancement that is contained in the
distribution (i.e. "enhancement_name" should not match any enhancement
file name in the distribution) since it will be overwritten the next
time a McIDAS installation is made.  Instead, you should create a new
name for your custom enhancement.

I hope that these responses help...

Tom

>From address@hidden  Tue Apr 13 22:23:58 1999
Tom, has always thankyou for your help.

You predicted that I had a problem running my script because of my
mcenv file and because I had a space in a bourne shell.

I think my problem could of been a combination of incorrect file
paths, but it was not a space problem. One note, I have not yet
isolated the problem but I changed a line from:

mcenv -f 480x640 << 'EOF'               "as per our my earlier email"

to 

MCPATH=$MCPATH PATH=$PATH mcenv << 'EOF'   "as per an earlier email you 
                                            wrote as found in your email
                                            archive"

This change allows my script to run. If I found the exact error I will 
let you know.

Sincerely,
Craig Motell

Craig Motell
University of Hawaii
2525 Correa Road
Honolulu, HI 96822
808-956-8302