pro tle_subset_statistics, spacecraft_id, update_file=fname, plots=plots ; ; Report selected statistics on the Norad two-line orbit element ; file for the specified spacecraft_id ; ; B. Knapp, 2003-12-12 ; ; Obtain the consistent subset of the two-line elements get_tle_subset, spacecraft_id, $ tle_path='/mizar/proj/sorce/science_data_system/data/', $ n_all, n_sets, clsLvl, intlNo, eltSet, ephTyp, orbit, epochJd, $ dndt, d2ndt2, bstar, incl, node, e, omega, m, n, status ; ; Mission day case spacecraft_id of 21701: epoch = ud2jd(0) 27651: epoch = sd2jd(0) else: begin message,'Unknown spacecraft_id: '+string(spacecraft_id),/info return end endcase md = epochJd-epoch today = vms2jd(!stime)-epoch ; ; Maximum day number that may be processed max_day = long(md[n_sets-3])-1 ; ; Investigate the spacing of the TLE's dt = (shift(md,-1)-md)[0:n_sets-2] mom = moment(dt,sdev=std_dev) med = median(dt,/even) ; Print report print, today, md[n_sets-1], max_day, fix(today)-max_day, status, $ n_all, n_sets, mom[0], std_dev, med, min(dt), max(dt), $ format = "(2f8.2, i5, 2i3, 2i5, 5f5.2)" if n_elements(fname) ne 0 then begin openu, lun, fname, /append, /get_lun printf, lun, today, md[n_sets-1], max_day, fix(today)-max_day, status, $ n_all, n_sets, mom[0], std_dev, med, min(dt), max(dt), $ format = "(2f8.2, i5, 2i3, 2i5, 5f5.2)" close, lun free_lun, lun endif ; ; Plot? if keyword_set(plots) then begin get_dev,dev plot,md[0:n_sets-2],dt,psym=3, $ title=string(spacecraft_id, today, $ "('Spacecraft ',i5,', TLE deltaT, as of ',f8.2)"), $ xtitle='Mission Day', ytitle = 'dt' send_plots,dev endif ; return end