
;       (22-may-92)
  function dr, item, nrots=nrots, lat=lat, method=method
;+
; NAME:
;       DR
;
; PURPOSE:
;	Calculate the time and date corresponding to NROTS solar rotations
;	(may be negative and/or fractional) from position at reference
;	time (determined from INDEX).  Latitude dependence is not
;	available for all rates.
;
; CATEGORY:
;       Solar astronomy trivia.
;
; CALLING SEQUENCE:
;	new_time = dr(index[, nrots=nrots, lat=lat, method=method])
;
; INPUTS:
;       ITEM    	A structure (INDEX or ROADMAP) or time vector
;			(7 element external time).  It can be an array.
;
; OPTIONAL INPUT PARAMETERS:
;       None.
;
; KEYWORDS:
;       NROTS:		Number of solar rotations (may be negative
;			and/or fractional).
;	LAT:		Latitude to use for latitude dependent rotation
;			rates.
;	METHOD:		Method used for rate determination.  Methods
;			currently available are:
;			- PHOTO: photosheric (spectroscopic) 
;			- CARRI: Carrington rotation rate
;			- CORHO: coronal holes
;			- SPOTS: spot groups
;		
; OUTPUTS:
;	NEW_TIME	Time and date of occurrence in FMT_TIM format.
;
; COMMON BLOCKS:
;       None.
;
; SIDE EFFECTS:
;       None.
;
; RESTRICTIONS:
;       None.
;
; PROCEDURE:
;       For photospheric rotation, the rotation equation of Howard and
;	Harvey (1970) is used:
;
;	omega =  2.78(+/-0.003) - 0.351(+/-0.03)*sin(beta)^2
;		+0.443(+/-0.05)*sin(beta)^4	microradians/sec
;
; EXAMPLE:
;
; MODIFICATION HISTORY:
;       May, 1992.     Written by GLS, LMSC.
;
;-

  if n_elements(nrots) eq 0 then nrots = 1.0
  if n_elements(lat) eq 0 then lat = 0.
  if n_elements(method) eq 0 then method = 'PHOTO'
  method = strupcase(method)

  case method of
    'PHOTO': del_t = dr_photo(lat,nrots*360.,/ang2tim)
    'CARRI': del_t = dr_carr(lat,nrots*360.,/ang2tim)
;    'CORHO': del_t = dr_corho(lat,nrots*360.,/ang2tim)
;    'SPOTS': del_t = dr_spots(lat,nrots*360.,/ang2tim)
  else: stop, ' Invalid value for METHOD.'
  endcase

  new_time = fmt_tim(addtime(anytim2ex(item),delta_min=del_t*24.*60.))

  return, new_time
  end

