Examples of Fits


Examples of nom.tam.fits.Fits

        // Use the StarJava classes to write the FITS table and then copy the HDUs into the FITS image file
        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();

        // add the new table (delete existing one, if found)
View Full Code Here

Examples of nom.tam.fits.Fits

    @SuppressWarnings({"UnusedDeclaration"})
    public FITSImage(SeekableStream input, FITSDecodeParam param, int page) throws IOException, FitsException {
//        _param = param;

        // Create a Fits object from the stream
        _fits = new Fits(input);
        _fits.read();

        // Switch to the specified HDU/extension
        if (_fits.getNumberOfHDUs() > page) {
            setHDU(page);
View Full Code Here

Examples of nom.tam.fits.Fits

    public FITSImage(String fileOrUrl) throws IOException, FitsException {
        // First try to open the file using the Fits classes, since they
        // work more efficiently with thier own I/O classes (they also handle
        // gzipped FITS files).
        try {
            _fits = new Fits(fileOrUrl);
            _fits.read();
        } catch (Throwable e) { // nom.tam.fits class throws Error in some cases
            // Might be an HCompressed FITS file...
            try {
                _fits = new Fits(new FitsFilterInputStream(_getStream(fileOrUrl)));
                _fits.read();
            } catch (Throwable e2) {
                //e2.printStackTrace();
                if (e instanceof FitsException) {
                    throw (FitsException) e;
View Full Code Here

Examples of nom.tam.fits.Fits

     */
    public FITSImage(final Object ar) throws IOException, FitsException {
        ImageData data = new ImageData(ar);
        Header header = new Header(data);
        ImageHDU hdu = new ImageHDU(header, data);
        _fits = new Fits();
        _fits.addHDU(hdu);

        // Default to the primary HDU
        setHDU(0);

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.