;+ ; NAME: ; oc_search_pos_single_hd ; ; PURPOSE: (one line) ; Searches around a given position in the HD catalog. ; ; DESCRIPTION: ; This routine is a wrapper to oc_search_pos_fullcat/oc_search_pos_subcat . ; ; CATEGORY: ; Star catalogs ; ; CALLING SEQUENCE: ; oc_search_pos_single_hd, RA, DEC, RADIUS, NSTARS, ; METHOD=method, _extra=extra ; ; INPUTS: ; RA -- Right ascension of center of search position. Radians, J2000. ; DEC -- Declination of center of search position. Radians, J2000. ; RADIUS -- Search radius. Radians. ; ; Inputs are single values, not arrays. ; ; OPTIONAL INPUT PARAMETERS: ; METHOD -- either 'FULLCAT' or 'SUBCAT', for on search method requested. ; ; KEYWORD INPUT PARAMETERS: ; /VERBOSE -- If set, print diagnostics to screen. ; _extra -- Passed on ; ; KEYWORD OUTPUT PARAMETERS: ; None ; ; OUTPUTS: ; result -- Array of structures [nstars], with each element being a ; fully-populated star structure containing RA, Dec, magnitude, etc. ; NSTARS -- Number of stars found ; ; COMMON BLOCKS: ; None ; ; SIDE EFFECTS: ; None ; ; RESTRICTIONS: ; The proper environment variable must be set for the catalog called. ; $WCS_CATDIR/hd -- For HD catalog ; ; EXAMPLE: ; print, (oc_search_pos_single_hd(0.1, 0.1, 0.01, nstars)).ID ; [Locates three stars] ; ; MODIFICATION HISTORY: ; Written 10-Oct-2005 by Henry Throop, SwRI ; Modified 9-Dec-2005 by HBT. Improved to handle FULLCAT case. ; Modified 15-Dec-2005 by HBT. Renamed oc_search_hd_single -> ; oc_search_pos_single_hd ; Modified 27-Feb-2006 by HBT. Improved documentation and formatting. ;- function oc_search_pos_single_hd, ra, dec, radius, nstars, $ METHOD=method, _extra=extra catalog_pass = 'HD' if not(keyword_set(METHOD)) then method = 'fullcat' case strlowcase(METHOD) of 'subcat' : begin ; return, oc_search_pos_subcat(catalog=catalog_pass, ra, dec, radius, $ ; nstars, _extra=extra) nstars = 0 return, -1 end 'fullcat' : begin if strlen(getenv('WCS_CATDIR')) eq 0 then $ print, 'Warning: WCS_CATDIR not set.' name_catalog= 'hd/catalog.wcs.dat' ids_scat = oc_scat(ra, dec, radius, name_catalog, nstars, $ verbose=verbose) if nstars eq 0 then return, -1L ids = long(ids_scat) stars= oc_getstar_hd(ids, nstars=nstars, verbose=verbose) return, stars ; return, oc_search_pos_fullcat(catalog=catalog_pass, ra, dec, radius, $ ; nstars, _extra=extra) end end end