Package jsky.catalog

Examples of jsky.catalog.FieldDescAdapter


        // initialize dummy parameters for search by pos/radius (for a more uniform user interface)
        List<FieldDesc> params = new ArrayList<FieldDesc>();

        if (_isCatalog || _isImageServer) {
            // Define the "standard" parameters
            FieldDescAdapter p = new FieldDescAdapter(OBJECT);
            p.setDescription("Enter the name of the object");
            params.add(p);

            p = new FieldDescAdapter(NAME_SERVER);
            p.setDescription("Select the name server to use to resolve the object name");
            List<Catalog> l = AstroCatConfig.getConfigFile().getNameServers();
            NameValue[] ar = new NameValue[l.size()];
            for (int i = 0; i < ar.length; i++) {
                Catalog cat = l.get(i);
                ar[i] = new NameValue(cat.getName(), cat);
            }
            p.setOptions(ar);
            params.add(p);

            p = new FieldDescAdapter(RA);
            p.setIsRA(true);
            p.setDescription("Right Ascension in the selected equinox, format: hh:mm:ss.sss");
            params.add(p);

            p = new FieldDescAdapter(DEC);
            p.setDescription("Declination in the selected equinox, format: dd:mm:ss.sss");
            p.setIsDec(true);
            params.add(p);

            p = new FieldDescAdapter(EQUINOX);
            p.setDescription("Equinox of RA and Dec");
            p.setOptions(_equinoxOptions);
            params.add(p);

            if (_isCatalog) {
                if (_findParamByType(_paramDesc, "radius") != null) {
                    p = new FieldDescAdapter(MAX_RADIUS);
                    p.setDescription("The radius from the center coordinates in arcmin");
                    p.setFieldClass(Double.class);
                    p.setUnits("arcmin");
                    params.add(p);
                } else {
                    if (_findParamByType(_paramDesc, "minradius") != null) {
                        p = new FieldDescAdapter(MIN_RADIUS);
                        p.setDescription("The minimum radius from the center coordinates in arcmin");
                        p.setFieldClass(Double.class);
                        p.setUnits("arcmin");
                        params.add(p);
                    }
                    if (_findParamByType(_paramDesc, "maxradius") != null) {
                        p = new FieldDescAdapter(MAX_RADIUS);
                        p.setDescription("The maximum radius from the center coordinates in arcmin");
                        p.setFieldClass(Double.class);
                        p.setUnits("arcmin");
                        params.add(p);
                    }
                }
            } else if (_isImageServer) {
                if (_findParamByType(_paramDesc, "size") != null) {
                    p = new FieldDescAdapter(SIZE);
                    p.setDescription("The requested size (width or height) about the center coordinates in arcmin");
                    p.setFieldClass(Double.class);
                    p.setUnits("arcmin");
                    params.add(p);
                } else {
                    if (_findParamByType(_paramDesc, "width") != null) {
                        p = new FieldDescAdapter(WIDTH);
                        p.setDescription("The width about the center coordinates in arcmin");
                        p.setFieldClass(Double.class);
                        p.setUnits("arcmin");
                        params.add(p);
                    }
                    if (_findParamByType(_paramDesc, "height") != null) {
                        p = new FieldDescAdapter(HEIGHT);
                        p.setDescription("The height about the center coordinates in arcmin");
                        p.setFieldClass(Double.class);
                        p.setUnits("arcmin");
                        params.add(p);
                    }
                }
            }

            if (_isCatalog &&
                    _findParamByType(_paramDesc, "maxobjects") == null
                    && _findParamByType(_paramDesc, "maxrows") == null) {
                p = new FieldDescAdapter(MAX_OBJECTS);
                p.setDescription("The maximum number of objects to return");
                p.setFieldClass(Integer.class);
                p.setDefaultValue(1000);
                params.add(p);
            }
        }

        // Add the rest of the parameters not dealing with position and radius
View Full Code Here


        return 4;
    }

    /** Return a description of the ith query parameter */
    public FieldDesc getParamDesc(int i) {
        return new FieldDescAdapter("Param" + i);
    }
