/usr/share/gnudatalanguage/astrolib/dbtarget.pro is in gdl-astrolib 2018.02.16+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | function dbtarget, target, radius, sublist,SILENT=silent, $
TO_B1950 = to_B1950, DIS = dis
;+
; NAME:
; DBTARGET
; PURPOSE:
; Find sources in a database within specified radius of specified target
; EXPLANATION:
; Uses QuerySimbad to translate target name to RA and Dec, and then uses
; DBCIRCLE() to find any entries within specified radius. Database must
; include items named 'RA' (in hours) and 'DEC' (in degrees) and must
; have previously been opened with DBOPEN
;
; CALLING SEQUENCE:
; list = DBTARGET(target, [radius, sublist, /SILENT, DIS= ,/TO_B1950 ] )
;
; INPUTS:
; TARGET - A scalar string giving an astronomical target name, which
; will be translated into J2000 celestial coordinates by QuerySimbad
;
; OPTIONAL INPUT:
; RADIUS - Radius of the search field in arc minutes, scalar.
; Default is 5 arc minutes
; SUBLIST - Vector giving entry numbers in currently opened database
; to be searched. Default is to search all entries
;
; OUTPUTS:
; LIST - Vector giving entry numbers in the currently opened catalog
; which have positions within the specified search circle
; LIST is set to -1 if no sources fall within the search circle
; !ERR is set to the number sources found.
;
; OPTIONAL OUTPUT
; DIS - The distance in arcminutes of each entry specified by LIST
; to the search center specified by the target.
;
; OPTIONAL KEYWORD INPUT:
; /SILENT - If this keyword is set, then DBTARGET will not print the
; number of entries found at the terminal
; /TO_B1950 - If this keyword is set, then the SIMBAD J2000 coordinates
; are converted to B1950 before searching the database
; NOTE: The user must determine on his own whether the database
; is in B1950 or J2000 coordinates.
;
; RESTRICTIONS;
; The database must have items 'RA' (in hours) and 'DEC' (in degrees).
; Alternatively, the database could have items RA_OBJ and DEC_OBJ
; (both in degrees)
; EXAMPLE:
; (1) Use the HST_CATALOG database to find all HST observations within
; 5' (the default) of M33
;
; IDL> dbopen,'hst_catalog'
; IDL> list = dbtarget('M33')
;
; (2) As above but restrict targets within 2' of the nucleus using the
; WFPC2 camara
;
; IDL> dbopen,'hst_catalog'
; IDL> sublist = dbfind('config=WFPC2')
; IDL> list = dbtarget('M33',2,sublist)
;
;
; PROCEDURE CALLS:
; QuerySimbad, DBCIRCLE()
; REVISION HISTORY:
; Written W. Landsman SSAI September 2002
; Propagate /SILENT keyword to QuerySimbad W. Landsman Oct 2009
; Make sure a database is open W.L. Oct 2010
;-
On_error,2
if N_params() LT 1 then begin
print,'Syntax - list = DBTARGET( targetname_or_coord, [radius, sublist '
print,' DIS =, /SILENT, /TO_B1950 ] )'
if N_elements(sublist) GT 0 then return, sublist else return,lonarr(1)-1
endif
if ~db_info('open') then message,'ERROR - No database open'
QuerySimbad, target, ra,dec, Found = Found,Silent=silent
if found EQ 0 then message,'Target name ' + target + $
' could not be translated by SIMBAD'
ra = ra/15.
if N_elements(radius) EQ 0 then radius = 5
if n_elements(sublist) EQ 0 then $
return, dbcircle(ra, dec, radius, dis, SILENT=silent, $
TO_B1950 = to_b1950 )
return, dbcircle(ra, dec, radius, dis, sublist, SILENT=silent, $
TO_B1950 = to_b1950 )
end
|