Package jsky.coords

Examples of jsky.coords.WorldCoords


            //DialogUtil.error("The image does not support world coordinates.");
            return;
        }

        // get the center position
        WorldCoords centerPos = _imageDisplay.getBasePos();

        double minRadius, maxRadius, width, height;
        if (useDefaultSize) {
            width = 15.;
            height = 15.;
View Full Code Here


        }
        if (!_coordinateConverter.isWCS()) {
            return false;
        }

        WorldCoords pos = (WorldCoords) centerPosition;
        double ra = pos.getRaDeg();
        double dec = pos.getDecDeg();
        double w = region.getWidth();     // in arcmin
        double h = region.getHeight();
        Rectangle2D.Double tableRect = new Rectangle2D.Double(ra, dec, w, h);

        // get the image coords
        Point2D.Double p = _coordinateConverter.getWCSCenter();
        pos = new WorldCoords(p.x, p.y, _imageEquinox);
        ra = pos.getRaDeg();
        dec = pos.getDecDeg();
        w = _coordinateConverter.getWidthInDeg() * 60// in arcmin
        h = _coordinateConverter.getHeightInDeg() * 60;
        Rectangle2D.Double imageRect = new Rectangle2D.Double(ra, dec, w, h);

        return tableRect.intersects(imageRect);
View Full Code Here

                dec1 = Math.max(dec1, dec);
            }
        }

        // get the center point and radius
        WorldCoords centerPos = new WorldCoords((ra0 + ra1) / 2., (dec0 + dec1) / 2., tableEquinox);
        double d = WorldCoords.dist(ra0, dec0, ra1, dec1);
        return new CoordinateRadius(centerPos, d / 2.);
    }
View Full Code Here

                        // get the world coordinates
                        Coordinates cpos = rowCoords.getCoordinates(rowVec);
                        if (cpos == null) {
                            return null;
                        }
                        WorldCoords pos = (WorldCoords) cpos;

                        // modify the parameter to point to the center of the symbol
                        double[] radec = pos.getRaDec(_imageEquinox);
                        p.x = radec[0];
                        p.y = radec[1];
                        _coordinateConverter.convertCoords(p, CoordinateConverter.WORLD, CoordinateConverter.SCREEN, false);

                        // get the id of the catalog symbol
View Full Code Here

                    Object ra = row.get(_xCol), dec = row.get(_yCol);
                    if (ra != null && dec != null) {
                        if (ra instanceof String && dec instanceof String
                                && ((String) ra).length() != 0
                                && ((String) dec).length() != 0) {
                            return new WorldCoords((String) ra, (String) dec, _equinox);
                        } else if (ra instanceof Double && dec instanceof Double) {
                            return new WorldCoords((Double) ra, (Double) dec, _equinox);
                        } else if (ra instanceof Float && dec instanceof Float) {
                            return new WorldCoords((Float) ra, (Float) dec, _equinox);
                        }
                    }
                } else if (_isPix) {
                    Object x = row.get(_xCol), y = row.get(_yCol);
                    if (x != null && y != null) {
View Full Code Here

        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

            // world coords
            worldCoordsTextField.setText("");
            if (imageDisplay.isWCS()) {
                imageDisplay.getCoordinateConverter().imageToWorldCoords(p, false);
                double equinox = imageDisplay.getWCS().getEquinox();
                WorldCoords wcs = new WorldCoords(p.getX(), p.getY(), equinox);

//                worldCoordsTextField.setText(wcs.toString()); // Displays always in J2000
                // display the coordinates in the equinox of the image
                String[] ar = wcs.format(equinox);
                String equinoxStr;
                if (equinox == 2000.) {
                    equinoxStr = "J2000";
                } else if (equinox == 1950.) {
                    equinoxStr = "B1950";
View Full Code Here

        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);

        for (int j = 0; j < numSteps; j++) {
            for (int i = 0; i < _targets.length; i++) {
                WorldCoords pos = _targets[i].getCoordinates();
                Date utTime = cal.getTime();
                _skyCalc.calculate(pos, utTime);
                _xData[i][j] = utTime;
                _yData[i][j] = _skyCalc.getAltitude();
                _yDataAirmass[i][j] = _skyCalc.getAirmass();
View Full Code Here

//        Calendar cal = Calendar.getInstance(site.getTimeZone());
//        cal.set(2009, Calendar.MARCH, 8, 12, 0, 0);
//        Date date = cal.getTime();
        Date date = new Date();
        TargetDesc[] targets = new TargetDesc[]{
                new TargetDesc("m101", new WorldCoords("14:03:12.579", "+54:20:52.95"), "Test target 1", "High", "B2"),
                new TargetDesc("m51", new WorldCoords("13:29:52.452", "+47:11:39.83"), "Test target 2", "Low", "B2"),
                new TargetDesc("ngc1259", new WorldCoords("03:17:17.172", "+41:23:07.22"), "Test target 3", "Medium", "B2"),
        };
        panel.setModel(new ElevationPlotModel(site, date, targets));

        frame.getContentPane().add(panel, BorderLayout.CENTER);
        frame.pack();
View Full Code Here

        SiteDesc site = ElevationPlotUtil.MAUNA_KEA;
        Calendar cal = Calendar.getInstance(UT);

        cal.set(2005, Calendar.MARCH, 9, 11, 0, 0);
        Date date = cal.getTime();
        WorldCoords obj = new WorldCoords("10 00 00", "+19 49 26");
        SkyCalc skyCalc = new SkyCalc(site);
        skyCalc.calculate(obj, date);
        System.out.println("For Site = Mauna Kea, date = 2005-03-09, obj = " + obj + ":");
        System.out.println("   Altitude = " + skyCalc.getAltitude());
        System.out.println("   Azimuth = " + skyCalc.getAzimuth());
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.