Codota Logo
Variable.getRank
Code IndexAdd Codota to your IDE (free)

How to use
getRank
method
in
ucar.nc2.Variable

Best Java code snippets using ucar.nc2.Variable.getRank (Showing top 20 results out of 315)

  • Common ways to obtain Variable
private void myMethod () {
Variable v =
  • Codota IconNetcdfFile ds;String fullNameEscaped;ds.findVariable(fullNameEscaped)
  • Codota IconNetcdfDataset ds;String obsTimeVName;ds.findVariable(obsTimeVName)
  • Codota IconGroup group;String varShortName;group.findVariable(varShortName)
  • Smart code suggestions by Codota
}
origin: geotools/geotools

/**
 * Get Z Dimension Lenght for standard CF variables
 *
 * @param var
 * @return
 */
public static int getZDimensionLength(Variable var) {
  final int rank = var.getRank();
  if (rank > 2) {
    return var.getDimension(rank - Z_DIMENSION).getLength();
  }
  // TODO: Should I avoid use this method in case of 2D Variables?
  return 0;
}
origin: Unidata/thredds

/**
 * Whether this is a scalar Variable (rank == 0).
 *
 * @return true if Variable has rank 0
 */
public boolean isScalar() {
 return getRank() == 0;
}
origin: edu.ucar/netcdf

/**
 * Whether this is a scalar Variable (rank == 0).
 * @return true if Variable has rank 0
 */
public boolean isScalar() {
 return getRank() == 0;
}
origin: edu.ucar/netcdf

/**
 * Get the ith dimension.
 *
 * @param i index of the dimension.
 * @return requested Dimension, or null if i is out of bounds.
 */
public Dimension getDimension(int i) {
 if ((i < 0) || (i >= getRank())) return null;
 return dimensions.get(i);
}
origin: edu.ucar/netcdf

@Override
public boolean isChunked(Variable v) {
 int n = v.getRank();
 return n >= 2 || v.isUnlimited();
}
origin: edu.ucar/cdm

 private int[] computeChunkingGrib(Variable v) {
  int n = v.getRank();
  int[] result = new int[n];
  if( n < 2 ) {
    result[0] = 1; // Unlimited variable with rank 1

  } else {
    for (int i=0; i<n; i++)
      result[i] = (i<n-2) ? 1 : v.getDimension(i).getLength();
  }    
  return result;
 }
}
origin: edu.ucar/netcdf

private void addDimensionsAll(List<Dimension> result, Variable v) {
 if (v.isMemberOfStructure())
  addDimensionsAll(result, v.getParentStructure());
 for (int i=0; i<v.getRank(); i++)
  result.add( v.getDimension(i));
}
origin: edu.ucar/netcdf

protected void addRadialVariable(NetcdfDataset nds, Variable var) {
  RadialVariable rsvar = null;
  String vName = var.getShortName() ;
  int rnk = var.getRank();
  if(rnk == 2)  {
    VariableSimpleIF v = new MyRadialVariableAdapter(vName, var.getAttributes());
    rsvar = makeRadialVariable(nds, v, var);
  }
  if(rsvar != null)
    dataVariables.add(rsvar);
}
origin: edu.ucar/cdm

private Dorade2Variable(NetcdfDataset nds, VariableSimpleIF v, Variable v0) {
 super(v.getShortName(), v0.getAttributes());
 sweeps = new ArrayList();
 name = v.getShortName();
 int[] shape = v0.getShape();
 int count = v0.getRank() - 1;
 int ngates = shape[count];
 count--;
 int nrays = shape[count];
 sweeps.add( new Dorade2Sweep(v0, 0, nrays, ngates)) ;
}
origin: Unidata/thredds

private Dorade2Variable(NetcdfDataset nds, VariableSimpleIF v, Variable v0) {
 super(v.getShortName(), v0.getAttributes());
 sweeps = new ArrayList();
 name = v.getShortName();
 int[] shape = v0.getShape();
 int count = v0.getRank() - 1;
 int ngates = shape[count];
 count--;
 int nrays = shape[count];
 sweeps.add(new Dorade2Sweep(v0, 0, nrays, ngates));
}
origin: edu.ucar/cdm

