/usr/share/gnudatalanguage/astrolib/cirrange.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 | PRO cirrange, ang, RADIANS=rad
;+
; NAME:
; CIRRANGE
; PURPOSE:
; To force an angle into the range 0 <= ang < 360.
; CALLING SEQUENCE:
; CIRRANGE, ang, [/RADIANS]
;
; INPUTS/OUTPUT:
; ang - The angle to modify, in degrees. This parameter is
; changed by this procedure. Can be a scalar or vector.
; The type of ANG is always converted to double precision
; on output.
;
; OPTIONAL INPUT KEYWORDS:
; /RADIANS - If present and non-zero, the angle is specified in
; radians rather than degrees. It is forced into the range
; 0 <= ang < 2 PI.
; PROCEDURE:
; The angle is transformed between -360 and 360 using the MOD operator.
; Negative values (if any) are then transformed between 0 and 360
; MODIFICATION HISTORY:
; Written by Michael R. Greason, Hughes STX, 10 February 1994.
; Get rid of WHILE loop, W. Landsman, Hughes STX, May 1996
; Converted to IDL V5.0 W. Landsman September 1997
;-
On_error,2
if N_params() LT 1 then begin
print, 'Syntax: CIRRANGE, ang, [ /RADIANS ]'
return
endif
; Determine the additive constant.
if keyword_set(RAD) then cnst = !dpi * 2.d $
else cnst = 360.d
; Deal with the lower limit.
ang = ang mod cnst
; Deal with negative values, if any
neg = where(ang LT 0., Nneg)
if Nneg GT 0 then ang[neg] = ang[neg] + cnst
return
end
|