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

How to use
TimeOffsetAxis
in
ucar.nc2.ft2.coverage

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

origin: Unidata/thredds

@Override
public int[] getShape() {
 if (runAxis.isScalar())
  return new int[] {timeOffset.getNcoords()};
 else
  return new int[] {runAxis.getNcoords(), timeOffset.getNcoords()};
}
origin: Unidata/thredds

@Override
public CoverageCoordAxis copy() {
 return new TimeOffsetAxis(new CoverageCoordAxisBuilder(this));
}
origin: Unidata/thredds

@Override
public Optional<CoverageCoordAxis> subset(SubsetParams params) {
 Optional<CoverageCoordAxisBuilder> buildero = subsetBuilder(params);
 return !buildero.isPresent() ? Optional.empty(buildero.getErrorMessage()) : Optional.of(new TimeOffsetAxis(buildero.get()));
}
origin: Unidata/thredds

if (rt_val != null)
 Assert.assertEquals(rt_val, runDate);
Assert.assertEquals(1, timeOffsetAxis.getNcoords());
 if (timeOffsetAxis.isInterval()) {
  CalendarDate edge1 = timeOffsetAxis.makeDate(timeOffsetAxis.getCoordEdge1(0));
  CalendarDate edge2 = timeOffsetAxis.makeDate(timeOffsetAxis.getCoordEdge2(0));
  double val2 = timeOffsetAxis.getCoordMidpoint(0);
  CalendarDate forecastDate = timeOffsetAxis.makeDate(runDate, val2);
  Assert.assertEquals(time_val, forecastDate);
 if (timeOffsetAxis.isInterval()) {
  Assert.assertTrue(timeOffsetAxis.getCoordEdge1(0) <= time_offset);
  Assert.assertTrue(timeOffsetAxis.getCoordEdge2(0) >= time_offset);
  double val2 = timeOffsetAxis.getCoordMidpoint(0);
  Assert2.assertNearlyEquals(val2, time_offset);
origin: Unidata/thredds

 axiso = timeOffset.subset(params);
 if (!axiso.isPresent())
  return Optional.empty(axiso.getErrorMessage());
 double val = runAxisSubset.getCoordMidpoint(0);   // not sure runAxis is needed. maybe use runtimeSubset
 CalendarDate runDate = runAxisSubset.makeDate(val);
 Optional<TimeOffsetAxis> too = timeOffset.subsetFromTime(params, runDate);
 if (!too.isPresent())
  return Optional.empty(too.getErrorMessage());
double start = timeOffset.getStartValue();
double end = timeOffset.getEndValue();
CoordAxisHelper helper = new CoordAxisHelper(timeOffset);
CoverageCoordAxis1D timeOffsetSubset = new TimeOffsetAxis(timebuilder);
origin: Unidata/thredds

public Optional<TimeOffsetAxis> subsetFromTime(SubsetParams params, CalendarDate runDate) {
 CoordAxisHelper helper = new CoordAxisHelper(this);
 CoverageCoordAxisBuilder builder = null;
 if (params.isTrue(SubsetParams.timePresent)) {
  double offset = getOffsetInTimeUnits(runDate, CalendarDate.present());
  builder = helper.subsetClosest(offset);
 }
 CalendarDate dateWanted = (CalendarDate) params.get(SubsetParams.time);
 if (dateWanted != null) {                           // convertFrom, convertTo
  double offset = getOffsetInTimeUnits(runDate, dateWanted);
  builder =  helper.subsetClosest(offset);
 }
 Integer stride = (Integer) params.get(SubsetParams.timeStride);
 if (stride == null || stride < 0) stride = 1;
 CalendarDateRange dateRange = (CalendarDateRange) params.get(SubsetParams.timeRange);
 if (dateRange != null) {
  double min = getOffsetInTimeUnits(runDate, dateRange.getStart());
  double max = getOffsetInTimeUnits(runDate, dateRange.getEnd());
  Optional<CoverageCoordAxisBuilder> buildero =  helper.subset(min, max, stride);
  if (buildero.isPresent()) builder = buildero.get();
  else return Optional.empty(buildero.getErrorMessage());
 }
 assert (builder != null);
 // all the offsets are reletive to rundate
 builder.setReferenceDate(runDate);
 return Optional.of(new TimeOffsetAxis(builder));
}
origin: Unidata/thredds

CalendarDate runDate = runAxis.makeDate(val);
Assert.assertEquals(rt_val, runDate);
Assert.assertEquals(1, timeOffsetAxis.getNcoords());
 if (timeOffsetAxis.isInterval()) {
  CalendarDate edge1 = timeOffsetAxis.makeDate(runDate, timeOffsetAxis.getCoordEdge1(0));
  CalendarDate edge2 = timeOffsetAxis.makeDate(runDate, timeOffsetAxis.getCoordEdge2(0));
  double val2 = timeOffsetAxis.getCoordMidpoint(0);
  CalendarDate forecastDate = timeOffsetAxis.makeDate(runDate, val2);
  Assert.assertEquals(time_val, forecastDate);
 if (timeOffsetAxis.isInterval()) {
  Assert.assertTrue(timeOffsetAxis.getCoordEdge1(0) <= time_offset);
  Assert.assertTrue(timeOffsetAxis.getCoordEdge2(0) >= time_offset);
  double val2 = timeOffsetAxis.getCoordMidpoint(0);
  Assert2.assertNearlyEquals(val2, time_offset);
origin: Unidata/thredds

@Override
public Optional<CoverageCoordAxis> subset(double minValue, double maxValue, int stride) {
 CoordAxisHelper helper = new CoordAxisHelper(this);
 Optional<CoverageCoordAxisBuilder> buildero = helper.subset(minValue, maxValue, stride);
 return !buildero.isPresent() ? Optional.empty(buildero.getErrorMessage()) : Optional.of(new TimeOffsetAxis(buildero.get()));
}
origin: Unidata/thredds

 return new LatLonAxis2D(builder);
} else if (axisType == AxisType.TimeOffset) {
 return new TimeOffsetAxis(builder);
} else {
 return new CoverageCoordAxis1D(builder);
origin: Unidata/thredds

 return ucar.nc2.util.Optional.of(new TimeOffsetAxis(builder));
else
 return ucar.nc2.util.Optional.of(new CoverageCoordAxis1D(builder));
origin: Unidata/thredds

builder.setSpacingFromValues(time2D.isTimeInterval());
return new TimeOffsetAxis(builder);
ucar.nc2.ft2.coverageTimeOffsetAxis

Javadoc

A new way to handle 2D time, a runtime axis with orthogonal offset values, so time = (runtime x offset). This class represents the offset values, which must be the same for each runtime. A Time2DCoordSys has a runtime and a TimeOffsetAxis, and manages the 2D time.

Most used methods

  • getNcoords
  • <init>
  • getCoordEdge1
  • getCoordEdge2
  • getCoordMidpoint
  • isInterval
  • makeDate
  • getEndValue
  • getOffsetInTimeUnits
  • getStartValue
  • subset
  • subsetBuilder
  • subset,
  • subsetBuilder,
  • subsetFromTime

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Option (scala)
  • CodeWhisperer alternatives
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