Package org.geotools.imageio.netcdf

Examples of org.geotools.imageio.netcdf.NetCDFImageReaderSpi


        }
        if (!file.exists()) {
            LOGGER.warning("Unable to find file polyphemus_20130301.nc");
            return;
        }
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            assertEquals(1008, numImages);
            for (int i = 0; i < numImages; i++) {
                Slice2DIndex sliceIndex = reader.getSlice2DIndex(i);
View Full Code Here


    }

    @Test
    public void testImageReaderPolyphemusSimple() throws Exception {
        final File file = TestData.file(this, "O3-NO2.nc");
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {

            // checking low level
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            LOGGER.info("Found " + numImages + " images.");
            for (int i = 0; i < numImages; i++) {
                Slice2DIndex sliceIndex = reader.getSlice2DIndex(i);
View Full Code Here

            }
        }

        assertTrue(speedVariableIsPresent);

        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {

            // sample dataset containing a water_speed variable having
            // only time, depth dimensions. No lon/lat dims are present
            // resulting into variable not usable.
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            final List<Name> names = reader.getCoveragesNames();

            boolean isSpeedCoverageAvailable = false;
            for (Name name : names) {
View Full Code Here

        }
        if (!file.exists()) {
            LOGGER.warning("Unable to find file IASI_C_EUMP_20121120062959_31590_eps_o_l2.nc");
            return;
        }
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            for (int i = 0; i < numImages; i++) {
                Slice2DIndex sliceIndex = reader.getSlice2DIndex(i);
                assertNotNull(sliceIndex);
View Full Code Here

    }

    @Test
    public void testImageReaderGOME2() throws Exception {
        final File file = TestData.file(this, "20130101.METOPA.GOME2.NO2.DUMMY.nc");
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {

            // checking low level
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            assertEquals(1, numImages);
            LOGGER.info("Found " + numImages + " images.");
            for (int i = 0; i < numImages; i++) {
View Full Code Here

    }

    @Test
    public void testImageReaderGOME2AncillaryFiles() throws Exception {
        final File file = TestData.file(this, "20130101.METOPA.GOME2.NO2.DUMMY.nc");
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {

            // checking low level
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            assertEquals(1, numImages);
            LOGGER.info("Found " + numImages + " images.");
            for (int i = 0; i < numImages; i++) {
View Full Code Here

        }
        if (!file.exists()) {
            LOGGER.warning("Unable to find file ascatl1.nc");
            return;
        }
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            for (int i = 0; i < numImages; i++) {
                Slice2DIndex sliceIndex = reader.getSlice2DIndex(i);
                assertNotNull(sliceIndex);
View Full Code Here

            LOGGER.warning("Unable to find file polyphemus_20130301.nc");
            return;
        }
        FileUtils.copyFile(file, new File(TestData.file(this, null), "polyphemus.nc"));
        file = TestData.file(this, "polyphemus.nc");
        final NetCDFImageReaderSpi unidataImageReaderSpi = new NetCDFImageReaderSpi();
        assertTrue(unidataImageReaderSpi.canDecodeInput(file));
        NetCDFImageReader reader = null;
        try {
            reader = (NetCDFImageReader) unidataImageReaderSpi.createReaderInstance();
            reader.setInput(file);
            int numImages = reader.getNumImages(true);
            assertEquals(1008, numImages);
            for (int i = 0; i < numImages; i++) {
                Slice2DIndex sliceIndex = reader.getSlice2DIndex(i);
View Full Code Here

            FileUtils.deleteDirectory(TestData.file(this, ".polyphemus"));
        }
    }

    public void testReadRegularNetCDF() throws IOException {
        NetCDFImageReaderSpi readerSpi = new NetCDFImageReaderSpi();
        File file = null;
        try {
            file = TestData.file(this, "2DLatLonCoverageHDF5.nc");
        } catch (IOException e) {
            LOGGER.warning("Unable to find file 2DLatLonCoverageHDF5.nc");
            return;
        }
        assertTrue(readerSpi.canDecodeInput(file));
    }
View Full Code Here

        assertTrue(readerSpi.canDecodeInput(file));
    }

    @Test
    public void testReadNcML() throws IOException {
        NetCDFImageReaderSpi readerSpi = new NetCDFImageReaderSpi();
        File file = null;
        try {
            file = TestData.file(this, "2DLatLonCoverage.ncml");
        } catch (IOException e) {
            LOGGER.warning("Unable to find file 2DLatLonCoverage.ncml");
            return;
        }
        assertTrue(readerSpi.canDecodeInput(file));
    }
View Full Code Here

TOP

Related Classes of org.geotools.imageio.netcdf.NetCDFImageReaderSpi

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.