/usr/share/gnudatalanguage/astrolib/sxgread.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 | function sxgread,unit,group
;+
; NAME:
; SXGREAD
; PURPOSE:
; Read group parameters from a Space Telescope STSDAS image file
;
; CALLING SEQUENCE:
; grouppar = sxgread( unit, group )
;
; INPUTS:
; UNIT = Supply same unit as used in SXOPEN.
; GROUP = group number to read. if omitted, read first group.
; The first group is number 0.
;
; OUTPUTS:
; GROUPPAR = parameter values from fits group parameter block.
; It is a byte array which may contain multiple data types.
; The function SXGPAR can be used to retrieve values from it.
;
; COMMON BLOCKS:
; Uses IDL Common STCOMMN to access parameters.
; SIDE EFFECTS:
; IO is performed.
; MODIFICATION HISTORY:
; WRITTEN, Don Lindler, July, 1 1987
; MODIFIED, Don Neill, Jan 11, 1991 - derived from sxread.pro
; Converted to IDL V5.0 W. Landsman September 1997
;-
On_error,2
;
; common block containing description of file (see SXOPEN)
;
common stcommn,result,filename
;
; check if unit open
;
if (unit lt 1) or (unit gt 9) then $
message,'Invalid unit number, must be between 1 and 9'
if N_elements(result) eq 0 then result = 0
if (N_elements(result) ne 200) or (result[0,unit] ne 121147) then $
message,'Specified unit is not open'
desc = result[*,unit] ;description for unit
;
; default group number is 0 (first group)
;
if N_params() eq 1 then group = 0
;
; read group parameters
;
parrec = assoc(UNIT,bytarr(desc[7]),(group+1)*desc[9]-desc[7])
par = parrec[0]
;
return,par
end
|