;+ ; NAME: ; oc_search_eph_hd_hbt_test ; ; PURPOSE: (one line) ; End-to-end test of HD ephemeris-searching routines, and TYC2-HD matching. ; ; DESCRIPTION: ; Reads in an ephemeris for Jupiter, and searches the HD catalog ; for stars which pass near it. The HD stars are matched with their ; TYC2 counterparts, and the results plotted at each timestep. ; ; Routine uses the subcatalog search, not the full catalog search. The ; subcatalog takes longer the first time, but is substantially faster on ; subsequent runs. ; ; Subsequent runs take ~15 minutes -- it still is a long search. ; ; CATEGORY: ; Occultations ; ; CALLING SEQUENCE: ; oc_search_eph_hd_hbt_test [, /VERBOSE] ; ; INPUTS: ; None ; ; OPTIONAL INPUT PARAMETERS: ; None ; ; KEYWORD INPUT PARAMETERS: ; /VERBOSE -- If set, print diagnostics to screen. ; ; KEYWORD OUTPUT PARAMETERS: ; None ; ; OUTPUTS: ; None ; ; COMMON BLOCKS: ; None ; ; SIDE EFFECTS: ; None ; ; RESTRICTIONS: ; File $HDOCCUL/sav/jupiter_20071201_20080715_144.000.sav must exist. ; Directory $HDOCCUL_TMP must exist. ; ; EXAMPLE: ; oc_search_eph_hd_hbt_test ; ; MODIFICATION HISTORY: ; Written 9-Dec-2005 by H. Throop, SwRI ; Modified 13-Mar-2006 by HBT. Improved documentation and formatting. ; Renamed oc_search_eph_hbt -> oc_search_eph_hd_hbt_test. ; Modified 14-Mar-2006 by HBT. Brought plotting and TYC2 matching from ; oc_search_eph_hd_hbt.pro into here, where they belong. ;- pro oc_search_eph_hd_hbt_test, VERBOSE=verbose arcmin = !dpi/(180d*60d) ; radian/arcmin miss = 20d*arcmin file = 'jupiter_20071201_20080715_144.000.sav' dir = getenv('HDOCCUL') + '/sav/' print, 'Restoring: ' + dir+file restore, dir + file stars_hd = oc_search_eph_hd_hbt(eph, ephindex, nstars, MISS=miss, $ RADIUS=radius, VERBOSE=verbose) ; Match the HD stars with TYC2 stars if (nstars eq 0) then begin print, 'Zero stars found' stop end stars_tyc2_hd = oc_getrec_tyc2_hd(hd=stars_hd.id, VERBOSE=verbose) stars_tyc2 = oc_getstar_tyc2(stars_tyc2_hd.tyc, VERBOSE=verbose) stars_merged = mergestars_tyc2_hd(stars_tyc2, stars_tyc2_hd, $ stars_hd, nstars=nstars_tyc2, VERBOSE=verbose) stars = stars_merged hd = stars.hd tyc2 = stars.tyc2 num_tyc2 = sizex(tyc2) - total(oc_star_isempty(tyc2)) num_hd = sizex(hd) - total(oc_star_isempty(hd)) if keyword_set(VERBOSE) then print, ' Matched ' + $ st(nstars_tyc2) + ' TYC2 stars' ; Plot the results cx = radius*cos(findgen(361.)*!pi/180) ; Circle cy = radius*sin(findgen(361.)*!pi/180) colors color_hd = 1 color_tyc2 = 2 sym_plus = 1 sym_star = 2 xmin = min( [reform(eph.ra)] )-radius xmax = max( [reform(eph.ra)] )+radius ymin = min( [reform(eph.dec)])-radius ymax = max( [reform(eph.dec)])+radius plot, [eph.ra], [eph.dec], xrange=[xmin,xmax], $ yrange=[ymin, ymax], $ xtitle = 'RA [radians]', ytitle = 'Dec [radians]', $ subtitle = 'Search Radius = ' + st(radius/arcmin) + ' arcmin', $ title = 'HD + TYC2, ' + file oplot, eph[0].ra+cx, eph[0].dec+cy legend, /top, /right, box=0, color=[color_tyc2, color_hd], $ psym=[sym_star, sym_star], $ ['Tyc2, ' + st(num_tyc2) + ' stars', 'HD, ' + st(num_hd) + ' stars'] oplot, [eph.ra], [eph.dec], psym=sym_plus if nstars gt 1 then begin oplot, [stars[*].ra], [stars[*].dec], psym=sym_star, $ color=color_tyc2 oplot, [stars[*].ra], [stars[*].hd.dec], psym=sym_star, $ color=color_hd end ; Break down how many TYC2 and HD stars we matched print, 'Searched ' + st(sizex(eph)) + $ ' ephemeris points, with search radius ' + st(radius/arcmin) + $ ' arcmin.' print, 'Found ' + st(sizex(stars)) + ' stars.' print, 'Unique HD stars = ' + st(num_hd) + $ '; unique TYC2 stars = ' + st(num_tyc2) stop end ; oc_search_eph_hd_hbt_test, /v