Codota Logo
CoverageCoordAxis1D.getResolution
Code IndexAdd Codota to your IDE (free)

How to use
getResolution
method
in
ucar.nc2.ft2.coverage.CoverageCoordAxis1D

Best Java code snippets using ucar.nc2.ft2.coverage.CoverageCoordAxis1D.getResolution (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: Unidata/thredds

public boolean isAscending() {
 loadValuesIfNeeded();
 switch (spacing) {
  case regularInterval:
  case regularPoint:
   return getResolution() > 0;
  case irregularPoint:
   return values[0] <= values[ncoords - 1];
  case contiguousInterval:
   return values[0] <= values[ncoords];
  case discontiguousInterval:
   return values[0] <= values[2 * ncoords - 1];
 }
 throw new IllegalStateException("unknown spacing" + spacing);
}
origin: Unidata/thredds

public double getCoordEdge1(int index) {
 if (index < 0 || index >= getNcoords())
  throw new IllegalArgumentException("Index out of range=" + index);
 loadValuesIfNeeded();
 switch (spacing) {
  case regularPoint:
   return startValue + (index - .5) * getResolution();
  case regularInterval:
   return startValue + index * getResolution();
  case irregularPoint:
   if (index > 0)
    return (values[index - 1] + values[index]) / 2;
   else
    return values[0] - (values[1] - values[0]) / 2;
  case contiguousInterval:
   return values[index];
  case discontiguousInterval:
   return values[2 * index];
 }
 throw new IllegalStateException("Unknown spacing=" + spacing);
}
origin: Unidata/thredds

public double getCoordEdge2(int index) {
 if (index < 0 || index >= getNcoords())
  throw new IllegalArgumentException("Index out of range=" + index);
 loadValuesIfNeeded();
 switch (spacing) {
  case regularPoint:
   if (index < 0 || index >= ncoords) throw new IllegalArgumentException("Index out of range " + index);
   return startValue + (index + .5) * getResolution();
  case regularInterval:
   return startValue + (index+1) * getResolution();
  case irregularPoint:
   if (index < ncoords - 1)
    return (values[index] + values[index + 1]) / 2;
   else
    return values[index] + (values[index] - values[index - 1]) / 2;
  case contiguousInterval:
   return values[index + 1];
  case discontiguousInterval:
   return values[2 * index + 1];
 }
 throw new IllegalStateException("Unknown spacing=" + spacing);
}
origin: Unidata/thredds

public double getCoordMidpoint(int index) {
 if (index < 0 || index >= getNcoords())
  throw new IllegalArgumentException("Index out of range=" + index);
 loadValuesIfNeeded();
 switch (spacing) {
  case regularPoint:
   return startValue + index * getResolution();
  case irregularPoint:
   return values[index];
  case regularInterval:
   return startValue + (index + .5) * getResolution();
  case contiguousInterval:
  case discontiguousInterval:
   return (getCoordEdge1(index) + getCoordEdge2(index)) / 2;
 }
 throw new IllegalStateException("Unknown spacing=" + spacing);
}
origin: Unidata/thredds

 int search(double want) {
  if (axis.getNcoords() == 1) {
   return Misc.nearlyEquals(want, axis.getStartValue()) ? 0 : -1;
  }
  if (axis.isRegular()) {
   double fval = (want - axis.getStartValue()) / axis.getResolution();
   double ival = Math.rint(fval);
   return Misc.nearlyEquals(fval, ival) ? (int) ival : (int) -ival - 1; // LOOK
  }

  // otherwise do a binary search
  return Arrays.binarySearch(axis.getValues(), want);
 }
}
origin: Unidata/thredds

private int findCoordElementRegular(double coordValue, boolean bounded) {
 int n = axis.getNcoords();
 if (n == 1 && bounded) return 0;
 double distance = coordValue - axis.getCoordEdge1(0);
 double exactNumSteps = distance / axis.getResolution();
 //int index = (int) Math.round(exactNumSteps); // ties round to +Inf
 int index = (int) exactNumSteps; // truncate down
 if (bounded && index < 0) return 0;
 if (bounded && index >= n) return n - 1;
 // check that found point is within interval
 if (index >= 0 && index < n) {
  double lower = axis.getCoordEdge1(index);
  double upper = axis.getCoordEdge2(index);
  if (axis.isAscending()) {
   assert lower <= coordValue : lower + " should be le " + coordValue;
   assert upper >= coordValue : upper + " should be ge " + coordValue;
  } else {
   assert lower >= coordValue : lower + " should be ge " + coordValue;
   assert upper <= coordValue : upper + " should be le " + coordValue;
  }
 }
 return index;
}
origin: Unidata/thredds

double xInc = xaxis.getResolution() * scaler;
double yInc = Math.abs(yaxis.getResolution()) * scaler;
origin: Unidata/thredds

case regularInterval:
case regularPoint:
 resolution = range.stride() * axis.getResolution();
 break;
origin: Unidata/thredds

Assert2.assertNearlyEquals(10.5, xaxis.getCoordMidpoint(0));
Assert2.assertNearlyEquals(300.5, xaxis.getEndValue()); // LOOK is that ok? BB = 10-300: its just catching the edge
Assert2.assertNearlyEquals(1.0, xaxis.getResolution());
Assert2.assertNearlyEquals(79.5, yaxis.getCoordMidpoint(0));
Assert2.assertNearlyEquals(-.5, yaxis.getEndValue()); // LOOK is that ok? BB = 0-80: its just catching the edge
Assert2.assertNearlyEquals(-1.0, yaxis.getResolution());
origin: Unidata/thredds

Assert.assertEquals(CoverageCoordAxis.Spacing.regularPoint, runtimeAxis.getSpacing());
Assert2.assertNearlyEquals(0.0, runtimeAxis.getCoordMidpoint(0));
Assert2.assertNearlyEquals(6.0, runtimeAxis.getResolution());
origin: Unidata/thredds

Assert.assertEquals(CoverageCoordAxis.Spacing.irregularPoint, runtimeAxis.getSpacing());
Assert2.assertNearlyEquals(0.0, runtimeAxis.getCoordMidpoint(0));
Assert2.assertNearlyEquals(6.0, runtimeAxis.getResolution());
ucar.nc2.ft2.coverageCoverageCoordAxis1DgetResolution

Popular methods of CoverageCoordAxis1D

  • getCoordMidpoint
  • getEndValue
  • getNcoords
  • makeDate
  • <init>
  • getCoordEdge1
  • getCoordEdge2
  • getDependenceType
  • getSpacing
  • getStartValue
  • convert
  • copy
  • convert,
  • copy,
  • getAxisType,
  • getCalendar,
  • getCalendarDateUnit,
  • getCoordEdgeFirst,
  • getCoordEdgeLast,
  • getCoordObject,
  • getCoordsAsArray

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • notifyDataSetChanged (ArrayAdapter)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • JCheckBox (javax.swing)
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
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