/usr/share/gnudatalanguage/astrolib/fxbtdim.pro is in gdl-astrolib 2018.02.16+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | FUNCTION FXBTDIM, TDIM_KEYWORD
;+
; NAME:
; FXBTDIM()
; Purpose :
; Parse TDIM-like kwywords.
; Explanation :
; Parses the value of a TDIM-like keyword (e.g. TDIMnnn, TDESC, etc.) to
; return the separate elements contained within.
; Use :
; Result = FXBTDIM( TDIM_KEYWORD )
; Inputs :
; TDIM_KEYWORD = The value of a TDIM-like keyword. Must be a
; character string of the form "(value1,value2,...)".
; If the parentheses characters are missing, then the
; string is simply returned as is, without any further
; processing.
; Opt. Inputs :
; None.
; Outputs :
; The result of the function is a character string array containing the
; values contained within the keyword parameter. If a numerical result
; is desired, then simply call, e.g.
;
; Result = FIX( FXBTDIM( TDIM_KEYWORD ))
;
; Opt. Outputs:
; None.
; Keywords :
; None.
; Calls :
; GETTOK
; Common :
; None.
; Restrictions:
; The input parameter must have the proper format. The separate values
; must not contain the comma character. TDIM_KEYWORD must not be an
; array.
; Side effects:
; None.
; Category :
; Data Handling, I/O, FITS, Generic.
; Prev. Hist. :
; William Thompson, Jan. 1992.
; William Thompson, Jan. 1993, renamed to be compatible with DOS
; limitations.
; Written :
; William Thompson, GSFC, January 1992.
; Modified :
; Version 1, William Thompson, GSFC, 12 April 1993.
; Incorporated into CDS library.
; Version :
; Version 1, 12 April 1993.
; Converted to IDL V5.0 W. Landsman September 1997
;-
;
ON_ERROR,2
;
; Make sure TDIM_KEYWORD is not an array.
;
IF N_ELEMENTS(TDIM_KEYWORD) NE 1 THEN MESSAGE, $
'TDIM_KEYWORD must be a scalar'
;
; Remove any leading or trailing blanks from the keyword.
;
TDIM = STRTRIM(TDIM_KEYWORD,2)
;
; The first and last characters should be "(" and ")". If they are not, then
; simply return the string as is.
;
FIRST = STRMID(TDIM,0,1)
LAST = STRMID(TDIM,STRLEN(TDIM)-1,1)
IF (FIRST NE "(") OR (LAST NE ")") THEN RETURN,TDIM
;
; Otherwise, remove the parentheses characters.
;
TDIM = STRMID(TDIM,1,STRLEN(TDIM)-2)
;
; Get the first value.
;
VALUE = GETTOK(TDIM,',')
;
; Get all the rest of the values.
;
WHILE TDIM NE '' DO VALUE = [VALUE,GETTOK(TDIM,',')]
;
; Return the (string) array of values.
;
RETURN,VALUE
END
|