congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CoverageCoordAxis1D.getStartValue
Code IndexAdd Tabnine to your IDE (free)

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

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

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 Optional<CoverageCoordAxis> subsetLon(LatLonRect llbb, int stride) throws InvalidRangeException {
 double wantMin = LatLonPointImpl.lonNormalFrom(llbb.getLonMin(), lonAxis.getStartValue());
 double wantMax = LatLonPointImpl.lonNormalFrom(llbb.getLonMax(), lonAxis.getStartValue());
 double start = lonAxis.getStartValue();
 double end  = lonAxis.getEndValue();
 // use MAMath.MinMax as a container for two values, min and max
 List<MAMath.MinMax> lonIntvs = subsetLonIntervals(wantMin, wantMax, start, end);
 if (lonIntvs.size() == 0)
  return Optional.empty(String.format(
      "longitude want [%f,%f] does not intersect lon axis [%f,%f]", wantMin, wantMax, start, end));
 if (lonIntvs.size() == 1) {
  MAMath.MinMax lonIntv = lonIntvs.get(0);
  return lonAxis.subset(lonIntv.min, lonIntv.max, stride);
 }
 // this is the seam crossing case
 return lonAxis.subsetByIntervals(lonIntvs, stride);
}
origin: Unidata/thredds

@Override
public String getSummary() {
 if (axisType != AxisType.RunTime)
  return super.getSummary();
 if (ncoords < 7) {
  Formatter f = new Formatter();
  for (int i = 0; i < ncoords; i++) {
   CalendarDate cd = makeDate(getCoordMidpoint(i));
   if (i > 0) f.format(", ");
   f.format("%s", cd);
  }
  return f.toString();
 }
 Formatter f = new Formatter();
 CalendarDate start = makeDate(getStartValue());
 f.format("start=%s", start);
 CalendarDate end = makeDate(getEndValue());
 f.format(", end=%s", end);
 f.format(" (npts=%d spacing=%s)", getNcoords(), getSpacing());
 return f.toString();
}
origin: Unidata/thredds

private Optional<CoverageCoordAxisBuilder> subsetValues(double minValue, double maxValue, int stride) {
 if (axis.getSpacing() == CoverageCoordAxis.Spacing.discontiguousInterval)
  return subsetValuesDiscontinuous(minValue, maxValue, stride);
 double lower = axis.isAscending() ? Math.min(minValue, maxValue) : Math.max(minValue, maxValue);
 double upper = axis.isAscending() ? Math.max(minValue, maxValue) : Math.min(minValue, maxValue);
 int minIndex = findCoordElement(lower, false);
 int maxIndex = findCoordElement(upper, false);
 if (minIndex >= axis.getNcoords())
  return Optional.empty(String.format("no points in subset: lower %f > end %f", lower, axis.getEndValue()));
 if (maxIndex < 0)
  return Optional.empty(String.format("no points in subset: upper %f < start %f", upper, axis.getStartValue()));
 if (minIndex < 0)
  minIndex = 0;
 if (maxIndex >= axis.getNcoords())
  maxIndex = axis.getNcoords() - 1;
 int count = maxIndex - minIndex + 1;
 if (count <= 0)
  throw new IllegalArgumentException("no points in subset");
 try {
  return Optional.of(subsetByIndex(new Range(minIndex, maxIndex, stride)));
 } catch (InvalidRangeException e) {
  return Optional.empty(e.getMessage());
 }
}
origin: Unidata/thredds

