FUNCTION  fGetNearestSpecObjEq

Returns nearest scienceprimary specobj within @r arcminutes of an equatorial point (@ra,@dec).

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
  • 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 ra,dec 180.0, -0.5, 0.5

    select *
    from dbo.fGetNearestSpecObjEq(180.0,-0.5,0.5)

    see also fGetNearbySpecObjEq, fGetNearestSpecObjAllEq, fGetNearbySpecObjXYZ,
  • Input and output parameters

    nametypelengthinoutpnum
    @rafloat8input1
    @decfloat8input2
    @rfloat8input3
    plateint4output2
    mjdint4output3
    fiberIDint4output4
    zWarningint4output7
    zreal4output5
    zErrreal4output6
    cxfloat8output8
    cyfloat8output9
    czfloat8output10
    distancefloat8output12
    specObjIDbigint8output1
    htmIDbigint8output11