Package jsky.coords

Examples of jsky.coords.WorldCoords


            // world coords
            if (imageDisplay.isWCS()) {
                imageDisplay.getCoordinateConverter().imageToWorldCoords(p, false);
                double equinox = imageDisplay.getWCS().getEquinox();
                WorldCoords wcs = new WorldCoords(p.getX(), p.getY(), equinox);
                String[] ar = wcs.format(equinox);
                raValue.setText(ar[0]);
                decValue.setText(ar[1]);
            } else {
                raValue.setText("");
                decValue.setText("");
View Full Code Here


     */
    public void setRegionArgs(QueryArgs queryArgs, CoordinateRadius region) {
        Coordinates coords = region.getCenterPosition();
        String equinoxStr = (String) queryArgs.getParamValue(EQUINOX);
        double equinox = _getEquinox(queryArgs);
        WorldCoords pos = (WorldCoords) coords;
        String[] radec = pos.format(equinox);
        queryArgs.setParamValue(RA, radec[0]);
        queryArgs.setParamValue(DEC, radec[1]);
        queryArgs.setParamValue(EQUINOX, equinoxStr);
        queryArgs.setParamValue(RADIUS, region.getMaxRadius());
        queryArgs.setParamValue(MIN_RADIUS, region.getMinRadius());
View Full Code Here

        if (queryArgs.getRegion() != null || sc == null || sc.length == 0) {
            return;
        }

        // get the center position
        WorldCoords wcs;
        String objectName = (String) queryArgs.getParamValue(OBJECT);
        if (objectName == null || objectName.length() == 0) {
            // no object name specified, check RA and Dec
            String raStr = (String) queryArgs.getParamValue(RA);
            String decStr = (String) queryArgs.getParamValue(DEC);
            if (raStr == null || decStr == null) {
                return;
            }
            double equinox = _getEquinox(queryArgs);
            wcs = new WorldCoords(raStr, decStr, equinox, true);
        } else {
            // an object name was specified, which needs to be resolved with a nameserver
            Object o = queryArgs.getParamValue(NAME_SERVER);
            if (!(o instanceof Catalog)) {
                throw new RuntimeException("No name server was specified");
            }
            wcs = _resolveObjectName(objectName, (Catalog) o);
            queryArgs.setParamValue(RA, wcs.getRA().toString());
            queryArgs.setParamValue(DEC, wcs.getDec().toString());
            queryArgs.setParamValue(EQUINOX, "2000");
        }

        // look for a min and max radius, or width and height parameters
        // See corresponding code in _initSearchParameters().
View Full Code Here

        // Must be one of the position/radius related parameters
        CoordinateRadius region = queryArgs.getRegion();
        if (region == null) {
            return null;
        }
        WorldCoords pos = (WorldCoords) region.getCenterPosition();

        String type = param.getType();
        String units = param.getUnits();
        String format = param.getFormat();

        if (type.equalsIgnoreCase("radec")) {
            return _getRADec(pos.getRA(), pos.getDec(), format);
        }
        if (type.equalsIgnoreCase("ra")) {
            return _getRA(pos.getRA(), format);
        }
        if (type.equalsIgnoreCase("dec")) {
            return _getDec(pos.getDec(), format);
        }
        if (type.equalsIgnoreCase("radius")) {
            return String.valueOf(_getValueInUnits(region.getMaxRadius(), "arcmin", units));
        }
        if (type.equalsIgnoreCase("minradius")) {
View Full Code Here

     *         for any catalog or image server requests.
     */
    public WorldCoords getBasePos() {
        if (isWCS()) {
            WorldCoordinateConverter wcs = getWCS();
            return new WorldCoords(wcs.getWCSCenter(), wcs.getEquinox());
        }
        return new WorldCoords();
    }
View Full Code Here

            }

            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("");
            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

        _imageX = center.x;
        _imageY = center.y;

        // get the center position in world coordinates
        cc.imageToWorldCoords(center, false);
        _centerPos = new WorldCoords(center, cc.getEquinox());
    }
View Full Code Here

     */
    private String _wcsCenter() {
        if (!_imageDisplay.isWCS())
            throw new IllegalArgumentException("Image does not support WCS");
        WorldCoordinateConverter wcc = _imageDisplay.getWCS();
        WorldCoords pos = new WorldCoords(wcc.getWCSCenter(), wcc.getEquinox());
        return pos.toString();
    }
View Full Code Here

    // Add a new target based on the edited fields
    private void _addNewTarget() {
        String name = _w.nameField.getText();
        String raStr = _w.raField.getText();
        String decStr = _w.decField.getText();
        WorldCoords pos = new WorldCoords(raStr, decStr);
        String description = _w.descriptionField.getText();
        String priority = _w.priorityField.getText();
        String category = _w.categoryField.getText();
        _addRow(new TargetDesc(name, pos, description, priority, category));
    }
View Full Code Here

TOP

Related Classes of jsky.coords.WorldCoords

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.