예제 #1
0
  /**
   * Create a new vertical transform for Ocean_S_coordinate_g2
   *
   * @param ds dataset
   * @param timeDim time dimension
   * @param params list of transformation Parameters
   */
  public OceanSG2(NetcdfFile ds, Dimension timeDim, List<Parameter> params) {

    super(timeDim);
    String etaName = getParameterStringValue(params, ETA);
    String sName = getParameterStringValue(params, S);
    String depthName = getParameterStringValue(params, DEPTH);
    String depthCName = getParameterStringValue(params, DEPTH_C);
    String cName = getParameterStringValue(params, C);

    etaVar = ds.findVariable(etaName);
    sVar = ds.findVariable(sName);
    depthVar = ds.findVariable(depthName);
    depthCVar = ds.findVariable(depthCName);
    cVar = ds.findVariable(cName);

    units = ds.findAttValueIgnoreCase(depthVar, CDM.UNITS, "none");
  }
예제 #2
0
  public void test1() throws IOException, InvalidRangeException {
    String filename = "file:./" + TestNcML.topDir + "aggSynthetic.xml";
    NetcdfFile ncfile = NcMLReader.readNcML(filename, null);

    Variable v = ncfile.findVariable("time");
    assert v != null;
    String testAtt = ncfile.findAttValueIgnoreCase(v, "units", null);
    assert testAtt != null;
    assert testAtt.equals("months since 2000-6-16 6:00");

    testDimensions(ncfile);
    testCoordVar(ncfile);
    testAggCoordVar(ncfile);
    testReadData(ncfile, "T");
    testReadSlice(ncfile, "T");

    ncfile.close();
  }