Package jsky.coords

Examples of jsky.coords.WorldCoordinateConverter


        return _imageDisplay.getWCS().getWCSCenter();
    }

    /** Return the center coordinates in image pixels. */
    public Point2D.Double getImageCenter() {
        WorldCoordinateConverter wcs = _imageDisplay.getWCS();
        if (wcs != null) {
            return wcs.getImageCenter();
        }
        int w = _imageDisplay.getImageWidth();
        int h = _imageDisplay.getImageHeight();
        return new Point2D.Double(w/2., h/2.);
    }
View Full Code Here


     * @param useImageSize if true, use the image size to get the search radius
     * @return an array containing the min and max radius values
     */
    public double[] getDefaultSearchRadius(WorldCoords centerPos, boolean useImageSize) {
        Point2D.Double p1 = new Point2D.Double(1., 1.);
        WorldCoordinateConverter wcs = getWCS();
        wcs.imageToWorldCoords(p1, false);
        double equinox = wcs.getEquinox();
        WorldCoords origin = new WorldCoords(p1, equinox);

        double maxRadius = centerPos.dist(origin);
        return new double[]{0., maxRadius};
    }
View Full Code Here

        // make the title
        double ra = Double.NaN, dec = Double.NaN;
        String radecStr = "";

        if (_imageDisplay.isWCS()) {
            WorldCoordinateConverter wcs = _imageDisplay.getWCS();
            WorldCoords center = new WorldCoords(wcs.getWCSCenter(), wcs.getEquinox());
            radecStr += center.toString();
            ra = center.getRaDeg();
            dec = center.getDecDeg();
        }
View Full Code Here

     */
    protected void setFromImage(boolean useDefaultSize, boolean buttonPressed) {
        _selectedArea = null;
        if (_imageDisplay == null)
            return;
        WorldCoordinateConverter wcs = _imageDisplay.getWCS();
        if (wcs == null) {
            //DialogUtil.error("The image does not support world coordinates.");
            return;
        }

View Full Code Here

    /**
     * Update the rect object with the coordinates of the visible area
     * of the target image.
     */
    private void _updateCompass() {
        WorldCoordinateConverter wcs = _mainImageDisplay.getWCS();
        if (wcs == null) {
            _compass = null;
            return;
        }
        _imageDisplay.setWCS(wcs);

        double wcsw = wcs.getWidthInDeg();
        double wcsh = wcs.getHeightInDeg();
        double sizeInDeg = Math.min(wcsw, wcsh) / 4.;
//        double equinox = wcs.getEquinox();
        Point2D.Double center = wcs.getWCSCenter();
        _north = new Point2D.Double(center.x, center.y);
        _east = new Point2D.Double(center.x, center.y);

        // check if at north or south pole, since that is a special case
        if (90 - Math.abs(center.y) < wcsh) {
View Full Code Here

        String footer = _imageDisplay.getObjectName();
        if (footer == null)
            footer = _imageDisplay.getFilename();
        if (footer == null) {
            if (_imageDisplay.isWCS()) {
                WorldCoordinateConverter wcc = _imageDisplay.getWCS();
                WorldCoords center = new WorldCoords(wcc.getWCSCenter(), wcc.getEquinox());
                footer = center.toString();
            } else {
                footer = _I18N.getString("blankImage");
            }
        }
View Full Code Here

     *         The position returned here should be used as the base position
     *         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

     * Return the WCS center of the current image
     */
    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

TOP

Related Classes of jsky.coords.WorldCoordinateConverter

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.