;+ ; NAME: ; oc_getstar_ucac2mpos ; PURPOSE: (one line) ; return lines in an UCAC2 mpos file ; DESCRIPTION: ; return lines in an UCAC2 mpos file given id (id = line number, 1-indexed) ; CATEGORY: ; occultation ; CALLING SEQUENCE: ; star = oc_getstar_ucac2mpos, filename, ids, count=count, VERBOSE=verbose ; INPUTS: ; filename = mpos file ; id = list of ids (line numbers) ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; verbose = print out error messages ; KEYWORD OUTPUT PARAMETERS: ; count = number of lines found ; OUTPUTS: ; the lines for the id's ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; None ; PROCEDURE: ; MODIFICATION HISTORY: ; January 7, 2006 Leslie Young, SwRI ; Mar 10, 2006 LAY. Added "all", moved into $idl/lyoung ;- ;0 1 2 3 4 ;0123456789012345678901234567890123456789012345 ; 947037739 268695853 1600 20 14 42 0 8414$ function oc_getstar_ucac2mpos, filename, ids, count=count, $ VERBOSE=verbose, ALL=all lines = oc_getline_ucac2mpos(filename, ids, count=count, $ VERBOSE=verbose, ALL = all) nline = n_elements(lines) if nline eq 0 then begin count = 0 return, -1 end ; a blank ucac2mpos structure ucac2mpos = {record: '', $ ramas:-999L, $ ; right asc.in mas (on ICRF = J2000 system) spmas:-999L, $ ; south-pole distance in mas mag: -999L, $ ; internal UCAC magnitude (about V to R) $ ; in 1/100 sx: -999L, $ ; formal, internal error of mean position $ ; in mas (RA) sy: -999L, $ ; formal, internal error of mean position $ ; in mas (dec) nobs: -999L, $ ; number of observations (CCD frames) $ ; used for mean position flg: -999L, $ ; flag epoch:-999L $ ; mean observion epoch in 1/1000 year after $ ; 1997.0, thus 8328 is 2005.328 } star1 = struct_addfield(oc_star_new(), 'ucac2mpos', ucac2mpos) star = replicate(star1, nline) et0 = (1997.d - 2000.d) * cspice_jyear() ; et for epoch = 0 myear = 1d-3 * cspice_jyear() ; seconds in 1/1000 year mas = !dpi / (180.d * 3600.d * 1d3) ; radian in milliarcsec for i = 0L, nline-1 do begin l = lines[i] if strlen(strtrim(l,2)) gt 0 then begin s = star[i] s.ucac2mpos.record = l s.ucac2mpos.ramas = long(strmid(l, 0,strlen(' 947037739'))) s.ucac2mpos.spmas = long(strmid(l,10,strlen(' 268695853'))) s.ucac2mpos.mag = long(strmid(l,20,strlen(' 1600'))) s.ucac2mpos.sx = long(strmid(l,25,strlen(' 20'))) s.ucac2mpos.sy = long(strmid(l,29,strlen(' 14'))) s.ucac2mpos.nobs = long(strmid(l,33,strlen(' 42'))) s.ucac2mpos.flg = long(strmid(l,37,strlen(' 0'))) s.ucac2mpos.epoch = long(strmid(l,41,strlen(' 8414'))) s.idcat = filename s.id = string(ids[i]) s.poscat = s.idcat s.et = et0 + s.ucac2mpos.epoch * myear s.ra = s.ucac2mpos.ramas * mas s.dec = s.ucac2mpos.spmas * mas - !dpi/2. s.raerr = s.ucac2mpos.sx * mas s.decerr = s.ucac2mpos.sy * mas s.magcat = [s.idcat] s.magname = ['UCAC'] s.mag = [s.ucac2mpos.mag/100.d] star[i] = s end endfor return, star end