Codota Logo
NetcdfDataset.getVariables
Code IndexAdd Codota to your IDE (free)

How to use
getVariables
method
in
ucar.nc2.dataset.NetcdfDataset

Best Java code snippets using ucar.nc2.dataset.NetcdfDataset.getVariables (Showing top 20 results out of 315)

  • Common ways to obtain NetcdfDataset
private void myMethod () {
NetcdfDataset n =
  • Codota IconString location;NetcdfDataset.openDataset(location)
  • Codota IconNetcdfFile ncfile;new NetcdfDataset(ncfile)
  • Codota Iconnew NetcdfDataset()
  • Smart code suggestions by Codota
}
origin: geotools/geotools

/**
 * Get a {@link Variable} by name.
 *
 * @param varName the name of the {@link Variable} to pick.
 * @return the variable or <code>null</code>.
 */
public Variable getVariableByName(final String varName) {
  final List<Variable> varList = dataset.getVariables();
  for (Variable var : varList) {
    if (var.getFullName().equals(varName)) return var;
  }
  return null;
}
origin: geotools/geotools

/**
 * Look for a CoordinateReferenceSystem defined into a variable
 *
 * @param dataset
 * @param defaultCrs
 * @return
 * @throws FactoryException
 */
public static CoordinateReferenceSystem lookForVariableCRS(
    NetcdfDataset dataset, CoordinateReferenceSystem defaultCrs) throws FactoryException {
  List<Variable> variables = dataset.getVariables();
  CoordinateReferenceSystem crs = defaultCrs;
  for (Variable variable : variables) {
    CRSParser attrib = CRSParser.getCRSParser(variable);
    if (attrib != null) {
      // Referencing info found
      crs = NetCDFProjection.parseProjection(variable, attrib);
      if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine(
            "Detected NetCDFProjection through gridMapping variable: "
                + (crs != null ? crs.toWKT() : "null"));
      }
      break;
    }
  }
  return crs;
}
origin: geotools/geotools

