function V4XS2SC,in,verbose=v,index=ix,outdex=ox,ocoords=ocoords ;;; ;;; Check out input keywords for existence... ;;; if (isvalid(ix) or isvalid(ox)) then $ if(total(where( (ix ne [0,1,2,3]) or (ox ne [0,1,2,3]) )) ge 0) then $ print,"WARNING - V4XS2SC - ignoring indexing!" v = keyword_set(v) ix = [0,1,2,3] ox = ix iu = ix+5 ou = ox+5 ;;; ;;; Calculate the Earth-Sun distance... r = sunearthdist(in.(ix(0)),in.(iu(3))) if(v) then print,"V4XCS2SC: earth-sun distance is ",r,in.(iu(3)) ;;; ;;; Place the plane of the sky at the Sun if radius is undefined. i2 = in if(not (i2.defined)(3)) then i2.(3) = r ;;; ;;; Convert from Earth spherical to Earth-centered Cartesian... i2 = v4xsph2cart(i2,v=v,index=[0,1,2,3],outdex=[0,3,1,2],ocoord="blecch") if not data_chk(i2,/struct) then return,0 ;;; ;;; Translate the origin from the Earth to the Sun... i2.(ix(3)) = r - i2.(ix(3)) i2.coords="Solar Cartesian" i2 = v4canon(i2) return,i2 end