Update of /cvsroot/monetdb/sql/src/test/Skyserver
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5300
Modified Files:
Tag: SQL_2-24
Skyserver_functions_v6.sql Skyserver_dropFunctions_v6.sql
Log Message:
Add missing function:
fGetNearestObjAllEq
U Skyserver_dropFunctions_v6.sql
Index: Skyserver_dropFunctions_v6.sql
===================================================================
RCS file:
/cvsroot/monetdb/sql/src/test/Skyserver/Skyserver_dropFunctions_v6.sql,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -d -r1.1.2.6 -r1.1.2.7
--- Skyserver_dropFunctions_v6.sql 6 Jun 2008 12:52:21 -0000 1.1.2.6
+++ Skyserver_dropFunctions_v6.sql 6 Jun 2008 14:46:04 -0000 1.1.2.7
@@ -1,3 +1,4 @@
+DROP FUNCTION fGetNearestObjAllEq;
DROP FUNCTION fGetUrlFitsSpectrum;
DROP FUNCTION fGetUrlFrameImg;
DROP FUNCTION fGetNearbyObjAllEq;
U Skyserver_functions_v6.sql
Index: Skyserver_functions_v6.sql
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/Skyserver/Skyserver_functions_v6.sql,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -d -r1.1.2.8 -r1.1.2.9
--- Skyserver_functions_v6.sql 6 Jun 2008 12:52:21 -0000 1.1.2.8
+++ Skyserver_functions_v6.sql 6 Jun 2008 14:45:59 -0000 1.1.2.9
@@ -2283,3 +2283,29 @@
RETURN link + plate + '/1d/spSpec-'+mjd+'-'+plate+'-'+fiber+'.fit';
END;
+CREATE FUNCTION fGetNearestObjAllEq (ra float, "dec" float, r float)
+RETURNS TABLE (
+ objID bigint,
+ run int ,
+ camcol int ,
+ field int ,
+ rerun int ,
+ type int ,
+ mode int ,
+ cx float ,
+ cy float ,
+ cz float ,
+ htmID bigint,
+ distance float -- distance in arc minutes
+ )
+BEGIN
+ DECLARE d2r float,nx float,ny float,nz float ;
+ set d2r = PI()/180.0;
+ set nx = COS("dec"*d2r)*COS(ra*d2r);
+ set ny = COS("dec"*d2r)*SIN(ra*d2r);
+ set nz = SIN("dec"*d2r);
+ RETURN TABLE (SELECT *
+ FROM fGetNearbyObjAllXYZ(nx,ny,nz,r)
+ ORDER BY distance ASC LIMIT 1); -- order by needed to get the closest
one.
+END;
+
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins