This page was created by the IDL library routine
mk_html_help. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Fri Feb 2 17:45:16 2001.
PROJECT:
SOHO - CDS
NAME:
ADD_PATH
PURPOSE:
Add directory (and optionally all its subdirs) into IDL path
EXPLANATION:
CALLING SEQUENCE:
ADD_PATH, path_name [,/append] [,index=index]
INPUTS:
path_name -- A string scalar of a valid directory name.
OPTIONAL INPUTS:
INDEX -- Position in the !path where the directory name is inserted;
ignored if the keyword APPEND is set.
OUTPUTS:
None, but !path is changed.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
APPEND -- By default, the given directory name is added in the
beginning of !path. Set this keyword will add the directory
name in the end of !path.
EXPAND -- Set this keyword if the PATH_NAME needs to be expanded.
CALLS:
CHK_DIR, CONCAT_DIR, STR_SEP, STR_COMB, DATATYPE
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
Utilities, OS
PREVIOUS HISTORY:
Written October 8, 1994, by Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
Version 2, Liyun Wang, GSFC/ARC, October 17, 1994
Added EXPAND keyword
VERSION:
Version 2, October 17, 1994
Project : SOHO - CDS Name : BREAK_FILE Purpose : Break a filename into its component parts. Explanation : Given a file name, break the filename into the parts of disk/logical, the directory, the filename, the extension, and the file version (for VMS) Use : BREAK_FILE, FILE, DISK_LOG, DIR, FILNAM, EXT, FVERSION, NODE Inputs : file - The file name Opt. Inputs : None. Outputs : disk_log- The disk or logical (looks for a ":") This is generally only valid on VMS machines dir - The directory filnam - The filename (excluding the ".") ext - The filename extension (including the ".") fversion- The file version (only VMS) node - The Node name (only VMS) Opt. Outputs: None. Keywords : None. Calls : None. Common : None. Restrictions: VMS: Assumes that : always precedes [] ULTRIX: Right now it has trouble with the ultrix option of use of "." or ".." Side effects: None. Category : Utilities, Operating_system. Prev. Hist. : Written 1988 by M.Morrison Aug-91 (MDM) Changed to handle Unix filename convensions 28-Feb-92 (MDM) * Adjusted to handle arrays 11-Mar-92 (MDM) - Perform a STRTRIM(x,2) on input string before doing the "break-up" 1-Dec-92 (MDM) - Moved code to do filename, extension and version number for both VMS and Unix (previously it did not do version number code for Unix) 29-Jan-93 (DMZ/MDM) - checked for node in file name Written : M. Morrison, August 1991. Modified : Version 1, William Thompson, GSFC, 23 April 1993. Incorporated into CDS library. Version 1.1, William Thompson, GSFC, 7 May 1993. Added IDL for Windows compatibility. Version : Version 1.1, 7 May 1993.
Project : SOHO - CDS Name : BREAK_PATH() Purpose : Breaks up a path string into its component directories. Explanation : Use : Result = BREAK_PATH( PATHS ) Inputs : PATHS = A string containing one or more directory paths. The individual paths are separated by commas, although in UNIX, colons can also be used. In other words, PATHS has the same format as !PATH, except that commas can be used as a separator regardless of operating system. A leading $ can be used in any path to signal that what follows is an environmental variable, but the $ is not necessary. (In VMS the $ can either be part of the path, or can signal logical names for compatibility with Unix.) Environmental variables can themselves contain multiple paths. Opt. Inputs : None. Outputs : The result of the function is a string array of directories. The first element of the array is always the null string, representing the current directory. All the other directories will end in the correct separator character for the current operating system. Opt. Outputs: None. Keywords : None. Calls : STR_SEP Common : None. Restrictions: None. Side effects: None. Category : Utilities, Operating_system Prev. Hist. : None, but influenced by TEST_OPENR by William Thompson, and CONCAT_DIR by M. Morrison. Written : William Thompson, GSFC, 3 May 1993. Modified : Version 1, William Thompson, GSFC, 6 May 1993. Added IDL for Windows compatibility. Version : Version 1, 6 May 1993.
Project : SOHO - CDS
Name :
CHKLOG
Purpose :
Determine actual name of logical or environment variable.
Explanation :
This routine determines the actual name of a logical name (VMS) or
environment variable (UNIX). In VMS the routine TRNLOG,/FULL is used;
otherwise GETENV is used.
Use :
Result = CHKLOG( VAR [, OS ] )
Inputs :
VAR = String containing the name of the variable to be translated.
Opt. Inputs :
None.
Outputs :
The result of the function is the translated name, or (in VMS) an array
containing the translated names.
Opt. Outputs:
OS = The name of the operating system, from !VERSION.OS.
Keywords :
None.
Calls :
None.
Common :
None.
Restrictions:
None.
Side effects:
None.
Category :
Utilities, Operating_system.
Prev. Hist. :
Written - DMZ (ARC) May 1991
Modified - DMZ (ARC) Nov 1992, to use GETENV
Written :
D. Zarro, GSFC/SDAC, May 1991.
Modified :
Version 1, William Thompson, GSFC, 23 April 1993.
Incorporated into CDS library.
Version 2, Dominic Zarro, GSFC, 1 August 1994.
Added capability for vector inputs
Version :
Version 2, 1 August 1994.
PROJECT:
SOHO - CDS
NAME:
CHK_DIR()
PURPOSE:
Check the validity of a directory name.
EXPLANATION:
CALLING SEQUENCE:
Result = CHK_DIR(dir_name)
INPUTS:
DIR_NAME -- A string specifying the directory name. For VMS system,
a valid directory name can be a logical name, or
any string with a format of '[...]', '[...]aaa.dir',
or 'aaa.dir'
OPTIONAL INPUTS:
None.
OUTPUTS:
RESULT -- 1 if the directory name is valid, 0 otherwise
OPTIONAL OUTPUTS:
OUTPUT -- A string indicating the real directory path
KEYWORD PARAMETERS:
FULLNAME -- if set and OUTPUT is present, OUTPUT will contain the full
path specification for the directory
CALLS:
DATATYPE, CHKLOG, STR_INDEX
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written October 9, 1994, by Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
Version 2, Liyun Wang, GSFC/ARC, December 16, 1994
Made work for VMS directories
Version 3, Liyun Wang, GSFC/ARC, December 29, 1994
Added keyword FULLNAME
Fixed bug of false reporting if the given string represents
a plain file under Unix OS
VERSION:
Version 3, December 29, 1994
Project : SOHO - CDS Name : CONCAT4DOS Purpose : Concatenates IDL procedure files for copying to DOS machine. Explanation : Concatenates IDL procedure files together into a form suitable for copying to a DOS machine. All the .PRO files in the current directory are copied into a special "dos" subdirectory, with the following changes made: 1. All filenames are truncated to eight characters. 2. All procedure files with names beginning with the same first eight characters are concatenated together into a single file. Use : CD, directory ;(go to desired directory) CONCAT4DOS ;or CONCAT4DOS, /SUBDIRECTORIES Inputs : None. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : SUBDIRECTORIES = If set, then subdirectories are also recursively processed. Calls : FDECOMP Common : None. Restrictions: None. Side effects: A "dos" subdirectory is created. On VMS machines, a temporary command file called "CONCAT4DOS.COM" is created and then destroyed. On UNIX machines the temporary file is called "concat4dos.sh". Category : Utilities, Operating_system. Prev. Hist. : William Thompson, August 1992. Written : William Thompson, GSFC, August 1992. Modified : Version 1, William Thompson, GSFC, 9 July 1993. Incorporated into CDS library. Modified so that a temporary file is created on UNIX machines as well, to speed up. Version 2, William Thompson, GSFC, 18 April 1994. Added SUBDIRECTORIES switch, and copying of documentation (.txt or .tex) files. Version : Version 2, 18 April 1994.
Project : SOHO - CDS
Name : CONCAT_DIR
Purpose : To concatenate directory and file names for current os.
Explanation : The given file name is appended to the given directory
name with the format appropriate to the current operating
system. Can be also used to append two directory names
Use : IDL> full_name = concat_dir(directory,filename)
IDL> pixfile = concat_dir('$DIR_GIS_MODEL','pixels.dat')
IDL> file = ['f1.dat','f2.dat','f3.dat']
IDL> dir = '$DIR_NIS_CAL'
IDL> f = concat_dir(dir,file)
Inputs : DIRECTORY the directory path (string)
FILE the basic file name and extension (string)
can be an array of filenames or directory
names
Opt. Inputs : None
Outputs : The function returns the concatenated string. If the file
input is a string array then the output will be a string
array also.
Keywords : DIR -- If set, the second argument is treated as a directory
name instead of a file name (it has no effect if not
under VMS system)
CHECK -- Check the validity of directory name(s) if set
Calls : CHK_DIR, BELL
Restrictions: Assumes Unix type format if os is not VMS.
Side effects: None
Category : Utilities, Strings
Prev. Hist. : Yohkoh routine by M. Morrison
Written : CDS version by C D Pike, RAL, 19/3/93
Modified :
Version 2, Liyun Wang, GSFC/ARC, January 3, 1995
Made it capable of concatinating directory names
Added keywords CHECK and DIR for output
VERSION:
Version 2, January 3, 1995
Project : SOHO - CDS
Name : DELETE_FILE()
Purpose : Delete a named file.
Explanation : Spawn the OS appropriate delete command.
Use : IDL> status = delete_file(filename [,report=report])
Inputs : filename - file to be deleted, must include path
Opt. Inputs : None
Outputs : Function value = 1 for success = 0 for failure
Opt. Outputs: Report - the os response to the delete command
Keywords : None
Calls : None
Restrictions: VMS and Unix only
Side effects: None
Category : Util, Operating_system
Prev. Hist. : None
Written : C D Pike, RAL, 13-May-93
Modified :
Version : Version 1
Project : SOHO - CDS
Name : DELVARX
Purpose : Delete variables for memory management (can call from
routines)
Use : DELVARX, a [,b,c,d,e,f,g,h,i,j]
;deletes named variables
;like idl delvar, but may be used
;from any calling level;
Explanation :
Inputs : p0, p1...p9 - variables to delete
Opt. Inputs : None.
Outputs : None.
Opt. Outputs: None.
Keywords : None.
Calls : None.
Common : None.
Restrictions: Can't use recursively due to EXECUTE function, TEMPORARY
function not available in idl versions < 2.2
Side effects: None.
Method : Uses EXECUTE and TEMPORARY function
Category :
Prev. Hist. :
slf, 8-mar-1993 ; bug fix
slf, 25-mar-1993 ; made it work for non-scalers!
Written : slf, 25-feb-1993
Modified :
Version :
Project : SOHO - CDS
Name :
FDECOMP
Purpose :
Decompose file name into components.
Explanation :
Routine to decompose file name into disk (VMS) + directory +
name + qualifier + version (VMS).
On a Vax the filenames "MOTD" and "MOTD." are distinguished by the fact
that qual = '' for the former and qual = ' ' for the latter.
Use :
fdecomp, filename, disk, dir, name, qual, version
Inputs :
filename - string file name, scalar
Opt. Inputs : None.
Outputs :
All the output parameters are scalar strings
disk - disk name, always '' on a Unix machine
dir - directory name
name - file name
qual - qualifier, set equal to the characters beyond the last "."
version - version number, always '' on a Unix machine
Opt. Outputs: None.
Keywords : None.
Calls :
GETTOK
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities, Operating_System
Prev. Hist. :
version 1 D. Lindler Oct 1986
converted to SUN IDL. M. Greason, STX, 30 July 1990.
W. Landsman STX, August, 1991
Written : D. Lindler, GSFC/HRS, October 1986
Modified : Version 1, William Thompson, GSFC, 29 March 1994
Incorporated into CDS library
Version : Version 1, 29 March 1994
Project : SOHO-CDS
Name : FILE_ACC
Purpose : Determine existence, type and access of file on UNIX system.
Explanation :
This routine is intended to supplement the IDL findfile function.
For a given unix path name, e.g '/disk2/bowen/adas/file', this
routine returns certain information.
1. Whether the path exists.
2. Whether the user has read permission.
3. Whether the user has write permission.
4. Whether the user has execute permission.
5. What the file type is i.e file, directory etc.
The routine works by spawning various UNIX commands and
interpreting the information returned. A directory listing
command is used to get basic file information; on ULTRIX 'ls -ld',
which establishes whether the file exists and also returns the
file type, access and ownership information. The 'd' parameter
ensures that directory information is listed rather than the
contents of a directory.
Before the access information can be interpreted the current user
is found by spawning the 'whoami' UNIX command. If the user is not
the owner of the file the UNIX 'groups' command is used to determine
whether or not the owner and the user are in the same group.
Using all of this information the correct read, write and execute
permissions are derived from the owner, group or world access
codes given in the directory listing information.
This processing is performed in a group of four routines which
are all incorporated in the file_acc.pro file.
Note: the syntax of the UNIX commands and the output which is
returned may vary from one operating system to another. The
operating system is checked and specific code executed for that
system. Currently the routine has specific code for;
**** File listing command: ****
ULTRIX: Command 'ls -ld /.../file.dat'
Output '-rw-r--r-- 1 bowen 5688 May 27 17:15 file.dat'
OSF: (Same command as ULTRIX but different output, difference
doesn't matter though, only first three fields used.)
Output '-rw-r--r-- 1 bowen user 5688 May 27 17:15 file.dat'
SUNOS: (Same command and output as ULTRIX)
All others: (same as ULTRIX code)
**** Groups identification: ****
ULTRIX: Command 'groups root'
Output 'system daemon tty'
OSF: (Same command and output as ULTRIX)
SUNOS: (Same command but, importantly, different output)
Command 'groups root'
Output 'system daemon tty'
All others: (Same as ULTRIX code)
**** User identification: ****
ULTRIX, OSF and SUNOS: Command 'whoami'
Output 'name'
Use :
Example of file_acc usage;
file = '/disk2/fred/data'
file_acc, file, exist, read, write, execute, filetype
if exist eq 1 then begin
print,'Permissions for file ',file,' are;'
if read eq 1 print,'read'
if write eq 1 print,'write'
if execute eq 1 print,'execute'
print,'The file type is ',filetype
end else begin
print,file,' does not exist'
end
Inputs :
FILE - The UNIX system name of the file. For example
'file.dat' refers to the current directory and
'/disk2/fred/data' is a full path name.
Opt. inputs :
None
Outputs :
EXIST - Integer, 1 if the file exists, 0 if it does not.
READ - Integer, 1 if the user has read permission 0 if not.
WRITE - Integer, 1 if the user has write permission 0 if not.
EXECUTE - Integer, 1 if the user has execute permission 0 if not.
FILETYPE- String, the file description character from the
directory listing output. e.g for ULTRIX '-' indicates
a file and 'd' indicates a directory file.
Opt. outputs:
None
Keywords :
None
Calls:
All of thses routines are in the file_acc.pro file.
FILE_ACC_DET Get basic file information through 'ls' command.
FILE_ACC_GRP See if two users share a group.
Called from FILE_ACC_DET and FILE_ACC_GRP;
FILE_ACC_SPLIT Split a space separated string of output into
an array of strings.
Restrictions: None
Sise effects:
A number of UNIX commands are spawned.
Category:
UNIX system IDL utility.
Prev. Hist. : None
Written:
Andrew Bowen, Tessella Support Services plc, 29-Apr-1993
Modified: Version 2, Header format updated, C D Pike, 7-Oct-93
Modified: Version 2.1, Added /SH flag to spawn command to get rid of errors 07/07/97, S.Paswaters
Version 2.2 Use "/bin/ls -ld" in file_acc_det, N B Rich, 01 Dec 1998
Version 2.3 The assumed output of 'groups' was incorrect for sunos; corrected pro file_acc_grp
Version: Version 2.2 12-Nov-1998
Project : SOHO - CDS
Name : FILE_EXIST()
Purpose : Test whether a file exists.
Explanation : Returns true(1) if any files match pattern=file
or false(0) if no files found.
Use : IDL> file_ok = file_exist(filename [,/direct])
Inputs : file - file, pathname or file filter to check
Opt. Inputs : None
Outputs : Returns 1/0 as each file does/does not exist.
Opt. Outputs: None
Keywords : direct - set if want full check (slower) - use if might be an
empty directory you are looking for
Calls : None
Restrictions: None
Side effects: None
Category : Utilities, Files, OS
Prev. Hist. : Yohkoh procedure by Sam Freeland, LPARL
Written : CDS version by C D Pike, RAL, 2-Jul-1993
Modified :
Version : Version 1 2-Jul-1993
Project : SOHO - CDS
Name : FIND_ALL_DIR
Purpose : Finds all directories under a specified directory.
Explanation : This routines finds all the directories in a directory tree
when the root of the tree is specified. This provides the same
functionality as having a directory with a plus in front of it
in the environment variable IDL_PATH.
Use : Result = FIND_ALL_DIR( PATH )
PATHS = FIND_ALL_DIR('+mypath', /PATH_FORMAT)
Inputs : PATH = The path specification for the top directory in the
tree. Optionally this may begin with the '+'
character but that is optional.
Opt. Inputs : None.
Outputs : The result of the function is a list of directories starting
from the top directory passed and working downward from there.
Normally, this will be a string array with one directory per
array element, but if the PATH_FORMAT keyword is set, then a
single string will be returned, in the correct format to be
incorporated into !PATH.
Opt. Outputs: None.
Keywords : PATH_FORMAT = If set, then a single string is returned, in
the format of !PATH.
Calls : FIND_WITH_DEF
Common : None.
Restrictions: PATH must point to a directory that actually exists.
On VMS computers this routine calls a command file,
FIND_ALL_DIR.COM, to find the directories. This command file
must be in one of the directories in IDL's standard search
path, !PATH.
Side effects: None.
Category : Utilities, Operating_system.
Prev. Hist. : None.
Written : William Thompson, GSFC, 3 May 1993.
Modified : Version 1, William Thompson, GSFC, 3 May 1993.
Version 2, William Thompson, GSFC, 6 July 1993.
Added sort to spawned command under Unix.
Version : Version 2, 6 July 1993.
Project : SOHO - CDS Name : FIND_WITH_DEF() Purpose : Searches for files with a default path and extension. Explanation : Finds files using default paths and extensions, similar to using the DEFAULT keyword with the OPEN statement in VMS. Using this routine together with environment variables allows an OS-independent approach to finding files. Use : Result = FIND_WITH_DEF( FILENAME, PATHS [, EXTENSIONS ] ) FILENAME = '' READ, 'File to open: ', FILENAME FILE = FIND_WITH_DEF( FILENAME, 'SERTS_DATA', '.fix' ) IF FILE NE '' THEN ... Inputs : FILENAME = Name of file to be searched for. It may either be a complete filename, or the path or extension could be left off, in which case the routine will attempt to find the file using the default paths and extensions. PATHS = One or more default paths to use in the search in case FILENAME does not contain a path itself. The individual paths are separated by commas, although in UNIX, colons can also be used. In other words, PATHS has the same format as !PATH, except that commas can be used as a separator regardless of operating system. The current directory is always searched first, unless the keyword NOCURRENT is set. A leading $ can be used in any path to signal that what follows is an environmental variable, but the $ is not necessary. (In VMS the $ can either be part of the path, or can signal logical names for compatibility with Unix.) Environmental variables can themselves contain multiple paths. Opt. Inputs : EXTENSIONS = One or more extensions to append to end of filename if the filename does not contain one (e.g. ".dat"). The period is optional. Multiple extensions can be separated by commas or colons. Outputs : The result of the function is the name of the file if successful, or the null string if unsuccessful. Opt. Outputs: None. Keywords : NOCURRENT = If set, then the current directory is not searched. Calls : STR_SEP, BREAK_PATH Common : None. Restrictions: None. Side effects: None. Category : Utilities, Operating_system Prev. Hist. : None, but influenced by TEST_OPENR by William Thompson, and CONCAT_DIR by M. Morrison. Written : William Thompson, GSFC, 5 April 1993. Modified : Version 1, William Thompson, GSFC, 3 May 1993. Removed trailing / and : characters. Fixed bugs Allow for commas within values of logical names. Added keyword NOCURRENT. Changed to call BREAK_PATH Version 2, William Thompson, GSFC, 3 November 1994 Made EXTENSIONS optional. Version : Version 2, 3 November 1994
Project : SOHO - CDS Name : FLAG_LONG_NAMES Purpose : Flags procedure names that would appear the same under DOS Explanation : Flags sets of IDL procedure names which have the same first eight characters. These would appear to be the same file on DOS machines. The names of each set of .PRO files with the same first eight characters are printed to the screen. Use : CD, directory ;(go to desired directory) FLAG_LONG_NAMES Inputs : None. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : None. Calls : None. Common : None. Restrictions: None. Side effects: None. Category : Utilities, Operating_system. Prev. Hist. : William Thompson, January 1993. Written : William Thompson, GSFC, January 1993. Modified : Version 1, William Thompson, GSFC, 9 July 1993. Incorporated into CDS library. Version : Version 1, 9 July 1993.
Project : SOHO - CDS Name : FORM_FILENAME() Purpose : Adds default paths and extensions to filenames. Explanation : This procedure tests whether or not a given filename already has an extension on it. If not, then a default extension is appended. Optionally, the same can be done with a default path. This is similar to using the DEFAULT keyword with the OPEN statement in VMS. Using this routine together with environment variables for the optional directory path allows an OS-independent approach to forming filenames. Use : result = FORM_FILENAME( FILENAME, EXTENSION ) OPENW, UNIT, FORM_FILENAME( FILENAME, '.fits' ), ... Inputs : FILENAME = Name of file to test. EXTENSION = Default filename extension. Ignored if FILENAME already contains an extension. Opt. Inputs : None. Outputs : Result of function is the name of the file complete with (optional) directory and extension. Opt. Outputs: None. Keywords : DIRECTORY = Default directory path. Ignored if FILENAME already contains directory information. Calls : STR_SEP Common : None. Restrictions: None. Side effects: None. Category : Utilites, Operating System. Prev. Hist. : William Thompson, October 1991. Written : William Thompson, GSFC, October 1991. Modified : Version 1, William Thompson, GSFC, 7 May 1993. Incorporated into CDS library. Changed to be compatible with CONCAT_DIR by M. Morrison. Made more OS-independent. Relaxed punctuation requirements. Fixed small bug with blank extensions. Added IDL for Windows compatibility. Version : Version 1, 7 May 1993.
Project : SOHO - CDS Name : GETLOG() Purpose : Returns correct logical dir. for given operating system. Explanation : Returns the correct logical directory for the given operating system. E.G. dat: for vms, $DAT/ for unix. The operating system in !version.os is checked. If it equals: 'vms' then a ':' is appended. else unix os is assumed and the input string is uppercased, a '$' is prepended and a '/' is appended. Use : GETLOG,lname Inputs : lname - the base name of the logical (without special characters). Opt. Inputs : None. Outputs : Returns appropriate string. Opt. Outputs: None. Keywords : None. Calls : None. Common : None. Restrictions: Assumes that the created directory logical will have meaning to the host operating system. Side effects: None. Category : Utilities, Operating_System Prev. Hist. : Written, JDNeill, May, 1990. Modified, JDNeill,Sep, 1990 -- for unix return full path instead of just environment variable name. Written : J. D. Neill, May 1990 Modified : Version 1, William Thompson, GSFC, 29 March 1994 Incorporated into CDS library Version : Version 1, 29 March 1994
Project : SOHO - CDS Name : HOST_TO_IEEE Purpose : Translate host variables to IEEE format. Explanation : Translates an IDL variable in the host architecture into the IEEE-754 standard (e.g. as used in FITS files). BYTEORDER is used to convert from the host format to network format for integer arrays or XDR format for floating point arrays. These are equivalent to IEEE format. Use : HOST_TO_IEEE, DATA Inputs : DATA = Any IDL variable, scalar or vector. DATA will be modified by HOST_TO_IEEE to convert it to IEEE format. Byte and string variables are returned by HOST_TO_IEEE unchanged. Opt. Inputs : None. Outputs : The output value of DATA is the variable converted to the format of the host architecture. Opt. Outputs: None. Keywords : IDLTYPE - scalar integer (1-7) specifying the IDL datatype according to the code given by the SIZE function. This keyword will usually be used when suppying a byte array that needs to be interpreted as another data type (e.g. FLOAT). Calls : None. Common : None. Restrictions: Assumes the IDL version is since 2.2.2 when the /XDRTOF keyword became available to BYTEORDER. There were two bad implementations in BYTEORDER for double precision: (1) in IDL V3.* for DecStations (!VERSION.ARCH = 'mipsel') and (2) on Dec Alpha OSF machines. IEEE_TO_HOST works around these cases by swapping the byte order directly. Side effects: None. Category : Utilities, Operating_system Prev. Hist. : Adapted from CONV_UNIX_VAX, W. Landsman Hughes/STX January, 1992 Fixed Case statement for Float and Double September, 1992 Workaround for /DTOXDR on DecStations January, 1993 Workaround for /DTOXDR on Alpha OSF July 1994 Assume since Version 2.2.2, Ultrix problems persist November 1994 Written : Wayne Landsman, GSFC/UIT, January 1992. Modified : Version 4, William Thompson, GSFC, 27 February 1995 Using version from IDL Astronomy User's Library for better compatibility. See previous history above. IDLTYPE keyword reinstated. Version : Version 4, 27 February 1995
Project : SOHO - CDS Name : IEEE_TO_HOST Purpose : Translate variables from IEEE to host format. Explanation : Translates an IDL variable into the host architecture from the IEEE-754 standard (e.g. as used in FITS files). BYTEORDER is used to convert to the host format from network format for integer arrays or XDR format for floating point arrays. These are equivalent to IEEE format. Use : IEEE_TO_HOST, DATA Inputs : DATA = Any IDL variable, scalar or vector. DATA will be modified by IEEE_TO_HOST to convert it from IEEE format. Byte and string variables are returned by IEEE_TO_HOST unchanged. Opt. Inputs : None. Outputs : The output value of DATA is the variable converted to the format of the host architecture. Opt. Outputs: None. Keywords : IDLTYPE - scalar integer (1-7) specifying the IDL datatype according to the code given by the SIZE function. This keyword is usually when DATA is a byte array to be interpreted as another datatype (e.g. FLOAT). Calls : None. Common : None. Restrictions: Assumes the IDL version is since 2.2.2 when the /XDRTOF keyword became available to BYTEORDER. There were two bad implementations in BYTEORDER for double precision: (1) in IDL V3.* for DecStations (!VERSION.ARCH = 'mipsel') and (2) on Dec Alpha OSF machines. IEEE_TO_HOST works around these cases by swapping bytes directly Side effects: None. Category : Utilities, Operating_system Prev. Hist. : Written, W. Landsman Hughes/STX May, 1992 Fixed error Case statement for float and double September 1992 Workaround to /XDRTOD problem on DecStations January 1993 Assume since Version 2.2, correct double precision problems in Alpha/OSF, implement Ultrix corrections from Tom McGlynn November 1994 Written : Wayne Landsman, GSFC/UIT, May 1992. Modified : Version 4, William Thompson, GSFC, 27 February 1995 Using version from IDL Astronomy User's Library for better compatibility. See previous history above. IDLTYPE keyword reinstated. Version : Version 4, 27 February 1995
Project : SOHO - CDS Name : LIST_WITH_PATH() Purpose : Searches for files with a default path and extension. Explanation : Lists files in a set of default paths, similar to using FINDFILE, except that a list of paths to be searched can be given. Use : Result = LIST_WITH_PATH( FILENAME, PATHS ) FILENAME = '' READ, 'File to open: ', FILENAME FILE = LIST_WITH_PATH( FILENAME, 'SERTS_DATA', '.fix' ) IF FILE NE '' THEN ... Inputs : FILENAME = Name of file to be searched for. It may contain wildcard characters, e.g. "*.dat". PATHS = One or more default paths to use in the search in case FILENAME does not contain a path itself. The individual paths are separated by commas, although in UNIX, colons can also be used. In other words, PATHS has the same format as !PATH, except that commas can be used as a separator regardless of operating system. The current directory is always searched first, unless the keyword NOCURRENT is set. A leading $ can be used in any path to signal that what follows is an environmental variable, but the $ is not necessary. (In VMS the $ can either be part of the path, or can signal logical names for compatibility with Unix.) Environmental variables can themselves contain multiple paths. Opt. Inputs : None. Outputs : The result of the function is a list of filenames. Opt. Outputs: None. Keywords : None. Calls : BREAK_PATH, CONCAT_DIR Common : None. Restrictions: None. Side effects: None. Category : Utilities, Operating_system Prev. Hist. : None. Written : William Thompson, GSFC, 3 November 1994 Modified : Version 1, William Thompson, GSFC, 3 November 1994 Version : Version 1, 3 November 1994
Project : SOHO - CDS
Name :
LOC_FILE()
Purpose :
Get files from a set of directories.
Explanation :
Similar to the standard utility FINDFILE, but allows for a series of
directories to be searched. Also, in Unix, it takes care of pathnames
that contain the special "~" character, which FINDFILE currently does
not do.
Use :
Result = LOC_FILE(FILE,PATH=PATH,LOC=LOC,COUNT=COUNT,ALL=ALL)
Inputs :
FILE = Name of file(s) to search for. It may contain wildcard
characters.
Opt. Inputs :
None.
Outputs :
The result of the function is an array containing the names of all the
files found.
Opt. Outputs:
None.
Keywords :
PATH = Array or scalar string with names of directories to search.
LOC = Returned directory locations of found files.
COUNT = Number of found files.
ALL = If set, then search all directories. Otherwise, the
procedure stops as soon as a match is found.
Calls :
BREAK_FILE, CONCAT_DIR, DATATYPE
Common :
None.
Restrictions:
None.
Side effects:
None.
Category :
Utilities, Operating_system.
Prev. Hist. :
Written Dec'92 (DMZ,ARC)
Written :
D. Zarro, GSFC/SDAC, December 1992.
Modified :
Version 1, William Thompson, GSFC, 23 April 1993.
Incorporated into CDS library.
Version 2, Dominic Zarro, GSFC, 1 August 1994.
Added for error checking
Version :
Version 2, 1 August 1994.
Project : SOHO - CDS Name : REV_SWAP Purpose : Swaps data between reverse network and host byte order. Explanation : This routine takes data with bytes in reverse network (little-endian) order, as used by DEC computers and PCs, and converts it to the correct byte order for the current host. Conversely, it can also convert data in host to reverse network order. Use : REV_SWAP, DATA Inputs : DATA = Data in reverse network order. Opt. Inputs : None. Outputs : DATA = The byte swapped data is returned in place of the input array. Opt. Outputs: None. Keywords : None. Calls : DATATYPE Common : The common block REV_SWAP_CMN is used internally to keep track of whether the current computer uses network or reverse network byte order. Restrictions: Only the byte order of the data is affected. No other conversions, such as for example IEEE to host floating point formats, are performed on the data. If such conversions are necessary, then the call to REV_SWAP can be followed up with either IEEE_TO_HOST or HOST_TO_IEEE. Side effects: None. Category : Utilities, Operating_system. Prev. Hist. : None. Written : William Thompson, GSFC, 10 February 1994 Modified : Version 1, William Thompson, GSFC, 10 February 1994 Version : Version 1, 10 February 1994
PROJECT:
SOHO - CDS
NAME:
RM_PATH
PURPOSE:
Remove directory (and optionally its subdirs) from IDL path
EXPLANATION:
CALLING SEQUENCE:
RM_PATH, path_name [,/expand] [index=index]
INPUTS:
PATH_NAME -- A string scalar containing directory name to be
removed
OPTIONAL INPUTS:
None.
OUTPUTS:
None. !path may be changed though.
OPTIONAL OUTPUTS:
INDEX -- Index of the removed directory in the !path.
KEYWORD PARAMETERS:
EXPAND -- Set this keyword to remove all subdirectories under
PATH_NAME from the IDL path.
CALLS:
STR_SEP, STR_COMB, REST_MASK, DATATYPE
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
Utilities, OS
PREVIOUS HISTORY:
Written October 7, 1994, by Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
Version 2, Liyun Wang, GSFC/ARC, October 19, 1994
Added the EXPAND keyword
VERSION:
Version 2, October 19, 1994
Project : SOHO - CDS Name : SETENV Purpose : Emulates the SETENV routine in VMS. Explanation : Converts the SETENV syntax used in Unix and Microsoft Windows to the equivalent SETLOG statement in VMS. Use : SETENV, EXPRESSION SETENV, 'ZDBASE=SYS$USER1:[CDS.DATA.PLAN.DATABASE]' Inputs : EXPRESSION = A scalar string containing the name of the environment variable to be defined, followed by the equals "=" character, and the value to set this environment variable to. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : None. Calls : DATATYPE Common : None. Restrictions: VMS-only. In Unix and Microsoft Windows, the built-in SETENV routine is used instead. Side effects: None. Category : Utilities, Operating_system. Prev. Hist. : None. Written : William Thompson, GSFC, 27 March 1995 Modified : Version 1, William Thompson, 27 March 1995 Version : Version 1, 27 March 1995
Project : SOHO - CDS Name : SPEC_DIR() Purpose : Appends a default disk or directory to a filename. Explanation : Provide a complete file specification by appending a default disk or directory if necessary. For Unix, SPEC_DIR will simply append the default directory obtained from the CD command (if necessary). Under VMS one must also determine if the disk and/or directory is already specified. Under VMS, SPEC_DIR will also try to translate disk and directory logical names. Use : File_spec = SPEC_DIR(filename,[extension]) Inputs : filename - character string giving partial specification of a file name. VMS examples include 'UIT$USER2:TEST.DAT', or '[.SUB]TEST'. Unix examples include '/home/idl/lib', or '$IDL_HOME/pro'. Opt. Inputs : exten - string giving a default file name extension to be used if filename does not contain one. Do not include the period. Outputs : File_spec - Complete file specification using default disk or directory when necessary. If the default directory is UIT$USER1:[IDL] then, for the above VMS examples, the output would be 'UIT$USER2:[IDL]TEST.DAT' 'UIT$USER2:[IDL.SUB]TEST'. Opt. Outputs: None. Keywords : None. Calls : FDECOMP Common : None. Restrictions: None. Side effects: None. Category : Utilities, Operating_System Prev. Hist. : Written W. Landsman STX July, 1987 Revised for use on VAXes and on SUNs, W. Landsman, STX August 1991 Written : W. Landsman, GSFC/UIT (STX), July 1987 Modified : Version 1, William Thompson, GSFC, 29 March 1994 Incorporated into CDS library Version : Version 1, 29 March 1994
PROJECT:
SOHO - CDS
NAME:
STRIP_DIRNAME()
PURPOSE:
Strip off directory name associated with filenames.
EXPLANATION:
Given a string array containing full filenames (including
directory paths), this routine will strip off directory names
and return only the file names.
CALLING SEQUENCE:
Results = STRIP_DIRNAME(full_names [,path=path])
INPUTS:
FULL_NAMES -- String array containing full names of files
including directory paths.
OPTIONAL INPUTS:
None.
OUTPUTS:
Results -- String array in which directory paths have beeb
stripped off from the full filename.
OPTIONAL OUTPUTS:
PATH -- An optional return variable that contains the stripped path
string of the file names.
KEYWORD PARAMETERS:
None.
CALLS:
None.
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
Utilities, os
PREVIOUS HISTORY:
Written September 19, 1994, by Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
Liyun Wang, GSFC/ARC, September 20, 1994
Added the PATH keyword.
VERSION:
Version 1, September 19, 1994
Project : SOHO - CDS Name : WHERENAN() Purpose : Finds positions of IEEE NaN values. Explanation : Finds the positions of all values within an array that correspond to the IEEE NaN (not-a-number) special values. The bit patterns of the numbers being tested are compared against the IEEE NaN standard. Use : Result = WHERENAN( ARRAY [, COUNT ] ) Inputs : ARRAY = Array to test against the IEEE NaN special values. Must be of either floating point, double-precision, or complex type. Opt. Inputs : None. Outputs : The result of the function is the indices of all values of ARRAY corresponding to the IEEE NaN specification, similar to the IDL WHERE function. Opt. Outputs: COUNT = Number of values found corresponding to IEEE NaN. Keywords : None. Calls : None. Common : None. Restrictions: ARRAY must be of type float, double-precision, or complex. Side effects: If no NaN values are found, or if ARRAY is not of type float, double precision, or complex, then -1 is returned, and COUNT is set to 0. Category : Utilities, Operating System. Prev. Hist. : William Thompson, Feb. 1992. William Thompson, Oct. 1992, fixed bug regarding order of bytes on VAX machines. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993.