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

How to use
DateHelper
in
org.esa.snap.utils

Best Java code snippets using org.esa.snap.utils.DateHelper (Showing top 20 results out of 315)

origin: senbox-org/s2tbx

@Override
public ProductData.UTC getCenterTime() {
  //computed the acquisition date
  String dateString = getAttributeValue(MuscateConstants.PATH_ACQUISITION_DATE, MuscateConstants.VALUE_NOT_DATE);
  return parseDate(dateString, MuscateConstants.DATE_FORMAT);
}
origin: senbox-org/s2tbx

public ProductData.UTC getCenterTime() {
  ProductData.UTC centerTime = null;
  ProductData.UTC startTime = getProductStartTime();
  if (startTime != null) {
    ProductData.UTC endTime = getProductEndTime();
    if (endTime != null) {
      centerTime = DateHelper.average(startTime, endTime);
    }
  }
  return centerTime;
}
origin: senbox-org/s2tbx

public ProductData.UTC getProductionDate() {
  ProductData.UTC prodDate = null;
  String stringData = getAttributeValue(Spot6Constants.PATH_VOL_PRODUCTION_DATE, null);
  if (stringData != null && !stringData.isEmpty()) {
    prodDate = DateHelper.parseDate(stringData, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return prodDate;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Constants.PATH_IMG_LOCATION_TYPE, "TopCenter", Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Constants.UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

public ProductData.UTC getProductionDate() {
  ProductData.UTC prodDate = null;
  String stringData = getAttributeValue(Constants.PATH_VOL_PRODUCTION_DATE, null);
  if (stringData != null && !stringData.isEmpty()) {
    prodDate = DateHelper.parseDate(stringData, Constants.UTC_DATE_FORMAT);
  }
  return prodDate;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Spot6Constants.PATH_IMG_LOCATION_TYPE, "BottomCenter", Spot6Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Spot6Constants.PATH_IMG_LOCATION_TYPE, "TopCenter", Spot6Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getCenterTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Spot6Constants.PATH_IMG_LOCATION_TYPE, "Center", Spot6Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Constants.PATH_IMG_LOCATION_TYPE, "BottomCenter", Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Constants.UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getCenterTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Constants.PATH_IMG_LOCATION_TYPE, "Center", Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Constants.UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

public ProductData.UTC getFileDate() {
  ProductData.UTC fileDate = null;
  MetadataElement currentElement = root.getElement(NITFFields.TAG_FILE_HEADER);
  if (currentElement != null) {
    try {
      fileDate = DateHelper.parseDate(currentElement.getAttributeString(NITFFields.FDT, ""), "ddHHmmss'Z'MMMyy");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  return fileDate;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = null;
  try {
    value = getAttributeValue(WorldView2Constants.PATH_END_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, WorldView2Constants.PATH_END_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, WorldView2Constants.WORLDVIEW2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = null;
  try{
    value = getAttributeValue(WorldView2Constants.PATH_START_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, WorldView2Constants.PATH_START_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, WorldView2Constants.WORLDVIEW2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = null;
  try{
    value = getAttributeValue(Kompsat2Constants.PATH_START_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, Kompsat2Constants.PATH_START_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Kompsat2Constants.KOMPSAT2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = null;
  try {
    value = getAttributeValue(Kompsat2Constants.PATH_END_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, Kompsat2Constants.PATH_END_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Kompsat2Constants.KOMPSAT2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

public ProductData.UTC getCenterTime() {
  ProductData.UTC centerTime = null;
  MetadataElement currentElement;
  if (((currentElement = rootElement.getElement(SpotConstants.TAG_DATA_STRIP)) != null) &&
      ((currentElement = currentElement.getElement(SpotConstants.TAG_SENSOR_CONFIGURATION)) != null) &&
      ((currentElement = currentElement.getElement(SpotConstants.TAG_TIME_STAMP)) != null)) {
    String stringData = currentElement.getAttributeString(SpotConstants.TAG_SCENE_CENTER_TIME);
    centerTime = DateHelper.parseDate(stringData, SpotConstants.UTC_DATE_FORMAT);
  } else {
    logger.warning(String.format(MISSING_ELEMENT_WARNING, SpotConstants.TAG_SCENE_CENTER_TIME));
  }
  return centerTime;
}
origin: senbox-org/s2tbx

/**
 * Reads the date of the acquisition of the image, as it appears in the metadata file, under the tag METADATA/HEADER/DATE_PDV
 *
 * @return the UTC date representing the date of the acquisition of the image, as it appears in the metadata file
 */
public ProductData.UTC getDatePdv() {
  String dateStr = null;
  ProductData.UTC dateValue = null;
  MetadataElement currentElement;
  if (((currentElement = rootElement.getElement(SpotConstants.SPOT4_TAKE5_TAG_HEADER)) != null)) {
    dateStr = currentElement.getAttributeString(SpotConstants.SPOT4_TAKE5_TAG_DATE_PDV);
  }
  if (dateStr != null) {
    dateValue = DateHelper.parseDate(dateStr, SpotConstants.SPOT4_TAKE5_UTC_DATE_FORMAT);
  }
  return dateValue;
}
origin: senbox-org/s2tbx

public ProductData.UTC getCenterTime() {
  ProductData.UTC centerTime = null;
  String stringDate = getAttributeValue(DeimosConstants.PATH_SCENE_CENTER_DATE, null);
  if (stringDate != null) {
    String stringTime = getAttributeValue(DeimosConstants.PATH_SCENE_CENTER_TIME, null);
    if (stringTime == null) {
      warn(MISSING_ELEMENT_WARNING, DeimosConstants.PATH_SCENE_CENTER_TIME);
      stringTime = "00:00:00";
    }
    centerTime = parseDate(stringDate + " " + stringTime, DeimosConstants.DEIMOS_DATE_FORMAT);
  } else {
    warn(MISSING_ELEMENT_WARNING, DeimosConstants.PATH_SCENE_CENTER_DATE);
  }
  return centerTime;
}
origin: senbox-org/s2tbx

  for (MetadataElement element : bandSpecificMetadataElements) {
    if (RapidEyeConstants.TAG_BAND_SPECIFIC_METADATA.equals(element.getName())) {
      ProductData.UTC currentTime = DateHelper.parseDate(element.getAttributeString(RapidEyeConstants.TAG_START_DATE_TIME, null),
                                RapidEyeConstants.UTC_DATE_FORMAT);
      if (bandsStartTime == null) {
productStartTime = DateHelper.parseDate(currentElement.getAttributeString(RapidEyeConstants.TAG_BEGIN_POSITION, null),
                    RapidEyeConstants.UTC_DATE_FORMAT);
origin: senbox-org/s2tbx

  for (MetadataElement element : bandSpecificMetadataElements) {
    if (RapidEyeConstants.TAG_BAND_SPECIFIC_METADATA.equals(element.getName())) {
      ProductData.UTC currentTime = DateHelper.parseDate(element.getAttributeString(RapidEyeConstants.TAG_END_DATE_TIME, null),
                                RapidEyeConstants.UTC_DATE_FORMAT);
      if (bandsEndTime == null) {
productEndTime = DateHelper.parseDate(currentElement.getAttributeString(RapidEyeConstants.TAG_END_POSITION, null),
                   RapidEyeConstants.UTC_DATE_FORMAT);
org.esa.snap.utilsDateHelper

Javadoc

Utility class for date manipulation

Most used methods

  • parseDate
    Utility method for returning a ProductData.UTC date from a string using the given date format. Why n
  • average
    Computes the median (average) of two ProductData.UTC data structures.

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JTable (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top PhpStorm plugins
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