; docformat = 'rst' ; ; NAME: ; FRAMECOORD_EC2EQ ; PURPOSE: ; Convert Ecliptic coordinates in Equatorial coordinates or reverse ; ;+ ; :Description: ; Convert Ecliptic coordinates in Equatorial coordinates or reverse ; ; :Categories: ; Coordinates, Convertion ; ; :Params: ; EC1: in, required, type=float ; A two-elements vector with ecliptic coordinates (deg). If ; EC2 is set, then EC1 must contain a single element only (longitude). ; EC2: in, optional, type=float ; The latitude can be alternatively provided here (deg). ; ; :Returns: A two-elements vector with coordinates converted in EQuatorial (deg). ; ; :Keywords: ; EC_TO_EQ: in, optional, type=boolean, default=1 ; If set, transforms ECliptic coordinates into EQuatorial ; ; EQ_TO_EC: in, optional, type=boolean, default=0 ; If set, transforms EQuatorial coordinates into ECliptic ; ; VERBOSE: in, optional, type=boolean, default=0 ; If set, prints coordinate in standard output ; ; :Examples: ; Prints several convertions:: ; IDL> print, framecoord_EC2EQ( 0., 0. ) ; IDL> print, framecoord_EC2EQ( [0., 0.] ) ; IDL> print, framecoord_EC2EQ( [210., +20.] ) ; ; :Uses: ; framecoord_eq2ec ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in July 2008, B. Carry (ESO/LESIA) ; 2013-Nov.: B.Carry (IMCCE) - Allows input coords in two variables ; 2017 Feb.: B.Carry (OCA) - Input arrays are possible ; ;- function frameCoord_EC2EQ, EC1, EC2, EC_TO_EQ=EC_TO_EQ, EQ_TO_EC=EQ_TO_EC, VERBOSE=VERBOSE ;-------------------------------------------------------------------------------- ;--I-- Input verification and Initialization ----------------------------------- COMPILE_OPT hidden ;--I-- Coordinates Provided in one or two Variables if keyword_set(EC2) then coord=transpose([[EC1],[EC2]]) else coord=EC1 ;-------------------------------------------------------------------------------- ;--II-- Coordinate Convertion using FRAMECOORD_EQ2EC ---------------------------- if keyword_set(verbose) then begin if keyword_Set(EQ_TO_EC) then return, framecoord_eq2ec(coord, /VERBOSE) $ else return, framecoord_eq2ec(coord, /VERBOSE, /EC_TO_EQ) endif else begin if keyword_Set(EQ_TO_EC) then return, framecoord_eq2ec(coord) $ else return, framecoord_eq2ec(coord, /EC_TO_EQ) endelse end