Viewing contents of file '../idllib/contrib/icur/dmstodeg.pro'
;**********************************************************************
function dmstodeg,d,dm,ds
if n_params(0) eq 2 then ds=0.
if n_params(0) eq 1 then begin
   if n_elements(d) lt 3 then return,-999
   dm=abs(d(1)) & ds=abs(d(2)) & d=d(0)
   endif
s=size(d)
if s(0) eq 0 then begin     ;scalar
   IF D NE 0 THEN ISIGN=D/ABS(D) ELSE BEGIN  ;DEC=+/-0
      IF DM NE 0 THEN ISIGN=DM/ABS(DM) ELSE BEGIN   ;MIN=0
         IF DS NE 0 THEN ISIGN=DS/ABS(DS) ELSE ISIGN=1.
         ENDELSE
      ENDELSE 
   endif else begin          ;array
   isign=fltarr(n_elements(d))+1.
   k=where((d lt 0) or (dm lt 0) or (ds lt 0.))
   if k(0) ne -1 then isign(k)=-1.
   endelse
DELTA=ISIGN*(ABS(D)+ABS(DM)/60.+ABS(DS)/3600.)
return,delta
end