Package jsky.coords

Examples of jsky.coords.ImageCoords


                    c += 3;
                    urlHasRaDec = true;
                } else if (urlStr.charAt(c) == 'x') {
                    CoordinateRadius region = queryArgs.getRegion();
                    if (region != null) {
                        ImageCoords pos = (ImageCoords) region.getCenterPosition();
                        buf.append(pos.getX());
                    }
                    c++;
                    urlHasXy = true;
                } else if (urlStr.charAt(c) == 'y') {
                    CoordinateRadius region = queryArgs.getRegion();
                    if (region != null) {
                        ImageCoords pos = (ImageCoords) region.getCenterPosition();
                        buf.append(pos.getY());
                    }
                    c++;
                    urlHasXy = true;
                } else if (urlStr.startsWith("r1", c)) {
                    CoordinateRadius region = queryArgs.getRegion();
View Full Code Here


        } else if (isPix()) {
            Double x = (Double) queryArgs.getParamValue(SkycatConfigEntry.X);
            Double y = (Double) queryArgs.getParamValue(SkycatConfigEntry.Y);
            if (x == null || y == null)
                return;
            ImageCoords ic = new ImageCoords(x.intValue(), y.intValue());
            queryArgs.setRegion(new CoordinateRadius(ic, r1, r2));
        }
    }
View Full Code Here

            queryArgs.setParamValue(SkycatConfigEntry.MIN_RADIUS, region.getMinRadius());
            queryArgs.setParamValue(SkycatConfigEntry.MAX_RADIUS, region.getMaxRadius());
            queryArgs.setParamValue(SkycatConfigEntry.WIDTH, region.getWidth());
            queryArgs.setParamValue(SkycatConfigEntry.HEIGHT, region.getHeight());
        } else if (rowCoordinates.isPix()) {
            ImageCoords pos = (ImageCoords) coords;
            queryArgs.setParamValue(SkycatConfigEntry.X, pos.getX());
            queryArgs.setParamValue(SkycatConfigEntry.Y, pos.getY());
            queryArgs.setParamValue(SkycatConfigEntry.MIN_RADIUS, region.getMinRadius());
            queryArgs.setParamValue(SkycatConfigEntry.MAX_RADIUS, region.getMaxRadius());
            queryArgs.setParamValue(SkycatConfigEntry.WIDTH, region.getWidth());
            queryArgs.setParamValue(SkycatConfigEntry.HEIGHT, region.getHeight());
        }
View Full Code Here

        Vector dataVec = table.getDataVector();

        if (rowCoords.isPix()) {
            // no WCS, just use image center and size
            Point2D.Double p = _coordinateConverter.getImageCenter();
            ImageCoords pos = new ImageCoords(p.x, p.y);
            double w = _coordinateConverter.getWidth();
            double h = _coordinateConverter.getHeight();
            double r = Math.sqrt(w * w + h * h);
            return new CoordinateRadius(pos, r, w, h);
        }

        if (!rowCoords.isWCS()) {
            return null;
        }

        // we have world coordinages: find the bounding box of the objects in the table
        double ra0 = 0., ra1 = 0., dec0 = 0., dec1 = 0.;
        boolean firstTime = true;
        for (int row = 1; row < nrows; row++) {
            Vector rowVec = (Vector) dataVec.get(row);
            Coordinates pos = rowCoords.getCoordinates(rowVec);
            if (pos == null) {
                continue;
            }
            if (firstTime) {
                firstTime = false;
                ra0 = pos.getX();
                ra1 = ra0;
                dec0 = pos.getY();
                dec1 = dec0;
            } else {
                double ra = pos.getX(), dec = pos.getY();
                ra0 = Math.min(ra0, ra);
                ra1 = Math.max(ra1, ra);
                dec0 = Math.min(dec0, dec);
                dec1 = Math.max(dec1, dec);
            }
View Full Code Here

                    }
                } else if (_isPix) {
                    Object x = row.get(_xCol), y = row.get(_yCol);
                    if (x != null && y != null) {
                        if (x instanceof Double && y instanceof Double) {
                            return new ImageCoords((Double) x, (Double) y);
                        } else if (x instanceof Float && y instanceof Float) {
                            return new ImageCoords((Float) x, (Float) y);
                        }
                    }
                }
            }
        } catch (NumberFormatException e) {
View Full Code Here

TOP

Related Classes of jsky.coords.ImageCoords

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.