/** * get time coverage as CalendarDateRange * * @return time coverage, or null if none */ public CalendarDateRange getCalendarDateCoverage() { return CalendarDateRange.of(tc); }
/** * @return TimeCoverage element as CalendarDateRange */ public CalendarDateRange getCalendarDateCoverage() { return timeCoverage == null ? null : CalendarDateRange.of(timeCoverage); }
/** * @return TimeCoverage element as CalendarDateRange */ public CalendarDateRange getCalendarDateCoverage() { return timeCoverage == null ? null : CalendarDateRange.of(timeCoverage); }
/** * Get calendar date range * @return calendar date range */ public CalendarDateRange getCalendarDateRange() { List<CalendarDate> cd = getCalendarDates(); int last = cd.size(); return (last > 0) ? CalendarDateRange.of(cd.get(0), cd.get(last-1)) : null; }
@Override public StationTimeSeriesFeature subset(DateRange dateRange) throws IOException { if (dateRange == null) return this; return new StationFeatureSubset(this, CalendarDateRange.of(dateRange)); }
public CalendarDateRange getDateRangeForOffset(double offset) { State localState; synchronized (lock) { localState = state; } List<CalendarDate> runs = localState.lite.getRunDates(); int n = runs.size(); return CalendarDateRange.of(FmrcInv.makeOffsetDate(runs.get(0), offset), FmrcInv.makeOffsetDate(runs.get(n-1), offset)); }
@Override public CalendarDateRange getCalendarDateRange() { if (timeTaxis != null) return timeTaxis.getCalendarDateRange(); else if (getRunTimeAxis() != null) { List<CalendarDate> cd = makeCalendarDates2D(); int last = cd.size(); return (last > 0) ? CalendarDateRange.of(cd.get(0), cd.get(last-1)) : null; } else return null; }
public CalendarDateRange getDateRangeForOffset(double offset) { State localState; synchronized (lock) { localState = state; } List<CalendarDate> runs = localState.lite.getRunDates(); int n = runs.size(); return CalendarDateRange.of(FmrcInv.makeOffsetDate(runs.get(0), offset), FmrcInv.makeOffsetDate(runs.get(n-1), offset)); }
public CalendarDateRange getDateRangeForOffset(double offset) { State localState; synchronized (lock) { localState = state; } List<CalendarDate> runs = localState.lite.getRunDates(); int n = runs.size(); return CalendarDateRange.of(FmrcInv.makeOffsetDate(runs.get(0), offset), FmrcInv.makeOffsetDate(runs.get(n-1), offset)); }
public CalendarDateRange getCalendarDateRange(CalendarDateUnit timeUnit) { if (nobs == 0) return null; if (dateRange != null) return dateRange; if (timeUnit != null && minTime <= maxTime) { dateRange = CalendarDateRange.of(timeUnit.makeCalendarDate(minTime), timeUnit.makeCalendarDate(maxTime)); } return dateRange; }
public CalendarDateRange getCalendarDateRange() { if (!calcBounds) return null; if (timeUnit == null) return null; return CalendarDateRange.of(timeUnit.makeCalendarDate(minTime), timeUnit.makeCalendarDate(maxTime)); }
public CalendarDateRange intersect(CalendarDateRange clip) { DateTime cs = clip.getStart().getDateTime(); DateTime s = startDt.isBefore(cs) ? cs : startDt; // later one DateTime ce = clip.getEnd().getDateTime(); DateTime e = endDt.isBefore(ce) ? endDt : ce; // earlier one return CalendarDateRange.of(CalendarDate.of(cal, s), CalendarDate.of(cal, e)); }
public CalendarDateRange extend(CalendarDateRange other) { DateTime cs = other.getStart().getDateTime(); DateTime s = startDt.isBefore(cs) ? startDt : cs; // earlier one DateTime ce = other.getEnd().getDateTime(); DateTime e = endDt.isBefore(ce) ? ce : endDt; // later one return CalendarDateRange.of(CalendarDate.of(cal, s), CalendarDate.of(cal, e)); }
public CalendarDateRange intersect(CalendarDateRange clip) { DateTime cs = clip.getStart().getDateTime(); DateTime s = startDt.isBefore(cs) ? cs : startDt; // later one DateTime ce = clip.getEnd().getDateTime(); DateTime e = endDt.isBefore(ce) ? endDt : ce; // earlier one return CalendarDateRange.of(CalendarDate.of(cal, s), CalendarDate.of(cal, e)); }
public CalendarDateRange extend(CalendarDateRange other) { DateTime cs = other.getStart().getDateTime(); DateTime s = startDt.isBefore(cs) ? startDt : cs; // earlier one DateTime ce = other.getEnd().getDateTime(); DateTime e = endDt.isBefore(ce) ? ce : endDt; // later one return CalendarDateRange.of(CalendarDate.of(cal, s), CalendarDate.of(cal, e)); }
@Override public CalendarDateRange makeCalendarDateRange(ucar.nc2.time.Calendar cal) { CalendarDateUnit cdu = CalendarDateUnit.withCalendar(cal, periodName + " since " + refDate.toString()); CalendarDate start = cdu.makeCalendarDate(timeUnit.getValue() * offsetSorted.get(0)); CalendarDate end = cdu.makeCalendarDate(timeUnit.getValue() * offsetSorted.get(getSize() - 1)); return CalendarDateRange.of(start, end); }
/** * Does not handle non-standard calendars * @deprecated */ static public CalendarDateRange of(DateRange dr) { if (dr == null) return null; return CalendarDateRange.of( dr.getStart().getDate(), dr.getEnd().getDate()); }
/** * Make calendar date range, using the first and last ending bounds * @param cal optional calendar, may be null * @return calendar date range */ @Override public CalendarDateRange makeCalendarDateRange(ucar.nc2.time.Calendar cal) { CalendarDateUnit cdu = CalendarDateUnit.of(cal, timeUnit.getField(), refDate); CalendarDate start = cdu.makeCalendarDate( timeUnit.getValue() * timeIntervals.get(0).getBounds2()); CalendarDate end = cdu.makeCalendarDate(timeUnit.getValue() * timeIntervals.get(getSize()-1).getBounds2()); return CalendarDateRange.of(start, end); }
CalendarDateRange decodeDateRange(CdmrFeatureProto.CalendarDateRange proto) { ucar.nc2.time.Calendar cal = convertCalendar(proto.getCalendar()); CalendarDate start = CalendarDate.of(cal, proto.getStart()); CalendarDate end = CalendarDate.of(cal, proto.getEnd()); return CalendarDateRange.of(start, end); }
private BufrStationDataset(NetcdfDataset ncfile, BufrCdmIndex index) { super(ncfile, FeatureType.STATION); this.index = index; // create the list of data variables munger = new Munge(); obs = (SequenceDS) ncfile.findVariable(BufrIosp2.obsRecord); this.dataVariables = munger.makeDataVariables(index, obs); BufrStationCollection bufrCollection = new BufrStationCollection(ncfile.getLocation()); setPointFeatureCollection(bufrCollection); CalendarDateRange dateRange = CalendarDateRange.of(CalendarDate.of(index.start), CalendarDate.of(index.end)); setDateRange(dateRange); }