; docformat = 'rst' ; ; NAME: ; genoidPlotOrbit ; PURPOSE: ; Read a Genoid Parameter VOTable and store its content in a structure ; ;+ ; :Description: ; Read a Genoid Parameter VOTable and store its content in a structure ; ; :Categories: ; Disk I/O, Genoid ; ; :Params: ; file: in, required, type=string ; The path to the VOTable to be read ; ; :Keywords: ; empty: in, optional, type=integer, default=0 ; If non-zero, skip reading and return an array of "empty" elements. ; ; :Returns: A structure containing the VOTable. Fields are:: ; ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in June 2017, B. Carry (OCA) ;- function genoidPlotOrbit, file, spin, xyz=xyz file = 'genoide.binast.v1.1.xml' spin = '../out-koala.spin' sat = genoidReadParam(file,/sat) iSpin=readSpin(spin) N=1000 theta = 2*!PI * findgen(N)/N a = float(sat.orbit.a.val) e = float(sat.orbit.e.val) peri = float(sat.orbit.argPeri.val) node = float(sat.orbit.longNode.val) i = float(sat.orbit.i.val) ; print, 'peri (km): ', a*(1-e) ; print, 'aph (km): ', a*(1+e) r = a*(1-e*e) / (1 + e*cos(theta) ) xy = cv_coord(from_polar=transpose([[theta],[r]]), /to_rect ) x = xy[0,*] y = xy[1,*] z = x*0 T3D, /reset T3D, rotate=[0,0,peri] xyz0 = transpose([ [[x]], [[y]], [[z]] ], [2,1,0]) xyz1 = vert_t3d(xyz0) T3D, /reset T3D, rotate=[i,0,0] xyz2 = vert_t3d(xyz1) T3D, /reset T3D, rotate=[0,0,node] xyzEQ = vert_t3d(xyz2) raDec = frameCoord_ec2eq(iSpin.lon, iSpin.lat) ; print, iSpin.lon, iSpin.lat ; print, raDec T3D, /reset T3D, rotate=[0,0,-raDec[0]] xyz1 = vert_t3d(xyzEQ) T3D, /reset T3D, rotate=[0,raDec[1]-90,0] ; T3D, rotate=[0,0,0] xyzAST = vert_t3d(xyz1) ;;; xyzAST = orientModel( xyzEQ, iSpin, 0 ) ; ; rr=[-1,1]*a*1.3 ; window, 0, title='x vs y', xsize=600, ysize=600 ; cgPlot, xyzEQ[0,*], xyzEQ[1,*], xRange=rr, yRange=rr ; cgPlot, /OverPlot, 0,0,psym='filled circle', symsize=2 ; ; ; window, 1, title='x vs z', xsize=600, ysize=600 ; cgPlot, xyzEQ[0,*], xyzEQ[2,*], xRange=rr, yRange=rr ; cgPlot, /OverPlot, 0,0,psym='filled circle', symsize=2 ; ; ; window, 2, title='y vs z', xsize=600, ysize=600 ; cgPlot, xyzEQ[1,*], xyzEQ[2,*], xRange=rr, yRange=rr ; cgPlot, /OverPlot, 0,0,psym='filled circle', symsize=2 ; ; ; ;stop ; ; window, 0, title='x vs y', xsize=600, ysize=600 ; cgPlot, xyzAST[0,*], xyzAST[1,*], xRange=rr, yRange=rr ; cgPlot, /OverPlot, 0,0,psym='filled circle', symsize=2 ; ; ; window, 1, title='x vs z', xsize=600, ysize=600 ; cgPlot, xyzAST[0,*], xyzAST[2,*], xRange=rr, yRange=rr ; cgPlot, /OverPlot, 0,0,psym='filled circle', symsize=2 ; ; ; window, 2, title='y vs z', xsize=600, ysize=600 ; cgPlot, xyzAST[1,*], xyzAST[2,*], xRange=rr, yRange=rr ; cgPlot, /OverPlot, 0,0,psym='filled circle', symsize=2 if keyword_set(xyz) then begin ;stop ; forprint, xyzEQ[0,*], xyzEQ[1,*], xyzEQ[2,*], textout='orbit-xyzEQ.csv', $ ; format='(F10.3,",",F10.3,",",F10.3)', comment='X,Y,Z', /Silent; forprint, xyzAST[0,*], xyzAST[1,*], xyzAST[2,*], textout=xyz, $ format='(F10.3,",",F10.3,",",F10.3)', comment='X,Y,Z', /Silent endif end