; read a Minor Planet Circular file function mpc_getline, nelem, fn=fn if not keyword_set(fn) then begin endif form = '('+ $ ' A7, 1X' + $; Number or provisional designation (in packed form) ',F5.2, 1X' + $; Absolute magnitude, H ',F5.2, 1X' + $; Slope parameter, G ',A5, 1X' + $; Epoch (in packed form, .0 TT) ',F9.5, 2X' + $; Mean anomaly at the epoch, in degrees ',F9.5, 2X' + $; Argument of perihelion, J2000.0 (degrees) ',F9.5, 2X' + $; Longitude of the ascending node, J2000.0 (degrees) ',F9.5, 2X' + $; Inclination to the ecliptic, J2000.0 (degrees) ',F9.7, 1X' + $; Orbital eccentricity ',F11.8, 1X'+ $; Mean daily motion (degrees per day) ',F11.7, 2X'+ $; Semimajor axis (AU) ',A1, 1X' + $; Uncertainty parameter, U ',A9, 1X' + $; Reference ',A5, 1X' + $; Number of observations ',I3, 1X' + $; Number of oppositions ',I4 ' + $; Year of first observation or arclen (days) ',A1 ' + $; ',-' or empty ',A4, 1X' + $; Year of last observation or 'days' ',F4.2, 1X' + $; r.m.s residual (") ',A3, 1X' + $; Coarse indicator of perturbers ',A3, 1X' + $; Precise indicator of perturbers ',A10, 1X' + $ ; Computer name ',Z4, 1X' + $ ; 4-hexdigit flags ',A28, 1X' + $ ; Readable designation ',I8' + $ ; Date of last observation included in orbit solution ')' readfmt, fn, form, $ id, H, G, Epoch_packed, M, APF, LAN, i, e, n, A, $ u, ref, nobs, nopp, yrfirst, dash, yrlast, rms, pertc, pertp, comp, $ flags, desig, lastobs ;Error reading line 369 ;Error reading line 370 ;Error reading line 399 nelem = n_elements(id) elem1 = { id:'', elem:dblarr(7), type:0, desig:'', h:h} elems = replicate(elem1, nelem) for ielem = 0, nelem-1 do begin elems[ielem].id = id[ielem] elems[ielem].h = h[ielem] epoch = jdparse(unpack_mpcepoch(Epoch_packed[ielem])) tau = epoch - m[ielem]/n[ielem] ; Julian Date of last periapsis elems[ielem].elem[0] = e[ielem] elems[ielem].elem[1] = i[ielem] elems[ielem].elem[2] = LAN[ielem] elems[ielem].elem[3] = APF[ielem] elems[ielem].elem[4] = tau elems[ielem].elem[5] = n[ielem] elems[ielem].elem[6] = a[ielem] elems[ielem].type = (flags[ielem]) and (64-1) ; ; 10 Centaur ; 14 Plutino ; 15 Other resonant TNO ; 16 Cubewano ; 17 Scattered disk elems[ielem].desig = desig[ielem] end return, elems end