FUNCTION  fGetNearbyObjEq

Given an equatorial point (@ra,@dec), returns table of primary objects within @r arcmins of the point. There is no limit on @r.


ra, dec are in degrees, r is in arc minutes.
There is no limit on the number of objects returned, but there are about 40 per sq arcmin.

returned table:

  • objID bigint NOT NULL -- Photo primary object identifier
  • run int NOT NULL, -- run that observed this object
  • camcol int NOT NULL, -- camera column that observed the object
  • field int NOT NULL, -- field that had the object
  • rerun int NOT NULL, -- computer processing run that discovered the object
  • type int NOT NULL, -- type of the object (3=Galaxy, 6= star, see PhotoType in DBconstants)
  • cx float NOT NULL, -- x,y,z of unit vector to this object
  • cy float NOT NULL,
  • cz float NOT NULL,
  • htmID bigint, -- Hierarchical Trangular Mesh id of this object
  • distance float -- distance in arc minutes to this object from the ra,dec.
    Sample call to find all the Galaxies within 3 arcminutes of ra,dec 185,0

    select *
    from Galaxy as G,
    dbo.fGetNearbyObjEq(185,0,3) as N
    where G.objID = N.objID

    see also fGetNearestObjEq, fGetNearbyObjXYZ, fGetNearestObjXYZ
  • Input and output parameters

    nametypelengthinoutpnum
    @rafloat8input1
    @decfloat8input2
    @rfloat8input3
    runint4output2
    camcolint4output3
    fieldint4output4
    rerunint4output5
    typeint4output6
    cxfloat8output7
    cyfloat8output8
    czfloat8output9
    distancefloat8output11
    objIDbigint8output1
    htmIDbigint8output10