Package nom.tam.fits

Examples of nom.tam.fits.Header


    private double retrieveJDReference(BasicHDU[] hdus) {
      double jdRef = 0;

      for (BasicHDU hdu : hdus) {
        // Get reference JD.
        Header header = hdu.getHeader();
        Double value = header.getDoubleValue("JD_REF");
        if (value != null) {
          jdRef = value;
          if (jdRef > 0)
            break;
        }
View Full Code Here


        }

        for (int i = 0; i < n; i++) {
            BasicHDU hdu = fitsImage.getHDU(i);
            if (hdu instanceof TableHDU) {
                Header header = hdu.getHeader();
                String name = header.getStringValue("EXTNAME");
                if (name != null && name.equals(extName)) {
                    try {
                        loadGraphicsFromImage((TableHDU) hdu);
                    } catch (Exception e) {
                        DialogUtil.error(e);
View Full Code Here

        FITSImage fitsImage = imageDisplay.getFitsImage();
        int n = fitsImage.getNumHDUs();
        for (int i = 0; i < n; i++) {
            BasicHDU hdu = fitsImage.getHDU(i);
            if (hdu instanceof TableHDU) {
                Header header = hdu.getHeader();
                String name = header.getStringValue("EXTNAME");
                if (name != null && name.equals(extName)) {
                    try {
                        fitsImage.getFits().deleteHDU(i);
                    } catch (Exception e) {
                        DialogUtil.error(e);
View Full Code Here

        if (fitsImage.getNumHDUs() > 1) {
            _primary = fitsImage.getHDU(0).getHeader();
            if (_primary == null)
                throw new IllegalArgumentException("No primary FITS extension header");
            if (_primary.getIntValue("NAXIS") != 0) {
                _primary = new Header(); // ignore if not an empty primary extension
            }
        } else {
            _primary = new Header();
        }
    }
View Full Code Here

            _table.setModel(new DefaultTableModel());
            return;
        }

        String[] columnNames = {"Keyword", "Value", "Comment"};
        Header header = hdu.getHeader();
        int numKeywords = header.getNumberOfCards();
        String[][] values = new String[numKeywords][3];
        Iterator it = header.iterator();
        int n = 0;
        while (it.hasNext()) {
            HeaderCard card = (HeaderCard) (it.next());
            String name = card.getKey();
            String value = card.getValue();
            String comment = card.getComment();
            values[n][0] = name;
            values[n][1] = value;
            values[n++][2] = comment;
        }

        _table.setModel(new DefaultTableModel(values, columnNames));
        //table.sizeColumnsToFit(-1);  // XXX workaround for Java bugID# 4226181
        _sumColWidths = TableUtil.initColumnSizes(_table, null);
        resize();
        updateTitle(header.getStringValue("EXTNAME"));
    }
View Full Code Here

        columnIdentifiers = new Vector(ncols);

        List<Class> columnClasses = new ArrayList<Class>(ncols);
        FieldDesc[] fields = new FieldDescAdapter[ncols];

        Header header = hdu.getHeader();
        String name = header.getStringValue("EXTNAME");
        if (name == null) {
            name = "FITS Table";
        }
        setName(name);
        setTitle(name);
View Full Code Here

     * @param hdu the HDU containing the FITS table
     */
    public static TableQueryResult getTable(String filename, Fits fits, TableHDU hdu)
            throws FitsException, IOException {

        Header header = hdu.getHeader();
        String name = header.getStringValue("EXTNAME");
        if (name != null) {
            // Check for a stored StarTable, which has a corresponding VOTMETA HDU with more info
            String votMetaName = VOTMETA + name.replace(TABLE_SUFFIX, "");
            BasicHDU votMetaHdu = findHDU(fits, votMetaName);
            if (votMetaHdu != null) {
View Full Code Here

        }

        int n = fits.getNumberOfHDUs();
        for (int hduIndex = 0; hduIndex < n; hduIndex++) {
            BasicHDU basicHDU = fits.getHDU(hduIndex);
            Header header = basicHDU.getHeader();
            String extName = header.getStringValue("EXTNAME");
            if (extName != null && extName.equals(name)) {
                return basicHDU;
            }
        }
View Full Code Here

    public static void deleteTable(Fits fits, String name) throws FitsException, IOException {
        int numHDUs = fits.getNumberOfHDUs();
        String votMetaName = VOTMETA + name.replace(TABLE_SUFFIX, "");
        for (int hduIndex = numHDUs - 1; hduIndex >= 0; hduIndex--) {
            BasicHDU basicHDU = fits.getHDU(hduIndex);
            Header header = basicHDU.getHeader();
            String extName = header.getStringValue("EXTNAME");
            if (extName != null && (extName.equals(name) || extName.equals(votMetaName))) {
                // delete the old table or metadata table
                fits.deleteHDU(hduIndex);
            }
        }
View Full Code Here

     */
    protected boolean _isHidden(BasicHDU hdu) {
        if (_showHiddenCheckBox.isSelected()) {
            return false;
        }
        Header header = hdu.getHeader();
        String name = header.getStringValue("EXTNAME");
        return name != null && (name.equals("CATINFO") || name.startsWith("VOTMETA") || name.equals(".GRAPHICS"));
    }
View Full Code Here

TOP

Related Classes of nom.tam.fits.Header

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.