Changeset: e35ee16380ed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e35ee16380ed
Modified Files:
        sql/backends/monet5/LSST/80_lsst.mal
        sql/backends/monet5/LSST/lsst.c
        sql/backends/monet5/LSST/lsst.mal
Branch: default
Log Message:

Pass over LSST functions.


diffs (83 lines):

diff --git a/sql/backends/monet5/LSST/80_lsst.mal 
b/sql/backends/monet5/LSST/80_lsst.mal
--- a/sql/backends/monet5/LSST/80_lsst.mal
+++ b/sql/backends/monet5/LSST/80_lsst.mal
@@ -16,4 +16,5 @@
 # All Rights Reserved.
 
 # This loads the MonetDB/SQL module
+library lsst;
 include lsst;
diff --git a/sql/backends/monet5/LSST/lsst.c b/sql/backends/monet5/LSST/lsst.c
--- a/sql/backends/monet5/LSST/lsst.c
+++ b/sql/backends/monet5/LSST/lsst.c
@@ -75,7 +75,7 @@
        if (*dec1 < -90.0 || *dec1 > 90.0 || *dec2 < -90.0 || *dec2 > 90.0)
                throw(MAL,"lsst.qserv_angSep", "Illegal angulars");
 
-       *sep = _qserv_dist(*ra1, *dec1, *ra2, *dec2);
+       *sep = _qserv_angSep(*ra1, *dec1, *ra2, *dec2);
        return MAL_SUCCEED;
 }
 
@@ -137,7 +137,7 @@
                return MAL_SUCCEED;
        }
        if ( *dec_min >  *dec_max ||  *dec <  *dec_min ||  *dec >  *dec_max) {
-               *ret = int_nil;
+               *ret = 0;
                return MAL_SUCCEED;
        }
        /* Range-reduce longitude angles */
@@ -149,10 +149,10 @@
                lra_min = _qserv_reduceRa(*ra_min);
                lra_max = _qserv_reduceRa(*ra_max);
        }
-       if (lra_min == lra_max) 
-               *ret = lra >= lra_min && lra == lra_max;
+       if (lra_min <= lra_max)
+               *ret = lra >= lra_min && lra <= lra_max;
        else 
-               *ret = lra >= lra_min || lra == lra_max;
+               *ret = lra >= lra_min || lra <= lra_max;
        return MAL_SUCCEED;
 }
 
@@ -252,7 +252,7 @@
                *ret = int_nil;
                return MAL_SUCCEED;
        }
-       /* Semi-minor axis length m and semi-major axis length M must satisfy 0 
= m <= M <= 10 deg */
+       /* Semi-minor axis length m and semi-major axis length M must satisfy 0 
<= m <= M <= 10 deg */
        m = *smia;
        M = *smaa;
        if (m < 0.0 || m > M || M > 10.0 * QSERV_ARCSEC_PER_DEG) {
@@ -370,7 +370,7 @@
 {
        int *ret = (int*) getArgReference(stk,pci,0);
        dbl ra = *(dbl*) getArgReference(stk,pci,1);
-       dbl dec = *(dbl*) getArgReference(stk,pci,1);
+       dbl dec = *(dbl*) getArgReference(stk,pci,2);
 
        double x, y, z, w;
        dbl *edges, *nv;
@@ -378,7 +378,7 @@
 
        (void) mb;
        /* If any input is null, the result is 0. */
-       for (i = 3; i <pci->argc; ++i) {
+       for (i = 1; i <pci->argc; ++i) {
                if ( *(dbl*) getArgReference(stk,pci,i) == dbl_nil){
                        *ret = int_nil;
                        return MAL_SUCCEED;
diff --git a/sql/backends/monet5/LSST/lsst.mal 
b/sql/backends/monet5/LSST/lsst.mal
--- a/sql/backends/monet5/LSST/lsst.mal
+++ b/sql/backends/monet5/LSST/lsst.mal
@@ -18,7 +18,7 @@
 
 module lsst;
 
-command lsst.angsep(ra1:dbl, dec1:dbl, ra2:dbl, dec2:dbl)(ra3:dbl, dec3:dbl)
+command lsst.angsep(ra1:dbl, dec1:dbl, ra2:dbl, dec2:dbl) :dbl
 address angSep
 comment "Returns the angular separation in degrees between two spherical
 coordinate pairs (ra1,dec1) and (ra2,dec2)";
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to