USGS

Isis 2 Documentation


isisparam Documentation

isisparam - Pass parameter values back to the calling shell
NOTE: This program cannot be invoked through TAE.  It can only
be run from the Unix shell prompt or within a Perl script or
shell script.

This application provides the ability to pass parameters back from
ISIS applications to the calling shell.  It is an additional feature of
Shell ISIS.  This application will parse the contents of the file
created when an ISIS application is executed *and* it transfers values
to the caller.

All ISIS applications that perform the transfer of values to the caller
create a file called "isis_param.out" by default in the current
directory.  Note that this file is ONLY generated when an ISIS
application returns a variable to the calling PDF.  It is not generated
after every ISIS applications is run!  This file is always created in
the default directory you are running the application from.  You can
change the file name by setting the ISIS_PARAM_FILE environment to the
path and name of the file you prefer.  At any time you can set
ISIS_PARAM_FILE to a new file.  However, when retrieving the parameters
the "isisparam" program uses the file specified by ISIS_PARAM_FILE.
Thus, you cannot alter ISIS_PARAM_FILE between the time a program writes
the parameter file and "isisparam" fetches values from the file.  The
system will determine if ISIS_PARAM_FILE is set, if so the file named
here is used for all operations.  If it is not set then "isis_param.out"
is used as the file name for all operations.  A new option recently
added is the "-p " option.  All operatios performed by this
application will not be performed on the file "".  When using
this option, it overrides the use of ISIS_PARAM_FILE and the default
"isis_param.out".

Below are the options that can be provided to "isisparam" as reported
via "isisparam -help":

Usage:
isisparam -h              Print help message (or -help)
isisparam -file           Report name of param file
isisparam -p  param Use  as the param file, overriding
                            default AND environment variable,
                            ISIS_PARAM_FILE
isisparam -rm             Remove param file (may be combined with
                            other options)
isisparam param           Report value of given param, (separate lines
                            if needed)
isisparam -i 3 param      Report 4th element of given param (0 based)
isisparam -n param        Report number of elements in given param
isisparam -test param     Report 1 if param exists or 0 if not
isisparam -v param        Report value of given param verbatim from
                            the file
isisparam -s param        Do not print errors that are encountered,
                            exit with status code only

Here is an example of how the application works:

Note that when you call "getkey" from the shell command line, you
*MUST* give non-sensical values for the "keyval" and "nvals"
parameters to circumvent a generated error.

> isisparam -rm
> getkey from=/work1/kbecker/671L.cub obj=qube key=axis_name keytype=l \
           keyval=v nvals=n

GROUP = GETKEY
  ISISVERSION = "1998-08-01"
  VERSION_DATE = 1996-05-07
  DATE_TIME = 1999-02-19T10:29:02
  NODE_NAME = "bonzo"
  USER_NAME = "kbecker"
  SOFTWARE_DESC = "Get a keyword value from a cube file label"
  GROUP = PARAMETERS
    FROM = "/work1/kbecker/671L.cub"
    OBJNAM = "qube"
    GRPNAM = NULL
    KEY = "axis_name"
    KEYTYPE = "L"
  END_GROUP = PARAMETERS
AXIS_NAME = (SAMPLE,LINE,BAND)
  GROUP = ACCOUNTING
    CONNECT_TIME = 0:00:00.00
    CPU_TIME = 0:00:00.00
    DIRECT_IO = 0
    PAGE_FAULTS = 0
    PROCESS_SWAPS = 0
  END_GROUP = ACCOUNTING
END_GROUP = GETKEY
> isisparam -file
isis_param.out
> cat isis_param.out
KEYVAL = ("SAMPLE","LINE","BAND")
NVALS = 3
> isisparam axis_name
Parameter 'axis_name' not found.
> isisparam keyval
SAMPLE
LINE
BAND
> isisparam nvals
3
> isisparam -i 1 keyval
LINE
> isisparam -n keyval
3
> isisparam -v keyval
("SAMPLE","LINE","BAND")
> isisparam -test keyval
1
> isisparam -test axis_name
0
> isisparam -rm
> isisparam keyval
Unable to open parameter file.
Parameter 'keyval' not found.
> isisparam -s keyval
Unable to open parameter file.
> echo $status
1

The following is an example Perl script that uses "isisparam":

#!/usr/bin/perl
######################################################################
# This perl program demonstrates how to use the new "isisparam" Shell
# ISIS application.
#
######################################################################
   $input = $ARGV[0];

###############################################################
#  Get the name of the core and print it out
##############################################################
   system("getkey from=$input obj=qube key=core_name keytype=l \\
     keyval=v nvals=n");
   $cname = `isisparam KEYVAL`;
   chomp($cname);

   print "Core Name: $cname\n";


The following is an example Shell script that uses "isisparam":

#!/bin/csh
######################################################################
# This C shell program demonstrates how to use the new "isisparam" Shell
# ISIS application.
#
######################################################################
   set input = $1

###############################################################
#  Get the name of the core and print it out
##############################################################
   getkey from=$input obj=qube key=core_name keytype=l keyval=v nvals=n
   set cname = `isisparam KEYVAL`

   echo "Core Name: $cname"

Programmer:  Kris Becker, USGS, Flagstaff, Az

ParmDescriptionDefault

ADDITIONAL NOTES:

ParmDescription

Last updated: Jan 31 2005
File: pdfs2.html

Contact us online at the Isis Support Center: http://isisdist.wr.usgs.gov

ISIS Documentation Home Page