Package jsky.coords

Examples of jsky.coords.CoordinateRadius


                if (radius == null) {
                    r = 15.;
                } else {
                    r = radius;
                }
                queryArgs.setRegion(new CoordinateRadius(wcs, r));
            } else {
                double r1, r2;
                Double minRadius = (Double) queryArgs.getParamValue(MIN_RADIUS);
                if (minRadius == null) {
                    r1 = 0.;
                } else {
                    r1 = minRadius;
                }
                Double maxRadius = (Double) queryArgs.getParamValue(MAX_RADIUS);
                if (maxRadius == null) {
                    r2 = 15.;
                } else {
                    r2 = maxRadius;
                }
                queryArgs.setRegion(new CoordinateRadius(wcs, r1, r2));
            }
        } else if (_isImageServer) {
            if (_findParamByType(_paramDesc, "size") != null) {
                Double size = (Double) queryArgs.getParamValue(SIZE);
                double sz;
                if (size == null) {
                    sz = 15.;
                } else {
                    sz = size;
                }
                double radius = Math.sqrt(2. * sz * sz) / 2.;
                queryArgs.setRegion(new CoordinateRadius(wcs, radius, sz, sz));
            } else {
                double w, h;
                Double width = (Double) queryArgs.getParamValue(WIDTH);
                if (width == null) {
                    w = 0.;
                } else {
                    w = width;
                }
                Double height = (Double) queryArgs.getParamValue(HEIGHT);
                if (height == null) {
                    h = 15.;
                } else {
                    h = height;
                }
                double radius = Math.sqrt(w * w + h * h) / 2.;
                queryArgs.setRegion(new CoordinateRadius(wcs, radius, w, h));
            }
        }
    }
View Full Code Here


                return null;
            }
        }

        // 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")) {
            return String.valueOf(_getValueInUnits(region.getMinRadius(), "arcmin", units));
        }
        if (type.equalsIgnoreCase("maxradius")) {
            return String.valueOf(_getValueInUnits(region.getMaxRadius(), "arcmin", units));
        }
        if (type.equalsIgnoreCase("width") || type.equalsIgnoreCase("size")) {
            return String.valueOf(_getValueInUnits(region.getWidth(), "arcmin", units));
        }
        if (type.equalsIgnoreCase("height")) {
            return String.valueOf(_getValueInUnits(region.getHeight(), "arcmin", units));
        }

        return null;
    }
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

TOP

Related Classes of jsky.coords.CoordinateRadius

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.