List<Variable> variables = dataset.getVariables();
for (Variable var : variables) {
  Attribute gridMappingAttribute = var.findAttribute(NetCDFUtilities.GRID_MAPPING);
origin: geotools/geotools

boolean isShared = datastoreConfig.isShared();
initCatalog(datastoreConfig);
final List<Variable> variables = dataset.getVariables();
if (variables != null) {
origin: edu.ucar/cdm

public RadialDatasetSweepAdapter( NetcdfDataset ds) {
 super(ds);
 // look for radial data variables
 parseInfo.append("RadialDatasetAdapter look for RadialVariables\n");
 List vars  = ds.getVariables();
 for (int i=0; i< vars.size(); i++) {
  // VariableEnhanced varDS = (VariableEnhanced) vars.get(i);
  addRadialVariable( ds, (Variable) vars.get(i));
 }
}
origin: edu.ucar/netcdf

public RadialDatasetSweepAdapter( NetcdfDataset ds) {
 super(ds);
 // look for radial data variables
 parseInfo.append("RadialDatasetAdapter look for RadialVariables\n");
 List vars  = ds.getVariables();
 for (int i=0; i< vars.size(); i++) {
  // VariableEnhanced varDS = (VariableEnhanced) vars.get(i);
  addRadialVariable( ds, (Variable) vars.get(i));
 }
}
origin: org.geotools/gt-netcdf

/**
 * Get a {@link Variable} by name.
 *
 * @param varName the name of the {@link Variable} to pick.
 * @return the variable or <code>null</code>.
 */
public Variable getVariableByName(final String varName) {
  final List<Variable> varList = dataset.getVariables();
  for (Variable var : varList) {
    if (var.getFullName().equals(varName)) return var;
  }
  return null;
}
origin: edu.ucar/netcdf

/**
 * Clear Coordinate System metadata, to allow them to be redone
 */
public void clearCoordinateSystems() {
 coordSys = new ArrayList<CoordinateSystem>();
 coordAxes = new ArrayList<CoordinateAxis>();
 coordTransforms = new ArrayList<CoordinateTransform>();
 for (Variable v : getVariables()) {
  VariableEnhanced ve = (VariableEnhanced) v;
  ve.clearCoordinateSystems(); // ??
 }
 enhanceMode.remove(Enhance.CoordSystems);
}
origin: edu.ucar/cdm

/**
 * Clear Coordinate System metadata, to allow them to be redone
 */
public void clearCoordinateSystems() {
 coordSys = new ArrayList<>();
 coordAxes = new ArrayList<>();
 coordTransforms = new ArrayList<>();
 for (Variable v : getVariables()) {
  VariableEnhanced ve = (VariableEnhanced) v;
  ve.clearCoordinateSystems(); // ??
 }
 enhanceMode.remove(Enhance.CoordSystems);
}
origin: edu.ucar/cdm

private boolean hasAxisType(NetcdfDataset ds, AxisType a) {
 List<Variable> varList = ds.getVariables();
 for (Variable v : varList) {
  String axisType = ds.findAttValueIgnoreCase(v, "CoordinateAxisType", null);
  if ((axisType != null) && axisType.equals(a.toString()))
   return true;
 }
 return false;
}
origin: Unidata/thredds

private boolean hasAxisType(NetcdfDataset ds, AxisType a) {
 List<Variable> varList = ds.getVariables();
 for (Variable v : varList) {
  String axisType = ds.findAttValueIgnoreCase(v, "CoordinateAxisType", null);
  if ((axisType != null) && axisType.equals(a.toString()))
   return true;
 }
 return false;
}
origin: edu.ucar/netcdf

private boolean hasAxisType(NetcdfDataset ds, AxisType a) {
 List<Variable> varList = ds.getVariables();
 for (Variable v : varList) {
  String axisType = ds.findAttValueIgnoreCase(v, "CoordinateAxisType", null);
  if ((axisType != null) && axisType.equals(a.toString()))
   return true;
 }
 return false;
}
origin: edu.ucar/cdm

public void augmentDataset( NetcdfDataset ds, CancelTask cancelTask) throws IOException {
 List<Variable> vars = ds.getVariables();
 findAxes(vars);
 ds.finish();
}
origin: Unidata/thredds

public void augmentDataset( NetcdfDataset ds, CancelTask cancelTask) throws IOException {
 List<Variable> vars = ds.getVariables();
 findAxes(vars);
 ds.finish();
}
origin: edu.ucar/netcdf

public void augmentDataset( NetcdfDataset ds, CancelTask cancelTask) throws IOException {
 List<Variable> vars = ds.getVariables();
 findAxes(vars);
 ds.finish();
}
origin: Unidata/thredds

/**
 * Constructor.
 *
 * @param ds Source NetCDF dataset
 */
public CFRadialAdapter(NetcdfDataset ds) {
 this.ds = ds;
 desc = "CF/Radial radar dataset";
 init();
 for (Variable var : ds.getVariables()) {
  addRadialVariable(ds, var);
 }
}
origin: edu.ucar/netcdf

protected Variable findVariableWithStandardNameAndNotDimension(NetcdfDataset ds, String standard_name, Dimension outer, Formatter errlog) {
 for (Variable v : ds.getVariables()) {
  String stdName = ds.findAttValueIgnoreCase(v, CF.STANDARD_NAME, null);
  if ((stdName != null) && stdName.equals(standard_name) && v.getRank() > 0 && !v.getDimension(0).equals(outer))
   return v;
 }
 return null;
}
origin: edu.ucar/netcdf

protected Variable findVariableWithAttributeAndDimension(NetcdfDataset ds, String att_name, String att_value, Dimension outer, Formatter errlog) {
 for (Variable v : ds.getVariables()) {
  String stdName = ds.findAttValueIgnoreCase(v, att_name, null);
  if ((stdName != null) && stdName.equalsIgnoreCase(att_value)) {
   if (v.getRank() > 0 && v.getDimension(0).equals(outer))
    return v;
   if (isEffectivelyScaler(v) && (outer == null))
    return v;
  }
 }
 return null;
}
origin: edu.ucar/netcdf

public void check(Formatter f) {
 for (Variable v : getVariables()) {
  VariableDS vds = (VariableDS) v;
  if (vds.getOriginalDataType() != vds.getDataType()) {
   f.format("Variable %s has type %s, org = %s%n", vds.getFullName(), vds.getOriginalDataType(), vds.getDataType());
  }
  if (vds.getOriginalVariable() != null) {
   Variable orgVar = vds.getOriginalVariable();
   if (orgVar.getRank() != vds.getRank())
    f.format("Variable %s has rank %d, org = %d%n", vds.getFullName(), vds.getRank(), orgVar.getRank());
  }
 }
}
origin: edu.ucar/cdm

public void check(Formatter f) {
 for (Variable v : getVariables()) {
  VariableDS vds = (VariableDS) v;
  if (vds.getOriginalDataType() != vds.getDataType()) {
   f.format("Variable %s has type %s, org = %s%n", vds.getFullName(), vds.getOriginalDataType(), vds.getDataType());
  }
  if (vds.getOriginalVariable() != null) {
   Variable orgVar = vds.getOriginalVariable();
   if (orgVar.getRank() != vds.getRank())
    f.format("Variable %s has rank %d, org = %d%n", vds.getFullName(), vds.getRank(), orgVar.getRank());
  }
 }
}
ucar.nc2.datasetNetcdfDatasetgetVariables

Popular methods of NetcdfDataset

  • findVariable
  • openDataset
    Factory method for opening a dataset through the netCDF API, and identifying its coordinate variable
  • <init>
    Transform a NetcdfFile into a NetcdfDataset, optionally enhance it. You must not use the original Ne
  • getLocation
  • openFile
    Factory method for opening a NetcdfFile through the netCDF API.
  • close
    Close all resources (files, sockets, etc) associated with this dataset. If the underlying file was a
  • acquireDataset
    Same as openDataset, but file is acquired through the File Cache. You must first call initNetcdfFile
  • findGlobalAttribute
  • findAttValueIgnoreCase
  • findCoordinateAxis
    Retrieve the CoordinateAxis with the specified Axis Type.
  • findDimension
  • getCoordinateAxes
    Get the list of all CoordinateAxis objects used by this dataset.
  • findDimension,
  • getCoordinateAxes,
  • getGlobalAttributes,
  • getCoordinateSystems,
  • finish,
  • getDefaultEnhanceMode,
  • getEnhanceAll,
  • getEnhanceMode,
  • getRootGroup

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Path (java.nio.file)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JList (javax.swing)
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