public Optional<RangeIterator> makeRange(double minValue, double maxValue, int stride) {
 //if (axis.getSpacing() == CoverageCoordAxis.Spacing.discontiguousInterval)
 //  return subsetValuesDiscontinuous(minValue, maxValue, stride);
 double lower = axis.isAscending() ? Math.min(minValue, maxValue) : Math.max(minValue, maxValue);
 double upper = axis.isAscending() ? Math.max(minValue, maxValue) : Math.min(minValue, maxValue);
 int minIndex = findCoordElement(lower, false);
 int maxIndex = findCoordElement(upper, false);
 if (minIndex >= axis.getNcoords())
  return Optional.empty(String.format("no points in subset: lower %f > end %f", lower, axis.getEndValue()));
 if (maxIndex < 0)
  return Optional.empty(String.format("no points in subset: upper %f < start %f", upper, axis.getStartValue()));
 if (minIndex < 0)
  minIndex = 0;
 if (maxIndex >= axis.getNcoords())
  maxIndex = axis.getNcoords() - 1;
 int count = maxIndex - minIndex + 1;
 if (count <= 0)
  return Optional.empty("no points in subset");
 try {
  return Optional.of(new Range(minIndex, maxIndex, stride));
 } catch (InvalidRangeException e) {
  return Optional.empty(e.getMessage());
 }
}
origin: Unidata/thredds

CoordAxisHelper yhelper = new CoordAxisHelper(latAxis);
double lonNormal = LatLonPointImpl.lonNormalFrom(latlon.getLongitude(), lonAxis.getStartValue());
optb = xhelper.subsetContaining(lonNormal);
if (optb.isPresent()) lonaxisSubset = new CoverageCoordAxis1D(optb.get());
origin: Unidata/thredds

public Optional<CoordReturn> findXYindexFromCoord(double x, double y) {
 CoordReturn result = new CoordReturn();
 if (isProjection) {
  CoordAxisHelper xhelper = new CoordAxisHelper(xAxis);
  CoordAxisHelper yhelper = new CoordAxisHelper(yAxis);
  result.x = xhelper.findCoordElement(x, false);
  result.y = yhelper.findCoordElement(y, false);
  if (result.x >= 0 && result.x < xAxis.getNcoords() && result.y >= 0 && result.y < yAxis.getNcoords()) {
   result.xcoord = xAxis.getCoordMidpoint(result.x);
   result.ycoord = yAxis.getCoordMidpoint(result.y);
   return Optional.of(result);
  } else {
   return Optional.empty("not in grid");
  }
 } else { // 1D lat lon case
  CoordAxisHelper xhelper = new CoordAxisHelper(lonAxis);
  CoordAxisHelper yhelper = new CoordAxisHelper(latAxis);
  double lon = LatLonPointImpl.lonNormalFrom(x, lonAxis.getStartValue());
  result.x = xhelper.findCoordElement(lon, false);
  result.y = yhelper.findCoordElement(y, false);
  if (result.x >= 0 && result.x < lonAxis.getNcoords() && result.y >= 0 && result.y < latAxis.getNcoords()) {
   result.xcoord = lonAxis.getCoordMidpoint(result.x);
   result.ycoord = latAxis.getCoordMidpoint(result.y);
   return Optional.of(result);
  } else {
   return Optional.empty("not in grid");
  }
 }
}
origin: Unidata/thredds

case regularInterval:
case regularPoint:
 builder.startValue = timeAxisSubset.getStartValue() + offset;
 builder.endValue = timeAxisSubset.getEndValue() + offset;
 break;
origin: Unidata/thredds

case regularInterval:
case regularPoint:
 builder.startValue = timeAxisSubset.getStartValue() + offset;
 builder.endValue = timeAxisSubset.getEndValue() + offset;
 break;
origin: Unidata/thredds

Assert.assertEquals(92, timeAxis.getNcoords());
Assert.assertEquals(CoverageCoordAxis.Spacing.discontiguousInterval, timeAxis.getSpacing());
Assert2.assertNearlyEquals(0.0, timeAxis.getStartValue());
Assert2.assertNearlyEquals(384.0, timeAxis.getEndValue());
ucar.nc2.ft2.coverageCoverageCoordAxis1DgetStartValue

Popular methods of CoverageCoordAxis1D

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

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JTable (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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