Tabnine Logo
VerticalTransform
Code IndexAdd Tabnine to your IDE (free)

How to use
VerticalTransform
in
ucar.unidata.geoloc.vertical

Best Java code snippets using ucar.unidata.geoloc.vertical.VerticalTransform (Showing top 20 results out of 315)

origin: edu.ucar/netcdf

public ArrayDouble.D3 getCoordinateArray(int subsetIndex)
    throws IOException, InvalidRangeException {
  int orgIndex = subsetIndex;
  if (isTimeDependent() && (t_range != null)) {
    orgIndex = t_range.element(subsetIndex);
  }
  ArrayDouble.D3 data = original.getCoordinateArray(orgIndex);
  return (ArrayDouble.D3) data.sectionNoReduce(subsetList);
}
 
origin: edu.ucar/netcdf

/**
 * Create a subset of an existing VerticalTransform
 * @param original make a subset of this
 * @param t_range subset the time dimension, or null if you want all of it
 * @param z_range subset the vertical dimension, or null if you want all of it
 * @param y_range subset the y dimension, or null if you want all of it
 * @param x_range subset the x dimension, or null if you want all of it
 */
public VerticalTransformSubset(VerticalTransform original, Range t_range,
                Range z_range, Range y_range, Range x_range) {
  super(null);  // timeDim not used in this class
  this.original = original;
  this.t_range  = t_range;
  subsetList.add(z_range);
  subsetList.add(y_range);
  subsetList.add(x_range);
  units = original.getUnitString();
}
origin: edu.ucar/cdm

  public boolean isTimeDependent() {
    return original.isTimeDependent();
  }
}
origin: Unidata/thredds

if (timeName == null) {
 vt = vct.makeVerticalTransform(ncd, null);
 assert !vt.isTimeDependent();
 ucar.ma2.Array coordVals = vt.getCoordinateArray(0);
 assert (null != coordVals);
 assert null != timeDim;
 vt = vct.makeVerticalTransform(ncd, timeDim);
 assert vt.isTimeDependent();
  ucar.ma2.ArrayDouble.D3 coordVals = vt.getCoordinateArray(i);
  assert (null != coordVals);
  Section cSection = new Section(coordVals.getShape());
 String vertCoordUnit = vt.getUnitString();
 assert vunit.isCompatible(vertCoordUnit) : vertCoordUnit + " not udunits compatible with " + vunit.getUnitString();
origin: Unidata/thredds

private void testGrid(String uri, String var) throws IOException, InvalidRangeException {
 GridDataset ds = null;
 try {
  ds = GridDataset.open(uri);
  GeoGrid grid = ds.findGridByName(var);
  Section s = new Section(grid.getShape());
  System.out.printf("var = %s %n", s);
  GridCoordSystem GridCoordS = grid.getCoordinateSystem();
  VerticalTransform vt = GridCoordS.getVerticalTransform();
  ArrayDouble.D3 z = vt.getCoordinateArray(0);
  Section sv = new Section(z.getShape());
  System.out.printf("3dcoord = %s %n", sv);
  if (vt.isTimeDependent())
   s = s.removeRange(0);
  assert s.equals(sv);
 } finally {
  if (ds != null) ds.close();
 }
}
origin: Unidata/thredds

private void testGrid( GeoGrid grid) throws IOException, InvalidRangeException {
 assert null != grid;
 GridCoordSystem gcs = grid.getCoordinateSystem();
 assert null != gcs;
 assert grid.getRank() == 4;
 Array data = grid.readDataSlice(0, -1, -1, -1);
 assert data.getRank() == 3;
 CoordinateAxis zaxis = gcs.getVerticalAxis();
 assert data.getShape()[0] == zaxis.getSize() : zaxis.getSize();
 CoordinateAxis yaxis = gcs.getYHorizAxis();
 assert data.getShape()[1] == yaxis.getSize() : yaxis.getSize();
 CoordinateAxis xaxis = gcs.getXHorizAxis();
 assert data.getShape()[2] == xaxis.getSize() : xaxis.getSize();
 VerticalTransform vt = gcs.getVerticalTransform();
 assert vt != null;
 assert vt.getUnitString() != null;
 ucar.ma2.ArrayDouble.D3 vcoord = vt.getCoordinateArray(0);
 assert vcoord.getShape()[0] ==  zaxis.getSize() : vcoord.getShape()[0];
 assert vcoord.getShape()[1] ==  yaxis.getSize() : vcoord.getShape()[1];
 assert vcoord.getShape()[2] ==  xaxis.getSize() : vcoord.getShape()[2];
}
origin: edu.ucar/cdm

vt = vtFrom.subset(t_range, z_range, y_range, x_range);
origin: Unidata/thredds

private double[] getVertTransformationForPoint(ProjectionPoint point, int timeIndex, GeoGrid grid) throws IOException, InvalidRangeException{
  VerticalTransform vt =  grid.getCoordinateSystem().getVerticalTransform();
  //System.out.println(vt.isTimeDependent());
  int[] pointIndices = new int[]{0,0}; 
  
  grid.getCoordinateSystem().findXYindexFromCoord( point.getX(), point.getY(), pointIndices);        
  
  ArrayDouble.D1 dataArr = vt.getCoordinateArray1D(timeIndex, pointIndices[0], pointIndices[1]);
  
  return (double[])dataArr.copyTo1DJavaArray();
}    

origin: edu.ucar/netcdf

vt = vtFrom.subset(t_range, z_range, y_range, x_range);
origin: edu.ucar/cdm

public ArrayDouble.D3 getCoordinateArray(int subsetIndex)
    throws IOException, InvalidRangeException {
  int orgIndex = subsetIndex;
  if (isTimeDependent() && (t_range != null)) {
    orgIndex = t_range.element(subsetIndex);
  }
  ArrayDouble.D3 data = original.getCoordinateArray(orgIndex);
  return (ArrayDouble.D3) data.sectionNoReduce(subsetList);
}
 
origin: Unidata/thredds

/**
 * Create a subset of an existing VerticalTransform
 * @param original make a subset of this
 * @param t_range subset the time dimension, or null if you want all of it
 * @param z_range subset the vertical dimension, or null if you want all of it
 * @param y_range subset the y dimension, or null if you want all of it
 * @param x_range subset the x dimension, or null if you want all of it
 */
public VerticalTransformSubset(VerticalTransform original, Range t_range,
                Range z_range, Range y_range, Range x_range) {
  super(null);  // timeDim not used in this class
  this.original = original;
  this.t_range  = t_range;
  subsetList.add(z_range);
  subsetList.add(y_range);
  subsetList.add(x_range);
  units = original.getUnitString();
}
origin: edu.ucar/netcdf

  public boolean isTimeDependent() {
    return original.isTimeDependent();
  }
}
origin: Unidata/thredds

