FUNCTION  fGetNearbySpecObjXYZ

Returns table of scienceprimary spectrum objects within @r arcmins of an xyz point (@nx,@ny, @nz).

There is no limit on the number of objects returned, but there are about 40 per sq arcmin.

returned table:

  • specObjID bigint, -- 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)
  • mode tinyint NOT NULL, -- mode of photoObj
  • 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 SpecObj within 5 arcminutes of xyz -.0996,-.1,0

    select *
    from dbo.fGetNearbySpecObjXYZ(-.996,-.1,0,5)

    see also fGetNearbySpecObjEq, fGetNearestSpecObjXYZ, fGetNearbySpecObjAllXYZ
  • Input and output parameters

    nametypelengthinoutpnum
    @nxfloat8input1
    @nyfloat8input2
    @nzfloat8input3
    @rfloat8input4
    plateint4output2
    mjdint4output3
    fiberIDint4output4
    zWarningint4output7
    zreal4output5
    zErrreal4output6
    cxfloat8output8
    cyfloat8output9
    czfloat8output10
    distancefloat8output12
    specObjIDbigint8output1
    htmIDbigint8output11