protected void addRadialVariable(NetcdfDataset nds, Variable var) {
 RadialVariable rsvar = null;
 String vName = var.getShortName();
 int rnk = var.getRank();
 if (!var.getShortName().endsWith("RAW") && rnk == 2) {
  VariableSimpleIF v = new MyRadialVariableAdapter(vName, var.getAttributes());
  rsvar = new Nids2Variable(nds, v, var);
 }
 if (rsvar != null)
  dataVariables.add(rsvar);
}
origin: edu.ucar/cdm

public float[] readData() throws IOException {
 Array allData = null;
 int[] shape = sweepVar.getShape();
 int[] origind = new int[sweepVar.getRank()];
 try {
  allData = sweepVar.read(origind, shape);
 } catch (InvalidRangeException e) {
  throw new IOException(e.getMessage());
 }
 return (float[]) allData.get1DJavaArray(float.class);
}
origin: Unidata/thredds

protected Attribute getChunkAttribute(Variable v) {
 Attribute att = v.findAttribute(CDM.CHUNK_SIZES);
 if (att != null && att.getDataType().isIntegral() && att.getLength() == v.getRank())
  return att;
 return null;
}
origin: Unidata/thredds

void CheckInt32( Variable v) throws IOException {
 // int32
 //assert(null != (v = dodsfile.findVariable("types.integers.i32")));
 // assert v.getName().equals("types.integers.i32");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.INT;
 CheckInt32Value(v.read());
}
origin: Unidata/thredds

void CheckF( Variable v) throws IOException {
 // float
 //assert(null != (v = dodsfile.findVariable("types.floats.f32")));
 //assert v.getName().equals("types.floats.f32");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.FLOAT : v.getDataType();
 CheckFValue(v.read());
}
origin: Unidata/thredds

void CheckLong32( Variable v) throws IOException {
 // uint32
 //assert(null != (v = dodsfile.findVariable("types.integers.ui32")));
 //assert v.getName().equals("types.integers.ui32");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.LONG : v.getDataType();
 CheckLongValue(v.read());
}
origin: Unidata/thredds

void CheckUInt32( Variable v) throws IOException {
 // uint32
 //assert(null != (v = dodsfile.findVariable("types.integers.ui32")));
 //assert v.getName().equals("types.integers.ui32");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.UINT : v.getDataType();
 CheckUInt32Value(v.read());
}
origin: Unidata/thredds

void CheckUint16( Variable v) throws IOException {
 // uint16
 //assert(null != (v = dodsfile.findVariable("types.integers.ui16")));
 //assert v.getName().equals("types.integers.ui16");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.USHORT : v.getDataType();
  CheckUInt16Value(v.read());
}
origin: Unidata/thredds

void CheckUint32( Variable v) throws IOException {
 // uint32
 //assert(null != (v = dodsfile.findVariable("types.integers.ui32")));
 //assert v.getName().equals("types.integers.ui32");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.UINT : v.getDataType();
 CheckUint32Value(v.read());
}
origin: Unidata/thredds

void CheckUint16( Variable v) throws IOException {
 // uint16
 //assert(null != (v = dodsfile.findVariable("types.integers.ui16")));
 //assert v.getName().equals("types.integers.ui16");
 assert v.getRank() == 0;
 assert v.getSize() == 1;
 assert v.getDataType() == DataType.USHORT : v.getDataType();
  CheckUInt16Value(v.read());
}
ucar.nc2VariablegetRank

Javadoc

Get the number of dimensions of the Variable.

Popular methods of Variable

  • read
    Read a section of the data for this Variable and return a memory resident Array. The Array has the s
  • getDataType
    Get the data type of the Variable.
  • findAttribute
    Find an Attribute by name.
  • getFullName
  • getAttributes
    Returns the set of attributes for this variable.
  • getDimensions
    Get the list of dimensions used by this variable. The most slowly varying (leftmost for Java and C p
  • getShape
    Get the size of the ith dimension
  • addAttribute
    Add new or replace old if has same name
  • getDimension
  • getSize
    Get the total number of elements in the Variable. If this is an unlimited Variable, will use the cur
  • getShortName
  • getUnitsString
    Get the Unit String for the Variable. Looks for the CDM.UNITS attribute value
  • getShortName,
  • getUnitsString,
  • getSPobject,
  • <init>,
  • setSPobject,
  • getDimensionsString,
  • getElementSize,
  • getNameAndDimensions,
  • isUnsigned

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collectors (java.util.stream)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now