View Full Code Here

        return new FieldDescAdapter("Param" + i);
    }

    /** Return a description of the named query parameter */
    public FieldDesc getParamDesc(String name) {
        return new FieldDescAdapter(name);
    }
View Full Code Here

    protected void determineSearchParameters() {
        boolean isCatalog = _servType.equals("catalog") || _servType.equals("archive") || _servType.equals("local");

        if (_servType.equals("namesvr")) {
            _paramDesc = new FieldDescAdapter[1];
            _paramDesc[0] = new FieldDescAdapter(OBJECT);
            _paramDesc[0].setDescription("Enter the name of the object");
        } else if (isCatalog || _servType.equals("imagesvr")) {
            List<FieldDescAdapter> params = new ArrayList<FieldDescAdapter>();
            FieldDescAdapter p;
            boolean hasCoords = false;

            // Define the "standard" parameters
            if (_rowCoordinates.isWCS()) {
                hasCoords = true;

                p = new FieldDescAdapter(OBJECT);
                p.setDescription("Enter the name of the object");
                params.add(p);

                p = new FieldDescAdapter(NAME_SERVER);
                p.setDescription("Select the name server to use to resolve the object name");
                List<Catalog> l = _configFile.getNameServers();
                NameValue[] ar = new NameValue[l.size()];
                for (int i = 0; i < ar.length; i++) {
                    Catalog cat = l.get(i);
                    ar[i] = new NameValue(cat.getName(), cat);
                }
                p.setOptions(ar);
                params.add(p);

                p = new FieldDescAdapter(RA);
                p.setIsRA(true);
                p.setDescription("Right Ascension in the selected equinox, format: hh:mm:ss.sss");
                params.add(p);

                p = new FieldDescAdapter(DEC);
                p.setDescription("Declination in the selected equinox, format: dd:mm:ss.sss");
                p.setIsDec(true);
                params.add(p);

                p = new FieldDescAdapter(EQUINOX);
                p.setDescription("Equinox of RA and Dec");
                p.setOptions(_equinoxOptions);
                params.add(p);
            } else if (_rowCoordinates.isPix()) {
                hasCoords = true;

                p = new FieldDescAdapter(X);
                p.setDescription("The X pixel coordinate");
                p.setFieldClass(Double.class);
                params.add(p);

                p = new FieldDescAdapter(Y);
                p.setDescription("The Y pixel coordinate");
                p.setFieldClass(Double.class);
                params.add(p);
            }

            if (hasCoords) {
                if (isCatalog) {
                    p = new FieldDescAdapter(MIN_RADIUS);
                    p.setDescription("The minimum radius from the center coordinates in arcmin");
                    p.setFieldClass(Double.class);
                    p.setUnits("arcmin");
                    params.add(p);

                    p = new FieldDescAdapter(MAX_RADIUS);
                    p.setDescription("The maximum radius from the center coordinates in arcmin");
                    p.setFieldClass(Double.class);
                    p.setUnits("arcmin");
                    params.add(p);
                } else {
                    p = new FieldDescAdapter(WIDTH);
                    p.setDescription("The width about the center coordinates in arcmin");
                    p.setFieldClass(Double.class);
                    p.setUnits("arcmin");
                    params.add(p);

                    p = new FieldDescAdapter(HEIGHT);
                    p.setDescription("The height about the center coordinates in arcmin");
                    p.setFieldClass(Double.class);
                    p.setUnits("arcmin");
                    params.add(p);
                }
            }

            // Additional search parameters may be defined in the search_cols string
            if (!_servType.equals("local")) {
                checkSearchCols(params);
            }

            if (isCatalog) {
                p = new FieldDescAdapter(MAX_OBJECTS);
                p.setDescription("The maximum number of objects to return");
                p.setFieldClass(Integer.class);
                p.setDefaultValue(1000);
                params.add(p);
            }
            _paramDesc = new FieldDescAdapter[params.size()];
            params.toArray(_paramDesc);
        } else {
View Full Code Here


    // called for the <param> start tag
    public void _paramStart(Attributes attrs) {
        if (attrs != null) {
            _param = new FieldDescAdapter();
            int n = attrs.getLength();
            for (int i = 0; i < n; i++) {
                String name = attrs.getQName(i);
                String value = attrs.getValue(i);
                if (name.equals("id")) {
View Full Code Here

            StringTokenizer st = new StringTokenizer(searchCols, ":");
            int n = st.countTokens();
            for (int i = 0; i < n; i++) {
                String s = st.nextToken();
                String[] ar = TclUtil.splitList(s);
                FieldDescAdapter p;
                if (ar.length == 3) {
                    p = new FieldDescAdapter(ar[1]);
                    p.setId(ar[0]);
                    p.setIsMin(true);
                    params.add(p);
                    p = new FieldDescAdapter(ar[2]);
                    p.setId(ar[0]);
                    p.setIsMax(true);
                    params.add(p);
                } else if (ar.length == 2) {
                    p = new FieldDescAdapter(ar[1]);
                    params.add(p);
                } else {
                    throw new RuntimeException("Invalid format for search columns specification: " + s);
                }
            }
View Full Code Here

                NodeList params = topEl.getElementsByTagName("PARAM");
                _fieldDesc = new FieldDescAdapter[params.getLength()];
                for (int i = 0; i < _fieldDesc.length; i++) {
                    Element param = (Element) params.item(i);
                    _fieldDesc[i] = new FieldDescAdapter(_getName(param));
                    _fieldDesc[i].setDisplayName(_getDisplayName(param));
                    _fieldDesc[i].setUCD(param.getAttribute("ucd"));
                    _fieldDesc[i].setType(param.getAttribute("utype"));

                    NodeList nodeList = param.getElementsByTagName("DESCRIPTION");
View Full Code Here

        // table header
        for (int i = 0; i < ncols; i++) {
            String colName = hdu.getColumnName(i);
            //noinspection unchecked
            columnIdentifiers.add(colName);
            fields[i] = new FieldDescAdapter(colName);
            columnClasses.add(null);
        }
        setColumnClasses(columnClasses);
        setFields(fields);
View Full Code Here

                return;
            }
        }
        TableModel model = table.getModel();
        FieldDesc[] fieldDesc = new FieldDesc[]{
            new FieldDescAdapter(model.getColumnName(0)),
            new FieldDescAdapter(model.getColumnName(1))
        };
        int numRows = model.getRowCount();
        int numCols = model.getColumnCount();
        Vector<Vector<Object>> dataVector = new Vector<Vector<Object>>(numRows);
        for (int i = 0; i < numRows; i++) {
View Full Code Here

        cat.setName("SIMBAD Names");
        cat.setType(Catalog.NAME_SERVER);
        cat.setHost("archive.eso.org");
        cat.setURLPath("/skycat/servers/sim-server");
        FieldDescAdapter[] params = new FieldDescAdapter[1];
        params[0] = new FieldDescAdapter();
        FieldDescAdapter param = params[0];
        param.setName("Object Name");
        param.setId("o");
        param.setDescription("Enter the name of the object (star, galaxy)");
        cat.setParams(params);
        CatalogFactory.registerCatalog(cat, false);

        cat = new AstroCatalog();
        cat.setId("ned@eso");
        cat.setName("NED Names");
        cat.setType(Catalog.NAME_SERVER);
        cat.setHost("archive.eso.org");
        cat.setURLPath("/skycat/servers/ned-server");
        params = new FieldDescAdapter[1];
        params[0] = new FieldDescAdapter();
        param = params[0];
        param.setName("Object Name");
        param.setId("o");
        param.setDescription("Enter the name of the object (star, galaxy)");
        cat.setParams(params);
        CatalogFactory.registerCatalog(cat, false);
    }
View Full Code Here

TOP

Related Classes of jsky.catalog.FieldDescAdapter

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.