FUNCTION  fGetNearestObjXYZ

Returns nearest primary object within @r arcminutes of an xyz point (@nx,@ny, @nz).

returned table:

  • objID 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)
  • 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 the nearest PhotoObject within 1/2 arcminute of xyz -.0996,-.1,0

    select *
    from dbo.fGetNearestObjXYZ(-.996,-.1,0,0.5)

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

    nametypelengthinoutpnum
    @nxfloat8input1
    @nyfloat8input2
    @nzfloat8input3
    @rfloat8input4
    runint4output2
    camcolint4output3
    fieldint4output4
    rerunint4output5
    typeint4output6
    cxfloat8output7
    cyfloat8output8
    czfloat8output9
    distancefloat8output11
    objIDbigint8output1
    htmIDbigint8output10