;+ ; NAME: ; big_elongation ; PURPOSE: ; Calculate elongations between to directions in the sky ; CATEGORY: ; gen/idl/ephem ; CALLING SEQUENCE: FUNCTION big_elongation, ut , $ center = center , $ body = body , $ ephemeris = ephemeris , $ degrees = degrees , $ rectangular = rectangular , $ silent = silent , $ _extra = _extra ; INPUTS: ; ut array[1]; time structure ; OPTIONAL INPUT PARAMETERS: ; center=center ; scalar; type: string ; default: big_body('earth') ; body=body scalar; type: string ; default: big_body('sun' ) ; ephemeris location for which elongation is requested ; default: big_body('mars') ; scalar; type: string ; array[2],array[2,n]; long/lat arrays ; array[3],array[3,n]; long/lat/dis arrays ; array[3],array[3,n]; rectangular coordinates ; OUTPUTS: ; Result scalar or array; ; elongation ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, IsType, big_body, big_eph, sphere_distance ; PROCEDURE: ; One line of sight is defined by 'center' and 'body', and ; is the ephemeris for body 'body' relative to body ; 'center' at time 'ut' as returned by big_eph. ; So, by default, this is the geocentric location of the ; the Sun. ; ; If 'ephemeris' is a string 'scalar', the second line of ; sight is the ephemeris of body 'ephemeris' relative to ; body 'center' at time 'ut' as returned by big_eph. ; ; Alternatively, ephemeris is a numeric array containing ; equatorial coordinates to one or more locations in the ; sky. ; MODIFICATION HISTORY: ; NOV-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, center , big_body('earth') InitVar, body , big_body('sun' ) InitVar, ephemeris , big_body('mars' ) InitVar, rectangular, /key CASE IsType(ephemeris,/string) OF 0: BEGIN los1 = ephemeris IF NOT rectangular THEN BEGIN IF (size(los1,/dim))[0] EQ 2 THEN boost, los1, plus=1, value=1 los1 = cv_coord(from_sphere=los1,/to_rect,degrees=degrees) ENDIF los1 = CvSky(ut,los1,_extra=_extra,/rectangular,/to_equator,degrees=degrees) END 1: BEGIN los1 = big_eph( ut , $ body = ephemeris , $ center = center , $ silent = silent , $ /to_equator , $ /onebody ) END ENDCASE los2 = big_eph( ut , $ body = body , $ center = center , $ silent = silent , $ /to_equator , $ /onebody ) RETURN, sphere_distance(los1,los2,/rectangular,degrees=degrees) & END