;+
; PURPOSE:
;	To get the direction and distance of a source and any alias it might have on an NRH map.
;	Normally, only the alias due to the East-West network is worrisome, as they have longer baselines than the NS network.
;
; INPUT:
;	time: anytim
;	f : frequency [MHz]
;
; OUTPUTS:
;	v1: alias vector, in arcsecs, due to the East-West network
;	v2: alias vector, in arcsecs, due to the North-South network
;
; EXAMPLES:
;
;	nrh_alias_vector, '2002/02/20 09:50:08', 432, v1, v2 & PRINT, v1, v2
;
; RESTRICTIONS:
;	Needs to be called after the NRH image was constructed, because of some common variables...
;
; HISTORY:
;	PSH. Finished on 2010/06/11, after a LOT of blundering about...
;	Rewritten on 2010/09/05, following advice from Anne Bouteille and Claude Mercier.
;
;-
PRO nrh_alias_vector, t, f, $
	v1,v2

		
	hmsc = mil_time(anytim(t,/TIME_ONLY)*1d3)
	hmsc(3) = hmsc(3)/10.

	npi=128

	RH_MAILLE_3, npi,     f,   hmsc, $	; entree
		maille,  domega			; sortie
            ; entree: npi       nbre de pts sur l'image interferometrique.
            ;         frequence (MHz),
            ;         heure (h, m, s, c).
            ;         common MALAX, contenant entre autres new (defini par ie0,
            ;                        ie1, ie2) et nns (toujours 64).

	r1 = maille[2] - maille[0]		; unites  rayons solaires
	s1 = maille[3] - maille[1]
	r2 = maille[4] - maille[0]
	s2 = maille[5] - maille[1]

	;dist=interferometry_alias_distance(t, f)
	;v1=dist[0]* [r1,s1]/sqrt(r1^2 + s1^2)
	;v2=dist[1]* [r2,s2]/sqrt(r1^2 + s1^2)

	v1=[r1,s1]*64.*get_rb0p(anytim(t,/ECS),/RADIUS)
	v2=[r2,s2]*128.*get_rb0p(anytim(t,/ECS),/RADIUS)

END
