Package jsky.catalog

Examples of jsky.catalog.BasicQueryArgs


    /**
     * Resolve the given astronomical object name using the given name server
     * and return the world coordinates corresponding the name.
     */
    private WorldCoords _resolveObjectName(String objectName, Catalog cat) throws IOException {
        QueryArgs queryArgs = new BasicQueryArgs(cat);
        queryArgs.setId(objectName);
        QueryResult r = cat.query(queryArgs);
        if (r instanceof TableQueryResult) {
            Coordinates coords = ((TableQueryResult) r).getCoordinates(0);
            if (coords instanceof WorldCoords) {
                return (WorldCoords) coords;
View Full Code Here


            System.exit(1);
        }

        try {
            System.out.println("test query: at center position/radius: ");
            QueryArgs queryArgs = new BasicQueryArgs(cat);
            queryArgs.setParamValue("center", "03:19:44.44+41:30:58.21");
            queryArgs.setParamValue("radius", "2");
            QueryResult queryResult = cat.query(queryArgs);
            System.out.println("result: " + queryResult);
            if (queryResult instanceof AstroCatTable) {
                ((AstroCatTable) queryResult).saveAsSkycatTable(System.out);
            } else {
View Full Code Here

     * that can be passed to the Catalog.query() method.
     *
     * @return the QueryArgs object to use for a catalog query.
     */
    public QueryArgs getQueryArgs() {
        QueryArgs queryArgs = new BasicQueryArgs(_catalog);
        initQueryArgs(queryArgs);
        return queryArgs;
    }
View Full Code Here

    /**
     * Resolve the given astronomical object name using the given name server
     * and return the world coordinates corresponding the name.
     */
    private WorldCoords _resolveObjectName(String objectName, Catalog cat) throws IOException {
        QueryArgs queryArgs = new BasicQueryArgs(cat);
        queryArgs.setId(objectName);
        QueryResult r = cat.query(queryArgs);
        if (r instanceof TableQueryResult) {
            Coordinates coords = ((TableQueryResult) r).getCoordinates(0);
            if (coords instanceof WorldCoords)
                return (WorldCoords) coords;
View Full Code Here

            System.out.println("Can't find entry for catalog: " + catalogName);
            System.exit(1);
        }

        try {
            QueryArgs q1 = new BasicQueryArgs(cat);
            q1.setId("GSC0285601186");
            QueryResult r1 = cat.query(q1);
            System.out.println("result: " + r1);

            System.out.println("");
            System.out.println("test query: at center position/radius: ");
            QueryArgs q2 = new BasicQueryArgs(cat);
            q2.setRegion(new CoordinateRadius(new WorldCoords("03:19:44.44", "+41:30:58.21"), 2.));
            QueryResult r2 = cat.query(q2);
            System.out.println("result: " + r2);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        CoordinateRadius region;
        if (queryArgs == null) {
            // scan table here to get the range that it covers
            region = getTableRegion(table);
            if (region != null) {
                queryArgs = new BasicQueryArgs(table);
                queryArgs.setRegion(region);
                table.setQueryArgs(queryArgs);
            }
        } else {
            region = queryArgs.getRegion();
View Full Code Here

        if (_queryResultDisplay != null) {
            if (catalog.getNumParams() == 0) {
                // if there are no parameters, do the query to get to the actual catalog
                QueryResult queryResult;
                try {
                    queryResult = catalog.query(new BasicQueryArgs(catalog));
                } catch (Exception e) {
                    DialogUtil.error(e);
                    return;
                }
                _addQueryResult(node, queryResult);
View Full Code Here

        System.out.println("table(3, Dec) = " + cat.getValueAt(3, "Dec"));

        try {
            System.out.println("");
            System.out.println("test query: of GSC0285601186");
            QueryArgs q = new BasicQueryArgs(cat);
            q.setId("GSC0285601186");
            QueryResult r = cat.query(q);
            if (r instanceof AstroCatTable) {
                AstroCatTable table = (AstroCatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
                if (table.getRowCount() != 0)
                    System.out.println("result: " + r.toString());
            } else {
                System.out.println("Failed search by ID");
            }

            System.out.println("");
            System.out.println("test query: at center position/radius: ");
            q = new BasicQueryArgs(cat);
            q.setRegion(new CoordinateRadius(new WorldCoords("03:19:44.44", "+41:30:58.21"), 1.));
            r = cat.query(q);

            if (r instanceof AstroCatTable) {
                AstroCatTable table = (AstroCatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
View Full Code Here

        System.out.println("table(3, Dec) = " + cat.getValueAt(3, "Dec"));

        try {
            System.out.println("");
            System.out.println("test query: of GSC0285601186");
            QueryArgs q = new BasicQueryArgs(cat);
            q.setId("GSC0285601186");
            QueryResult r = cat.query(q);
            if (r instanceof SkycatTable) {
                SkycatTable table = (SkycatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
                if (table.getRowCount() != 0)
                    System.out.println("result: " + r.toString());
            } else {
                System.out.println("Failed search by ID");
            }

            System.out.println("");
            System.out.println("test query: at center position/radius: ");
            q = new BasicQueryArgs(cat);
            q.setRegion(new CoordinateRadius(new WorldCoords("03:19:44.44", "+41:30:58.21"), 1.));
            r = cat.query(q);

            if (r instanceof SkycatTable) {
                SkycatTable table = (SkycatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
View Full Code Here

TOP

Related Classes of jsky.catalog.BasicQueryArgs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.