Package jsky.catalog

Examples of jsky.catalog.QueryArgs


    /**
     * 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

    /**
     * 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

    /**
     * Update the display to reflect any changes in the catalog's query parameters
     */
    public void update() {
        QueryArgs queryArgs = getQueryArgs();
        removePanelItems();
        makePanelItems();
        doGridBagLayout(_layout);
        setQueryArgs(queryArgs);
        revalidate();
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

     * Return true if the coordinates of the objects in the given table may be in a
     * range where they can be plotted in the current image.
     */
    protected boolean tableInRange(TableQueryResult table) {
        // get the coordinates of the region that the table covers from the query arguments, if known
        QueryArgs queryArgs = table.getQueryArgs();
        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();
        }
        if (region == null) {
            return false;
        }
        Coordinates centerPosition = region.getCenterPosition();
View Full Code Here

        double width = dims.x * 60; // convert deg to arcmin
        double height = dims.y * 60;

        // set the values in the query panel
        CatalogQueryPanel catalogQueryPanel = getCatalogQueryPanel();
        QueryArgs queryArgs = catalogQueryPanel.getQueryArgs();
        getCatalog().setRegionArgs(queryArgs, new CoordinateRadius(centerPos, radius, width, height));
        catalogQueryPanel.setQueryArgs(queryArgs);
    }
View Full Code Here

            mag = _imageDisplay.getDefaultSearchMagRange();
        }

        // set the values in the query panel
        CatalogQueryPanel catalogQueryPanel = getCatalogQueryPanel();
        QueryArgs queryArgs = catalogQueryPanel.getQueryArgs();

        if (mag != null) {
            queryArgs.setParamValueRange("mag", mag[0], mag[1]);
        }

        try {
            getCatalog().setRegionArgs(queryArgs, new CoordinateRadius(centerPos, minRadius, maxRadius, width, height));
            catalogQueryPanel.setQueryArgs(queryArgs);
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

        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

TOP

Related Classes of jsky.catalog.QueryArgs

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.