[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
19990621: Problems with C-shell script resolving dataset
- Subject: 19990621: Problems with C-shell script resolving dataset
- Date: Tue, 22 Jun 1999 08:51:42 -0600
>From: Tye Parzybok <address@hidden>
>Organization: Oregon State University
>Keywords: 199906212353.RAA28169 McIDAS Cshell
Tye,
>For some reason I can not get my script (below) to resolve my dataset
>(fog/images). Any ideas?
>
>To help you I have posted the script, the run-time output, and my
>.mcenv file below.
>
>Thanks again Tom for your continued great help.
I will intersperse your listing with comments when I have them.
>___________________________________________________________________
>
>------C-Shell script-------
>
>#!/bin/csh -xvf
>
># This C-shell script runs McIDAS-X and produces a GRASS
># ASCII file of an the brightness values in an AREA (satellite) file.
>
># T. Parzybok, 06-18-1999
>
>setenv MPATH=/home/ocs/mcidas
>setenv MCDATA=${MPATH}/workdata
These two lines have incorrect C shell syntax and their definitions are,
in my opinion, non-standard. I would define them as follows:
setenv MCHOME /home/ocs/mcidsa/workdata
setenv MCDATA ${MCHOME}/workdata
Notice the lack of '=' in these lines. The C shell lets you define
environment variables in two ways:
setenv foo ...
set foo=...
>setenv
>MCPATH=/home/ocs/mcidas/workdata:/home/ocs/mcidas/data:/home/ocs/mcidas/help
This one I would make:
setenv MCPATH ${MCDATA}:${MCHOME}/data:${MCHOME}/help
>setenv DISPLAY aurora:0
>
>cd $MCDATA
>
># Start an mcenv session
>mcenv -f 480x640 << EOFF
The common syntax would be:
mcenv -f 480x640 << EOF
(i.e. EOF instead of EEOF)
>logon.k TWP FOG I WS
>
>redirect.k rest fog.nam
McIDAS is particular about case sensitivity. This should probably read
redirect.k REST fog.nam
assuming, of course, that your redirection file is named 'fog.nam'. It must
also exist in one of the directories in your MCPATH.
># Reproject the image to a "geographic" projection
>imgremap.k fog/images.104 fog/images.9999 pro=rect
Again, McIDAS is case picky. Is your dataset really 'fog/images' or is
it, perhaps, 'FOG/IMAGES'. A 'DSSERVE LIST' will answer this question
quickly.
># Export a raster ASCII file
>axform.k 9999 /home/ocs/mcidas/fogdata/grass/img_raster.txt mis=-9999 fty=asc
>nav=yes
I am sure that the keywords need to be in upper case:
axform.k 9999 /home/ocs/mcidas/fogdata/grass/img_raster.txt MISS=-9999 FTY=ASC
NAV=YES
># Delete re-projected image
>imgdel.k fog/images.9999
Perhaps:
imgdel.k FOG/IMAGES.9999
>EOFF
>
># Add header to raster ASCII file
>cd /home/ocs/mcidas/fogdata/grass
>
>if ( -e img_raster.grass )
> rm img_raster.grass
>endif
>
>touch img_raster.grass
>
>cat waor_header.txt img_raster.txt >> img_raster.grass
>rm IMG_RASTER.???
>
>exit
>
>------Runtime errors/output------
>
>cd $MCDATA
>cd /home/ocs/mcidas/workdata
>
>
>mcenv -f 480x640 << EOFF
>mcenv -f 480x640
>LOGON in progress...
>TD: STRING TABLE CLEARED.
>CUR: DONE
>DR: Done
>GU: Done
>EU: Restoring default enhancement to frame(s)= 1
>EU: Done
>LOGON to McIDAS-X completed.
>redirect.k: Invalid option specified=rest
This is because it should be REST.
>imgremap.k: Image directory server unable to resolve this dataset: fog/images
This tells me that the dataset is either FOG/IMAGES and/or it hasn't been
defined by a 'DSSERVE ADD ...' command.
>imgremap.k: Failed to open source directory
>axform.k: Area does not exist= 9999
This error is a cascade from prefious ones.
>imgdel.k: Image directory server unable to resolve this dataset: fog/images
>imgdel.k: done
>
>
>cd /home/ocs/mcidas/fogdata/grass
>cd /home/ocs/mcidas/fogdata/grass
>
>if ( -e img_raster.grass )
>if ( -e img_raster.grass )
>if: Empty if
>
>
>------.mcenv------
>umask 002
>MCDATA=/home/ocs/mcidas/workdata
>MCPATH=/home/ocs/mcidas/workdata:/home/ocs/mcidas/data:/home/ocs/mcidas/help
>MCGUI=/home/ocs/mcidas/bin
>MCTABLE_READ=/home/ocs/mcidas/mcidas/data/MCTABLE.TXT
>MCTABLE_WRITE=/home/ocs/mcidas/mcidas/data/MCTABLE.TXT
>PATH=${MCGUI}:/home/ocs/mcidas
>export MCDATA MCPATH MCGUI MCTABLE_READ MCTABLE_WRITE PATH
>cd $MCDATA
.mcenv will be used by the ADDE remote server. If 'FOG/IMAGES' is a
local dataset, this file will not come into play. If FOG/IMAGES was defined
in the 'mcidas' environment it could be treated as a remote dataset
given that you have your ADDE remote server setup as per my recommendations
(user 'mcadde's home directory is the same as 'mcidas').
Try the mods suggested above and let me know what happens.
Tom
>From address@hidden Tue Jun 22 17:18:33 1999
Tom,
It worked!!! (Just one minor syntax error [see below] in your response).
Thank you...Thank you...Thank you,
Tye Parzybok
(corrected syntax error in body of repsonse above)