/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package uk.ac.rdg.resc.ncwms.coordsys;

import ucar.nc2.constants.FeatureType;
import ucar.nc2.dataset.NetcdfDataset;
import ucar.nc2.dt.GridCoordSystem;
import ucar.nc2.dt.GridDataset;
import ucar.nc2.dt.GridDatatype;
import ucar.nc2.dt.TypedDatasetFactory;

/**
 *
 * @author jon
 */
public class EumetsatGribTest {

    public static void main(String[] args) throws Exception
    {
        NetcdfDataset nc = NetcdfDataset.openDataset("/home/jon/Godiva2_data/EUMETSAT_TEST/grib/MSG2-SEVI-MSGCLMK-0100-0100-20091028120000.000000000Z-958792.grb");
        GridDataset gd = (GridDataset)TypedDatasetFactory.open(FeatureType.GRID, nc, null, null);
        GridDatatype grid = gd.findGridDatatype("Cloud_mask");
        GridCoordSystem coordSys = grid.getCoordinateSystem();

        System.out.println(coordSys.getProjection().getClass());
        System.out.println(coordSys.getLatLonBoundingBox());

        nc.close();
    }

}
