FUNCTION  fGetNearestSpecObjAllXYZ

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

returned table:

  • specObjID bigint, -- unique spectrum ID
  • plate int NOT NULL, -- spectroscopic plate number
  • mjd int NOT NULL, -- MJD of observation
  • fiberID int NOT NULL, -- fiber number on plate
  • z real NOT NULL, -- final spectroscopic redshift
  • zErr real NOT NULL, -- redshift error
  • zWarning int NOT NULL, -- warning flags
  • sciencePrimary int NOT NULL, -- deemed to be science-worthy or not
  • cx float NOT NULL, -- x of normal unit vector in J2000
  • cy float NOT NULL, -- y of normal unit vector in J2000
  • cz float NOT NULL, -- z of normal unit vector in J2000
  • htmID bigint, -- 20-deep HTM ID
  • distance float -- distance in arc minutes
    Sample call to find the nearest SpecObj within 1/2 arcminute of xyz -.0996,-.1,0

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

    see also fGetNearbySpecObjAllEq, fGetNearestSpecObjAllEq, fGetNearbySpecObjAllXYZ,
  • Input and output parameters

    nametypelengthinoutpnum
    @nxfloat8input1
    @nyfloat8input2
    @nzfloat8input3
    @rfloat8input4
    plateint4output2
    mjdint4output3
    fiberIDint4output4
    zWarningint4output7
    sciencePrimaryint4output8
    zreal4output5
    zErrreal4output6
    cxfloat8output9
    cyfloat8output10
    czfloat8output11
    distancefloat8output13
    specObjIDbigint8output1
    htmIDbigint8output12