subroutine orbit read_parameters # get parameters from param file OAL_odfInfo # get StartTime, EndTime of file open_outfile # open FITS output file addTable # create new table foreach column # create 10 new columns: time, x, y, z, Vx, Vy, Vz addColumn next for start_time to stop_time, step sampling_interval OAL_getPosition # return position and velocity vectors from ODF foreach column # time, x, y, z, Vx, Vy, Vz fill_column_temp_pointer if (column_temp_pointer(i) not defined) column_temp_pointer(i) = HUGE end if convert_GEI_to_GSE(time,gei_x,gei_y,gei_z,gse_x,gse_y,gse_z) ! gei_x,y,z : celestial x,y,z of XMM in km. ! gse_x,y,z : geo solar ecliptic x,y,z of XMM in km. ! lambda = ecliptic long of sun (radians) ! eta = obliquity of ecliptic (radians) ! The Sun's ecliptic longitude (lambdaO) can be calculated using the ! series of formulae: ! ! meanAnom = 357.528 + 35999.050T0 + 0.04107H degrees ! Lambda = 280.460 + 36000.772T0 + 0.04107H degrees ! lambdaO = Lambda + (1.915 - 0.0048T0) sinM + 0.020 sin2M ! ! where T0 is the time in Julian centuries from 12:00 UT on 1 January 2000 ! to the midnight Universal Time (UT) preceding the time of interest and ! H is the time in hours since that preceding UT midnight. Formulae ! derived from the Almanac for Computers. In the intermediate formulae, ! meanAnom is the Sun's mean anomaly and Lambda its mean longitude. ! ! M = 357.528+35999.050*Tzero+0.04107*UT; Sun's mean anomaly ! L = 280.460+36000.772*Tzero+0.04107*UT; Sun's mean longitude next next OAL_proposalInfo # get basic info to write as keywords write_attributes_to_outfile # add proposal info as keywords release Table # close FITS extension release Set # close FITS file OAL_releaseMemory # close ODF files close_outfile end subroutine orbit