vt = vtFrom.subset(t_range, z_range, y_range, x_range);
origin: Unidata/thredds

public ArrayDouble.D3 getCoordinateArray(int subsetIndex)
    throws IOException, InvalidRangeException {
  int orgIndex = subsetIndex;
  if (isTimeDependent() && (t_range != null)) {
    orgIndex = t_range.element(subsetIndex);
  }
  ArrayDouble.D3 data = original.getCoordinateArray(orgIndex);
  return (ArrayDouble.D3) data.sectionNoReduce(subsetList);
}
 
origin: edu.ucar/cdm

/**
 * Create a subset of an existing VerticalTransform
 * @param original make a subset of this
 * @param t_range subset the time dimension, or null if you want all of it
 * @param z_range subset the vertical dimension, or null if you want all of it
 * @param y_range subset the y dimension, or null if you want all of it
 * @param x_range subset the x dimension, or null if you want all of it
 */
public VerticalTransformSubset(VerticalTransform original, Range t_range,
                Range z_range, Range y_range, Range x_range) {
  super(null);  // timeDim not used in this class
  this.original = original;
  this.t_range  = t_range;
  subsetList.add(z_range);
  subsetList.add(y_range);
  subsetList.add(x_range);
  units = original.getUnitString();
}
origin: Unidata/thredds

  public boolean isTimeDependent() {
    return original.isTimeDependent();
  }
}
origin: edu.ucar/cdm

ArrayDouble.D3 data = original.getCoordinateArray(timeIndex);
origin: Unidata/thredds

@Test
@Category(NeedsCdmUnitTest.class)
public void testWRF() throws Exception {
 try(GridDataset dataset = GridDataset.open(TestDir.cdmUnitTestDir + "conventions/wrf/wrfout_v2_Lambert.nc")) {
  GeoGrid grid = dataset.findGridByName("T");
  assert null != grid;
  GridCoordSystem gcs = grid.getCoordinateSystem();
  assert null != gcs;
  assert grid.getRank() == 4;
  CoordinateAxis zaxis = gcs.getVerticalAxis();
  assert zaxis.getSize() == 27;
  VerticalTransform vt = gcs.getVerticalTransform();
  assert vt != null;
  assert vt.getUnitString().equals("Pa");
  GeoGrid grid_section = grid.subset(null, null, null, 3, 3, 3);
  Array data = grid_section.readDataSlice(-1, -1, -1, -1);
  assert data.getShape()[0] == 13 : data.getShape()[0];
  assert data.getShape()[1] == 9 : data.getShape()[1];
  assert data.getShape()[2] == 20 : data.getShape()[2];
  assert data.getShape()[3] == 25 : data.getShape()[3];
  GridCoordSystem gcs_section = grid_section.getCoordinateSystem();
  CoordinateAxis zaxis2 = gcs_section.getVerticalAxis();
  assert zaxis2.getSize() == 9 : zaxis2.getSize();
  assert zaxis2.getUnitsString().equals(zaxis.getUnitsString());
  assert gcs_section.getTimeAxis().equals(gcs.getTimeAxis());
  VerticalTransform vt_section = gcs_section.getVerticalTransform();
  assert vt_section != null;
  assert vt_section.getUnitString().equals(vt.getUnitString());
 }
}
origin: Unidata/thredds

ArrayDouble.D3 data = original.getCoordinateArray(timeIndex);
origin: edu.ucar/netcdf

ArrayDouble.D3 data = original.getCoordinateArray(timeIndex);
ucar.unidata.geoloc.verticalVerticalTransform

Javadoc

A transformation to a vertical reference coordinate system, such as height or pressure.

Most used methods

  • getCoordinateArray
    Get the 3D vertical coordinate array for this time step. Must be in "canonical order" : z, y, x.
  • getUnitString
    Get the unit string for the vertical coordinate.
  • isTimeDependent
    Get whether this coordinate is time dependent.
  • subset
    Create a VerticalTransform as a section of an existing VerticalTransform.
  • getCoordinateArray1D
    Get the 1D vertical coordinate array for this time step and the specified X,Y index for Lat-Lon poin

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JList (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now