/** * Factory method for creating a GridTimeCoding-instance from a product. * * @param product the product to create the time coding from. Its start time must not be <code>null</code>. * * @return a TimeCoding instance */ public static TimeCoding create(Product product) { final ProductData.UTC startTime = product.getStartTime(); final ProductData.UTC endTime = product.getEndTime(); if (endTime != null) { return new GridTimeCoding(startTime, endTime); } else { return new GridTimeCoding(startTime); } }
private void fixBandTimeCodings() { for (Band destBand : tsProduct.getBands()) { final String destBandName = destBand.getName(); final Band raster = getSourceBand(destBandName); final TimeCoding timeCoding; if (raster != null) { timeCoding = GridTimeCoding.create(raster.getProduct()); } else { ProductData.UTC time = extractUtcTime(destBandName); timeCoding = new GridTimeCoding(time, time); } rasterTimeMap.put(destBand, timeCoding); } }
@Override protected void onOK() { timeSeries.setAutoAdjustingTimeCoding(autoAdjustBox.isSelected()); final ProductData.UTC startTime = ProductData.UTC.create(startTimeBox.getDate(), 0); final ProductData.UTC endTime = ProductData.UTC.create(endTimeBox.getDate(), 0); timeSeries.setTimeCoding(new GridTimeCoding(startTime, endTime)); super.onOK(); }