Examples of VariableDS


Examples of ucar.nc2.dataset.VariableDS

    SimpleDateFormat format = new SimpleDateFormat("ddMMMyyyyHHmm");
    format.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
    try {
      Date d = format.parse(dateS+timeS);
      VariableDS time = new VariableDS(ds, vhrr, null, "time", DataType.LONG, "",
          "seconds since 1970-01-01 00:00", "time generated from PRODUCT_METADATA/PRODUCT_DETAILS");

      time.addAttribute( new Attribute(_Coordinate.AxisType, AxisType.Time.toString())); // // LOOK : cant handle scalar coordinates yet ??
      time.addAttribute( new Attribute("IsoDate", new DateFormatter().toDateTimeStringISO(d)));
      ds.addVariable(vhrr, time);
      ArrayLong.D0 timeData = new ArrayLong.D0();
      timeData.set(d.getTime() / 1000);
      time.setCachedData(timeData, true);

    } catch (ParseException e) {
      e.printStackTrace();
      throw new IOException(e.getMessage());
    }
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

    if (t == null) return null;

    String axisName = t.findCoordinateVariableName(coordName);

    if (axisName != null) {
      VariableDS v = t.findVariable(axisName);
      if (v != null)
        return new CoordVarExtractorVariable(v, axisName, nestingLevel);

      if (t.extraJoins != null) {
        for (Join j : t.extraJoins) {
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

           ! curVar.equals( this.latVar) &&
           ! curVar.equals( this.lonVar) &&
           ! curVar.equals( this.elevVar) &&
           ( this.recordVar == null ? true : ! curVar.equals( this.recordVar)))
      {
        MyTypedDataVariable typedVar = new MyTypedDataVariable( new VariableDSnull, curVar, true ) );
        dataVariables.add( typedVar);
        trajectoryVarsMap.put( typedVar.getShortName(), typedVar);
      }
    }
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

  }

  public void testDataset() {
    Variable v = ncfile.findVariable("lflx");
    assert v instanceof VariableDS;
    VariableDS vds = (VariableDS) v;
    assert vds.getOriginalDataType() == v.getDataType();

    Variable org = vds.getOriginalVariable();
    assert vds.getOriginalDataType() == org.getDataType();

    assert !(org instanceof VariableDS);

    assert v.getParentGroup().equals(org.getParentGroup());
    assert v.getParentGroup() != org.getParentGroup();
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

                    && !curVar.equals(this.elevVar)
                    && ((this.recordVar == null)
                        ? true
                        : !curVar.equals(this.recordVar))) {
                MyTypedDataVariable typedVar =
                    new MyTypedDataVariable(new VariableDS(null, curVar,
                        true));
                dataVariables.add(typedVar);
                trajectoryVarsMap.put(typedVar.getShortName(), typedVar);
            }
        }
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

           ! curVar.equals( this.latVar) &&
           ! curVar.equals( this.lonVar) &&
           ! curVar.equals( this.elevVar) &&
           ( this.recordVar == null ? true : ! curVar.equals( this.recordVar)))
      {
        MyTypedDataVariable typedVar = new MyTypedDataVariable( new VariableDSnull, curVar, true ) );
        dataVariables.add( typedVar);
        trajectoryVarsMap.put( typedVar.getShortName(), typedVar);
      }
    }
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

      "  </aggregation>\n" +
      "</netcdf>";
    NetcdfFile ncfile = NcMLReader.readNcML(new StringReader(xml), "aggFmrcScaling", null);

    // make sure that scaling is applied
    VariableDS vs = (VariableDS) ncfile.findVariable("hs");
    Array data = vs.read("0,1,:,:)");
    while (data.hasNext()) {
      float val = data.nextFloat();
      if (!vs.isMissing(val))
        assert (val < 10.0) : val;
      //System.out.printf("%f %n",val);
    }

    ncfile.close();
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

  public void testScaling2() throws Exception {
    NetcdfFile ncfile = NetcdfDataset.acquireFile("file:D:/work/signell/efine/fine.ncml", null);

    // make sure that scaling is applied
    VariableDS vs = (VariableDS) ncfile.findVariable("hs");
    Array data = vs.read("0,1,:,:)");
    while (data.hasNext()) {
      float val = data.nextFloat();
      if (!vs.isMissing(val))
        assert (val < 10.0) : val;
      //System.out.printf("%f %n",val);
    }

    ncfile.close();
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

    List<VariableSimpleIF> varList = new ArrayList<VariableSimpleIF>();
    for (Variable v : allList) {
      if ((v.getRank() == 1) && v.getDimension(0).equals(manDim)) {
        // public VariableDS(NetcdfDataset ds, Group group, Structure parentStructure, String shortName, DataType dataType,
        // String dims, String units, String desc) {
        varList.add( new VariableDS(ncfile, null, null, v.getShortName(), v.getDataType(), "", v.getUnitsString(), v.getDescription()));
        //(String name, String desc, String units, DataType dtype, int []shape)
        sm.addMember(v.getShortName(), v.getDescription(), v.getUnitsString(), v.getDataType() , new int[0]); // scalar
      }
    }
View Full Code Here

Examples of ucar.nc2.dataset.VariableDS

  }

  public void testDataset() {
    Variable v = ncfile.findVariable("ReletiveHumidity");
    assert v instanceof VariableDS;
    VariableDS vds = (VariableDS) v;
    assert vds.getOriginalDataType() == v.getDataType();

    Variable org = vds.getOriginalVariable();
    assert vds.getOriginalDataType() == org.getDataType();

    assert v.getParentGroup().equals(org.getParentGroup());
    assert v.getParentGroup() != org.getParentGroup();

    // its a VariableDS because the renaming causes a VariableDS wrapper.
    assert (org instanceof VariableDS);

    vds = (VariableDS) org;
    org = vds.getOriginalVariable();
    assert vds.getOriginalDataType() == org.getDataType();
    assert !(org instanceof VariableDS);

    assert v.getParentGroup().equals(org.getParentGroup());
    assert v.getParentGroup() != org.getParentGroup();
  }
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.