Examples of BasicHDU


Examples of nom.tam.fits.BasicHDU

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        new FitsPlusTableWriter().writeStarTable(table.getStarTable(), os);
        ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
        Fits tableFits = new Fits(is);

        BasicHDU votMetaHdu = tableFits.getHDU(0);
        votMetaHdu.getHeader().addValue("EXTNAME", votMetaName, "Table metadata in VOTable format");

        TableHDU hdu = (TableHDU) tableFits.getHDU(1);
        hdu.getHeader().addValue("EXTNAME", tableName, "Contains saved query results");
        is.close();
        os.close();
View Full Code Here

Examples of nom.tam.fits.BasicHDU

     */
    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

Examples of nom.tam.fits.BasicHDU

        _fitsImage = fitsImage;
        int numRows = _fitsImage.getNumHDUs();
        _tableData = new Object[numRows][NUM_COLS];
        int count = 0;
        for (int row = 0; row < numRows; row++) {
            BasicHDU hdu = _fitsImage.getHDU(row);
            if (_isHidden(hdu)) {
                continue;
            }
            Header header = hdu.getHeader();
            _tableData[count][HDU_INDEX] = row;
            _tableData[count][TYPE_INDEX] = _getHDUType(hdu);
            _tableData[count][EXTNAME_INDEX] = header.getStringValue("EXTNAME");
            _tableData[count][NAXIS_INDEX] = header.getIntValue("NAXIS");
            _tableData[count][NAXIS1_INDEX] = header.getIntValue("NAXIS1");
View Full Code Here

Examples of nom.tam.fits.BasicHDU

    /**
     * Return the given HDU or null if it can not be accessed.
     */
    public BasicHDU getHDU(int num) {
        BasicHDU hdu = null;
        // XXX how to handle errors...
        try {
            hdu = _fits.getHDU(num);
        } catch (Exception ignored) {
        }
View Full Code Here

Examples of nom.tam.fits.BasicHDU

        if (_hduIndex == num) {
            return;
        }

        _hduIndex = num;
        BasicHDU hdu = _fits.getHDU(num);
        if (hdu instanceof ImageHDU) {
            _hdu = (ImageHDU) _fits.getHDU(num);
            _tiler = _hdu.getTiler();
            _axes = _hdu.getAxes();
            _header = _hdu.getHeader();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.