Package ucar.nc2.dt

Examples of ucar.nc2.dt.GridCoordSystem


    GridDataset ds = GridDataset.open(uri);
    GeoGrid grid = ds.findGridByName(var);
    Section s = new Section(grid.getShape());
    System.out.printf("var = %s %n", s);

    GridCoordSystem gcs = grid.getCoordinateSystem();
    VerticalTransform vt = gcs.getVerticalTransform();
    ArrayDouble.D3 z = vt.getCoordinateArray(0);
    Section sv = new Section(z.getShape());
    System.out.printf("3dcoord = %s %n", sv);

    s = s.removeRange(0);
View Full Code Here


    GridDataset gds = ucar.nc2.dt.grid.GridDataset.open(TestAll.cdmUnitTestDir + "transforms/roms_ocean_s_coordinate.nc");

    GridDatatype grid = gds.findGridDatatype("temp");
    assert grid != null;

    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert gcs != null;

    VerticalCT vct = gcs.getVerticalCT();
    assert vct != null;
    assert vct.getVerticalTransformType() == VerticalCT.Type.OceanS;

    VerticalTransform vt = gcs.getVerticalTransform();
    assert vt != null;

    ArrayDouble.D3 ca = vt.getCoordinateArray(0);
    assert ca != null;
    assert ca.getRank() == 3 : ca.getRank();
View Full Code Here

    GridDataset gds = ucar.nc2.dt.grid.GridDataset.open( TestAll.cdmUnitTestDir + "conventions/cf/gomoos_cf.nc");

    GridDatatype grid = gds.findGridDatatype("temp");
    assert grid != null;

    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert gcs != null;

    VerticalCT vct = gcs.getVerticalCT();
    assert vct != null;
    assert vct.getVerticalTransformType() == VerticalCT.Type.OceanSigma;

    VerticalTransform vt = gcs.getVerticalTransform();
    assert vt != null;

    ArrayDouble.D3 ca = vt.getCoordinateArray(0);
    assert ca != null;
    assert ca.getRank() == 3 : ca.getRank();
View Full Code Here

    GridDataset gds = ucar.nc2.dt.grid.GridDataset.open( TestAll.cdmUnitTestDir + "transforms/temperature.nc");

    GridDatatype grid = gds.findGridDatatype("Temperature");
    assert grid != null;

    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert gcs != null;

    VerticalCT vct = gcs.getVerticalCT();
    assert vct != null;
    assert vct.getVerticalTransformType() == VerticalCT.Type.Sigma;

    VerticalTransform vt = gcs.getVerticalTransform();
    assert vt != null;

    ArrayDouble.D3 ca = vt.getCoordinateArray(0);
    assert ca != null;
    assert ca.getRank() == 3 : ca.getRank();
View Full Code Here

    GridDataset gds = ucar.nc2.dt.grid.GridDataset.open( TestAll.cdmUnitTestDir + "conventions/cf/ccsm2.nc");

    GridDatatype grid = gds.findGridDatatype("T");
    assert grid != null;

    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert gcs != null;

    VerticalCT vct = gcs.getVerticalCT();
    assert vct != null;
    assert vct.getVerticalTransformType() == VerticalCT.Type.HybridSigmaPressure : vct.getVerticalTransformType();

    VerticalTransform vt = gcs.getVerticalTransform();
    assert vt != null;

    ArrayDouble.D3 ca = vt.getCoordinateArray(0);
    assert ca != null;
    assert ca.getRank() == 3 : ca.getRank();
View Full Code Here

    GridDataset gds = ucar.nc2.dt.grid.GridDataset.open( TestAll.cdmUnitTestDir + "conventions/wrf/wrfout_v2_Lambert.nc");

    GridDatatype grid = gds.findGridDatatype("T");
    assert grid != null;

    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert gcs != null;

    VerticalCT vct = gcs.getVerticalCT();
    assert vct != null;
    assert vct.getVerticalTransformType() == VerticalCT.Type.WRFEta : vct.getVerticalTransformType();

    VerticalTransform vt = gcs.getVerticalTransform();
    assert vt != null;

    ArrayDouble.D3 ca = vt.getCoordinateArray(0);
    assert ca != null;
    assert ca.getRank() == 3 : ca.getRank();
View Full Code Here

    GridDatatype grid = gds.findGridDatatype("T");
    assert grid != null;

    grid = grid.makeSubset(null,null,null,1,2,4);

    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert gcs != null;

    VerticalTransform vt = gcs.getVerticalTransform();
    assert vt != null;

    ArrayDouble.D3 ca = vt.getCoordinateArray(0);
    assert ca != null;
    assert ca.getRank() == 3 : ca.getRank();
View Full Code Here

  public Element genCoverageOfferingElem( String covId )
  {
    // ToDo WCS 1.0Plus - Change GridDatatype to GridDataset.Gridset
    WcsCoverage coverage = this.getDataset().getAvailableCoverage( covId );
    GridCoordSystem gridCoordSystem = coverage.getCoordinateSystem();

    // CoverageDescription/CoverageOffering (wcs) [1..*]
    Element covDescripElem = genCoverageOfferingBriefElem( "CoverageOffering", covId,
                                                           coverage.getLabel(), coverage.getDescription(),
                                                           gridCoordSystem );
View Full Code Here

    // ToDo WCS 1.0PlusPlus - compartmentalize coverage to hide GridDatatype vs GridDataset.Gridset ???
    // ToDo WCS 1.0Plus - change FROM coverage for each parameter TO coverage for each coordinate system
    // This is WCS 1.0 coverage for each parameter
    for ( GridDatatype curGridDatatype : this.dataset.getGrids() )
    {
      GridCoordSystem gcs = curGridDatatype.getCoordinateSystem();
      if ( !gcs.isRegularSpatial() )
        continue;
      this.availableCoverages.put( curGridDatatype.getFullName(), new WcsCoverage( curGridDatatype, this) );
    }
    // ToDo WCS 1.0Plus - change FROM coverage for each parameter TO coverage for each coordinate system
    // This is WCS 1.1 style coverage for each coordinate system
View Full Code Here

  public void testSubset() throws Exception {
    ucar.nc2.dt.grid.GridDataset dataset = GridDataset.open(TestGrid.topDir+"rankTest.nc");

    GeoGrid grid = dataset.findGridByName("full4");
    assert null != grid;
    GridCoordSystem gcs = grid.getCoordinateSystem();
    assert null != gcs;
    assert grid.getRank() == 4;

    doRead4(grid);

    GeoGrid grid_section = grid.subset(null, new Range(0,3,2), null, null);
    GridCoordSystem gcs_section = grid_section.getCoordinateSystem();
    CoordinateAxis zaxis = gcs_section.getVerticalAxis();
    assert zaxis.getSize() == 2;

    assert gcs_section.getXHorizAxis().equals( gcs.getXHorizAxis());
    assert gcs_section.getYHorizAxis().equals( gcs.getYHorizAxis());
    assert gcs_section.getTimeAxis().equals( gcs.getTimeAxis());

    Array data = grid_section.readDataSlice(-1, -1, -1, -1);
    NCdump.printArray( data, "grid_section", System.out,  null);

    dataset.close();
View Full Code Here

TOP

Related Classes of ucar.nc2.dt.GridCoordSystem

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.