06/23/98 VIC Program Reference ===================== Summary ------- - read_vicar Reads a vicar data file. - vicgetpar Reads the value of a VICAR label keyword. - vicsetpar Add, delete, or change a keyword/value pair in a VICAR label. - write_vicar Writes a vicar data file. READ_VICAR ---------- PURPOSE: Reads a vicar data file. CATEGORY: UTIL/VIC CALLING SEQUENCE: data = read_vicar(filename, label) ARGUMENTS: INPUT: filename: String giving the name of the file to be read. OUTPUT: label: Named variable in which the vicar label will be returned. KEYWORDS: INPUT: n_l: If set, this will override the number of lines given by the 'NL' field of the label. n_s: If set, this will override the number of samples given by the 'NS' field of the label. n_b: If set, this will override the number of bands given by the 'NB' field of the label. nlb: If set, this will override the number of binary header records given by the 'NLB' field of the label. nbb: If set, this will override the number of binary prefix bytes given by the 'NBB' field of the label. silent: If set, no messages are printed. swap: If set, the data array will be byte-swapped. flip: If set, the data array will be subjected to a rotate(data, 7), i.e., if its an image, it will be flipped vertically. default_format: Data format to use if not given in the label. choices are 'BYTE', 'HALF', 'FULL", 'REAL', and 'DOUB'. default is 'BYTE'. OUTPUT: status: If no errors occur, status will be zero, otherwise it will be a string giving an error message. RETURN: The data array read from the file. RESTRICTIONS: This program only works with band-sequential data and does not recognize EOF labels. STATUS: Complete SEE ALSO: write_vicar MODIFICATION HISTORY: Written by: Spitale, 10/1995 VICGETPAR --------- PURPOSE: Reads the value of a VICAR label keyword. CATEGORY: UTIL/VIC CALLING SEQUENCE: value = vicgetpar(label, keyword) ARGUMENTS: INPUT: label: String array giving the VICAR label. keyword: String giving the keyword whose value is to be obtained. OUTPUT: NONE KEYWORDS: INPUT: string: If set, the value will be returned as the exact string read from the label instead of converting it based quotes. OUTPUT: pos: Position of keyword in label. status: If no errors occur, status will be zero, otherwise it will be a string giving an error message. If the keyword is not found, status will contain a message. RETURN: The data array read from the file. STATUS: Complete SEE ALSO: vicsetpar MODIFICATION HISTORY: Written by: Spitale, 5/1996 VICSETPAR --------- PURPOSE: Add, delete, or change a keyword/value pair in a VICAR label. CATEGORY: UTIL/VIC CALLING SEQUENCE: vicsetpar, label, keyword, value ARGUMENTS: INPUT: label: String array giving the VICAR label. keyword: String giving the keyword whose value is to be set. If the keyword is not found, it will be added. value: Value for the given keyword. OUTPUT: NONE KEYWORDS: INPUT: delete: If set, the keyword/value pair will be deleted from the label, if found. OUTPUT: pos: Position at which the keyword was placed in the label. status: If no errors occur, status will be zero, otherwise it will be a string giving an error message. RETURN: NONE STATUS: Complete SEE ALSO: vicgetpar MODIFICATION HISTORY: Written by: Spitale, 5/1996 WRITE_VICAR ----------- PURPOSE: Writes a vicar data file. CATEGORY: UTIL/VIC CALLING SEQUENCE: write_vicar, filename, data, label ARGUMENTS: INPUT: filename: String giving the name of the file to be written. data: Data to be written. label: String giving the vicar label. System items will be added or changed as appropriate. OUTPUT: NONE KEYWORDS: INPUT: silent: If set, no messages are printed. swap: If set, the data array will be byte-swapped. flip: If set, the data array will be subjected to a rotate(data, 7), i.e., if its an image, it will be flipped vertically. OUTPUT: status: If no errors occur, status will be zero, otherwise it will be a string giving an error message. RETURN: NONE RESTRICTIONS: This program only writes band-sequential data with no binary header or prefixes. STATUS: Complete SEE ALSO: read_vicar MODIFICATION HISTORY: Written by: Spitale, 5/1996